use async/await

pull/5370/head
yann300 4 years ago
parent 4bc73f29c3
commit 7d3daf6ea0
  1. 11
      libs/remix-lib/src/execution/execution-context.ts

@ -40,8 +40,9 @@ class StateManagerCommonStorageDump extends StateManager {
} }
dumpStorage (address) { dumpStorage (address) {
return new Promise<StorageDump>((resolve, reject) => { return new Promise<StorageDump>(async (resolve, reject) => {
this._getStorageTrie(address).then((trie) => { try {
const trie = await this._getStorageTrie(address)
const storage = {} const storage = {}
const stream = trie.createReadStream() const stream = trie.createReadStream()
stream.on('data', (val) => { stream.on('data', (val) => {
@ -54,9 +55,9 @@ class StateManagerCommonStorageDump extends StateManager {
stream.on('end', function () { stream.on('end', function () {
resolve(storage) resolve(storage)
}) })
}).catch((error) => { } catch (e) {
reject(error) reject(e)
}) }
}) })
} }

Loading…
Cancel
Save