make getTrace async

pull/573/head
yann300 4 years ago
parent ab8f1fb993
commit 5bcb215d89
  1. 46
      apps/remix-ide/src/app/tabs/debugger-tab.js

@ -104,31 +104,29 @@ class DebuggerTab extends ViewPlugin {
}) })
} }
getTrace (hash) { async getTrace (hash) {
if (!hash) return if (!hash) return
return new Promise(async (resolve, reject) => { /* eslint-disable-line */ try {
try { const web3 = await this.getDebugWeb3()
const web3 = await this.getDebugWeb3() const currentReceipt = await web3.eth.getTransactionReceipt(hash)
const currentReceipt = await web3.eth.getTransactionReceipt(hash) const debug = new Debugger({
const debug = new Debugger({ web3,
web3, offsetToLineColumnConverter: this.offsetToLineColumnConverter,
offsetToLineColumnConverter: this.offsetToLineColumnConverter, compilationResult: async (address) => {
compilationResult: async (address) => { try {
try { return await this.fetchContractAndCompile(address, currentReceipt)
return await this.fetchContractAndCompile(address, currentReceipt) } catch (e) {
} catch (e) { console.error(e)
console.error(e) }
} return null
return null },
}, debugWithGeneratedSources: false
debugWithGeneratedSources: false })
})
return await debug.debugger.traceManager.getTrace(hash)
resolve(await debug.debugger.traceManager.getTrace(hash)) } catch (e) {
} catch (e) { throw e
reject(e) }
}
})
} }
fetchContractAndCompile (address, receipt) { fetchContractAndCompile (address, receipt) {

Loading…
Cancel
Save