fix dumping the storage

pull/3262/head^2
yann300 2 years ago committed by Aniket
parent 31dcf2b25c
commit 9f7d21edb7
  1. 11
      libs/remix-simulator/src/VmProxy.ts
  2. 4
      libs/remix-simulator/src/vm-context.ts

@ -135,12 +135,11 @@ export class VmProxy {
this.storageCache[this.processingHash] = {} this.storageCache[this.processingHash] = {}
this.storageCache['after_' + this.processingHash] = {} this.storageCache['after_' + this.processingHash] = {}
if (data.to) { if (data.to) {
try { ((processingHash, processingAccount, processingAddress, self) => {
const storage = await this.stateCopy.dumpStorage(data.to) self.stateCopy.dumpStorage(processingAccount).then((storage) => {
this.storageCache[this.processingHash][tx['to']] = storage self.storageCache[processingHash][processingAddress] = storage
} catch (e) { }).catch(console.log)
console.log(e) })(this.processingHash, data.to, tx['to'], this)
}
} }
this.processingIndex = 0 this.processingIndex = 0
} }

@ -46,9 +46,11 @@ class StateManagerCommonStorageDump extends DefaultStateManager {
} }
copy(): StateManagerCommonStorageDump { copy(): StateManagerCommonStorageDump {
return new StateManagerCommonStorageDump({ const copyState = new StateManagerCommonStorageDump({
trie: this._trie.copy(false), trie: this._trie.copy(false),
}) })
copyState.keyHashes = this.keyHashes
return copyState
} }
async dumpStorage (address): Promise<StorageDump> { async dumpStorage (address): Promise<StorageDump> {

Loading…
Cancel
Save