pull/4529/head
yann300 1 year ago committed by ioedeveloper
parent f8448f5cab
commit d26d32b36c
  1. 6
      apps/remix-ide/src/blockchain/blockchain.tsx
  2. 5
      apps/remix-ide/src/blockchain/providers/vm.ts

@ -904,10 +904,10 @@ export class Blockchain extends Plugin {
return bufferToHex(value)
} else if (key === 'db') {
return value
} else {
return bufferToHex(value)
}
} else if (key === '') {
return value
}
return bufferToHex(value)
}, '\t')
this.call('fileManager', 'writeFile', '.states/state.json', stringifyed)
}, 500)

@ -39,7 +39,7 @@ export class VMProvider {
let incr = 0
const stamps = {}
return new Promise(async (resolve, reject) => {
return new Promise((resolve, reject) => {
this.worker.addEventListener('message', (msg) => {
if (msg.data.cmd === 'sendAsyncResult' && stamps[msg.data.stamp]) {
if (stamps[msg.data.stamp].callback) {
@ -78,6 +78,7 @@ export class VMProvider {
}
}
})
const init = async () => {
let stateDb
if (await this.plugin.call('fileManager', 'exists', '.states/state.json')) {
stateDb = await this.plugin.call('fileManager', 'readFile', '.states/state.json')
@ -89,6 +90,8 @@ export class VMProvider {
blockNumber: provider?.options['blockNumber'],
stateDb
})
}
init()
})
}

Loading…
Cancel
Save