fix dumping the storage

pull/3262/head^2
yann300 2 years ago committed by Aniket
parent 31dcf2b25c
commit 9f7d21edb7
  1. 13
      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['after_' + this.processingHash] = {}
if (data.to) {
try {
const storage = await this.stateCopy.dumpStorage(data.to)
this.storageCache[this.processingHash][tx['to']] = storage
} catch (e) {
console.log(e)
}
((processingHash, processingAccount, processingAddress, self) => {
self.stateCopy.dumpStorage(processingAccount).then((storage) => {
self.storageCache[processingHash][processingAddress] = storage
}).catch(console.log)
})(this.processingHash, data.to, tx['to'], this)
}
this.processingIndex = 0
}
@ -265,7 +264,7 @@ export class VmProxy {
self.stateCopy.dumpStorage(account).then((storage) => {
self.storageCache[processingHash][processingAddress] = storage
}).catch(console.log)
})(this.processingHash, this.processingAddress, this)
})(this.processingHash, this.processingAddress, this)
}
}
}

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

Loading…
Cancel
Save