|
|
@ -82,6 +82,7 @@ class DebuggerTab extends ViewPlugin { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
debug (hash) { |
|
|
|
debug (hash) { |
|
|
|
|
|
|
|
this.debugHash = '' // so we can trigger a debug using the same hash 2 times in a row. that's needs to be improved
|
|
|
|
this.debugHash = hash |
|
|
|
this.debugHash = hash |
|
|
|
this.renderComponent() |
|
|
|
this.renderComponent() |
|
|
|
} |
|
|
|
} |
|
|
@ -105,6 +106,7 @@ class DebuggerTab extends ViewPlugin { |
|
|
|
getTrace (hash) { |
|
|
|
getTrace (hash) { |
|
|
|
if (!hash) return |
|
|
|
if (!hash) return |
|
|
|
return new Promise(async (resolve, reject) => { /* eslint-disable-line */ |
|
|
|
return new Promise(async (resolve, reject) => { /* eslint-disable-line */ |
|
|
|
|
|
|
|
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({ |
|
|
@ -121,21 +123,17 @@ class DebuggerTab extends ViewPlugin { |
|
|
|
debugWithGeneratedSources: false |
|
|
|
debugWithGeneratedSources: false |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
setState(prevState => { |
|
|
|
resolve(await debug.debugger.traceManager.getTrace(hash))
|
|
|
|
return { ...prevState, currentReceipt } |
|
|
|
} catch (e) { |
|
|
|
}) |
|
|
|
reject(e) |
|
|
|
|
|
|
|
}
|
|
|
|
debug.debugger.traceManager.traceRetriever.getTrace(hash, (error, trace) => { |
|
|
|
|
|
|
|
if (error) return reject(error) |
|
|
|
|
|
|
|
resolve(trace) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fetchContractAndCompile (address, receipt) { |
|
|
|
fetchContractAndCompile (address, receipt) { |
|
|
|
const target = (address && remixDebug.traceHelper.isContractCreation(address)) ? receipt.contractAddress : address |
|
|
|
const target = (address && remixDebug.traceHelper.isContractCreation(address)) ? receipt.contractAddress : address |
|
|
|
|
|
|
|
|
|
|
|
return debuggerModule.call('fetchAndCompile', 'resolve', target || receipt.contractAddress || receipt.to, '.debug', debuggerModule.blockchain.web3()) |
|
|
|
return this.call('fetchAndCompile', 'resolve', target || receipt.contractAddress || receipt.to, '.debug', this.blockchain.web3()) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// debugger () {
|
|
|
|
// debugger () {
|
|
|
|