From 7040895cf73dba31fd5b0ecde1a071f15bec304c Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Wed, 22 Jul 2020 17:21:15 -0400 Subject: [PATCH] remove callback from extractStateAt --- libs/remix-debug/src/Ethdebugger.js | 6 ++---- libs/remix-debug/test/debugger.js | 10 ++++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/libs/remix-debug/src/Ethdebugger.js b/libs/remix-debug/src/Ethdebugger.js index 612e6ffabf..dfef3a1a59 100644 --- a/libs/remix-debug/src/Ethdebugger.js +++ b/libs/remix-debug/src/Ethdebugger.js @@ -96,10 +96,8 @@ Ethdebugger.prototype.decodeLocalsAt = async function (step, sourceLocation, cal } /* decode state */ -Ethdebugger.prototype.extractStateAt = function (step, callback) { - this.solidityProxy.extractStateVariablesAt(step).then((stateVars) => { - callback(null, stateVars) - }).catch(callback) +Ethdebugger.prototype.extractStateAt = async function (step) { + return this.solidityProxy.extractStateVariablesAt(step) } Ethdebugger.prototype.decodeStateAt = function (step, stateVars, callback) { diff --git a/libs/remix-debug/test/debugger.js b/libs/remix-debug/test/debugger.js index fb0f75fde7..caa4de049f 100644 --- a/libs/remix-debug/test/debugger.js +++ b/libs/remix-debug/test/debugger.js @@ -235,10 +235,10 @@ function testDebugging (debugManager) { } }) - tape('traceManager.decodeStateAt', (t) => { + tape('traceManager.decodeStateAt', async (t) => { t.plan(7) - debugManager.extractStateAt(312, (error, state) => { - if (error) return t.end(error) + try { + const state = await debugManager.extractStateAt(312) debugManager.decodeStateAt(312, state, (error, decodedState) => { if (error) return t.end(error) console.log(decodedState) @@ -250,7 +250,9 @@ function testDebugging (debugManager) { t.equal(decodedState['proposals'].length, '0x1') t.equal(decodedState['proposals'].type, 'struct Ballot.Proposal[]') }) - }) + } catch (error) { + if (error) return t.end(error) + } }) tape('traceManager.decodeLocalsAt', async (t) => {