Commit e8475775 authored by Iuri Matias's avatar Iuri Matias

remove callback from extractStateAt

parent 507d6429
...@@ -96,10 +96,8 @@ Ethdebugger.prototype.decodeLocalsAt = async function (step, sourceLocation, cal ...@@ -96,10 +96,8 @@ Ethdebugger.prototype.decodeLocalsAt = async function (step, sourceLocation, cal
} }
/* decode state */ /* decode state */
Ethdebugger.prototype.extractStateAt = function (step, callback) { Ethdebugger.prototype.extractStateAt = async function (step) {
this.solidityProxy.extractStateVariablesAt(step).then((stateVars) => { return this.solidityProxy.extractStateVariablesAt(step)
callback(null, stateVars)
}).catch(callback)
} }
Ethdebugger.prototype.decodeStateAt = function (step, stateVars, callback) { Ethdebugger.prototype.decodeStateAt = function (step, stateVars, callback) {
......
...@@ -235,10 +235,10 @@ function testDebugging (debugManager) { ...@@ -235,10 +235,10 @@ function testDebugging (debugManager) {
} }
}) })
tape('traceManager.decodeStateAt', (t) => { tape('traceManager.decodeStateAt', async (t) => {
t.plan(7) t.plan(7)
debugManager.extractStateAt(312, (error, state) => { try {
if (error) return t.end(error) const state = await debugManager.extractStateAt(312)
debugManager.decodeStateAt(312, state, (error, decodedState) => { debugManager.decodeStateAt(312, state, (error, decodedState) => {
if (error) return t.end(error) if (error) return t.end(error)
console.log(decodedState) console.log(decodedState)
...@@ -250,7 +250,9 @@ function testDebugging (debugManager) { ...@@ -250,7 +250,9 @@ function testDebugging (debugManager) {
t.equal(decodedState['proposals'].length, '0x1') t.equal(decodedState['proposals'].length, '0x1')
t.equal(decodedState['proposals'].type, 'struct Ballot.Proposal[]') t.equal(decodedState['proposals'].type, 'struct Ballot.Proposal[]')
}) })
}) } catch (error) {
if (error) return t.end(error)
}
}) })
tape('traceManager.decodeLocalsAt', async (t) => { tape('traceManager.decodeLocalsAt', async (t) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment