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) return bufferToHex(value)
} else if (key === 'db') { } else if (key === 'db') {
return value return value
} else { } else if (key === '') {
return bufferToHex(value)
}
return value return value
}
return bufferToHex(value)
}, '\t') }, '\t')
this.call('fileManager', 'writeFile', '.states/state.json', stringifyed) this.call('fileManager', 'writeFile', '.states/state.json', stringifyed)
}, 500) }, 500)

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

Loading…
Cancel
Save