use enclosure to dump the storage && duplicate instantiating

pull/3285/head^2
yann300 2 years ago committed by Aniket
parent 4f3e6a8a85
commit a1a749f799
  1. 17
      libs/remix-simulator/src/VmProxy.ts

@ -191,9 +191,15 @@ export class VmProxy {
const to = this.txs[this.processingHash].to
if (to) {
try {
const account = Address.fromString(to)
const storage = await this.vm.stateManager.dumpStorage(account)
this.storageCache['after_' + this.processingHash][to] = storage
(async (processingHash, processingAddress, self) => {
try {
const account = Address.fromString(processingAddress)
const storage = await self.stateCopy.dumpStorage(account)
self.storageCache[processingHash][processingAddress] = storage
} catch (e) {
console.log(e)
}
})(this.processingHash, to, this)
} catch (e) {
console.log(e)
}
@ -201,8 +207,9 @@ export class VmProxy {
if (data.createdAddress) {
const address = data.createdAddress.toString()
this.vmTraces[this.processingHash].return = toChecksumAddress(address)
this.txsReceipt[this.processingHash].contractAddress = toChecksumAddress(address)
const checksumedAddress = toChecksumAddress(address)
this.vmTraces[this.processingHash].return = checksumedAddress
this.txsReceipt[this.processingHash].contractAddress = checksumedAddress
} else if (data.execResult.returnValue) {
this.vmTraces[this.processingHash].return = '0x' + data.execResult.returnValue.toString('hex')
} else {

Loading…
Cancel
Save