From fb73c97b81f53d2a3f465c65627c67a9a977c660 Mon Sep 17 00:00:00 2001 From: Sina Mahmoodi Date: Thu, 4 Jun 2020 12:30:17 +0200 Subject: [PATCH] stateManager: make clearOriginalStorageCache public --- packages/vm/lib/state/interface.ts | 1 + packages/vm/lib/state/stateManager.ts | 17 ++++++++--------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/vm/lib/state/interface.ts b/packages/vm/lib/state/interface.ts index c5e93715ba3..eb94531f902 100644 --- a/packages/vm/lib/state/interface.ts +++ b/packages/vm/lib/state/interface.ts @@ -16,6 +16,7 @@ export interface StateManager { getContractCode(address: Buffer): Promise getContractStorage(address: Buffer, key: Buffer): Promise getOriginalContractStorage(address: Buffer, key: Buffer): Promise + clearOriginalStorageCache(): void putContractStorage(address: Buffer, key: Buffer, value: Buffer): Promise clearContractStorage(address: Buffer): Promise checkpoint(): Promise diff --git a/packages/vm/lib/state/stateManager.ts b/packages/vm/lib/state/stateManager.ts index 2fd70085c22..ef371ce887c 100644 --- a/packages/vm/lib/state/stateManager.ts +++ b/packages/vm/lib/state/stateManager.ts @@ -216,6 +216,14 @@ export default class DefaultStateManager implements StateManager { } } + /** + * Clears the original storage cache. Refer to [[getOriginalContractStorage]] + * for more explanation. + */ + clearOriginalStorageCache(): void { + this._originalStorageCache = new Map() + } + /** * Modifies the storage trie of an account. * @private @@ -496,13 +504,4 @@ export default class DefaultStateManager implements StateManager { } this._touched.clear() } - - /** - * Clears the original storage cache. Refer to [[getOriginalContractStorage]] - * for more explanation. - * @ignore - */ - _clearOriginalStorageCache(): void { - this._originalStorageCache = new Map() - } }