Skip to content

Commit

Permalink
stateManager: make clearOriginalStorageCache public
Browse files Browse the repository at this point in the history
  • Loading branch information
s1na committed Jun 4, 2020
1 parent 2898e3a commit fb73c97
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
1 change: 1 addition & 0 deletions packages/vm/lib/state/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export interface StateManager {
getContractCode(address: Buffer): Promise<Buffer>
getContractStorage(address: Buffer, key: Buffer): Promise<Buffer>
getOriginalContractStorage(address: Buffer, key: Buffer): Promise<Buffer>
clearOriginalStorageCache(): void
putContractStorage(address: Buffer, key: Buffer, value: Buffer): Promise<void>
clearContractStorage(address: Buffer): Promise<void>
checkpoint(): Promise<void>
Expand Down
17 changes: 8 additions & 9 deletions packages/vm/lib/state/stateManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
}
}

0 comments on commit fb73c97

Please sign in to comment.