|
|
|
@ -76,7 +76,7 @@ function testRevertStateSubCall (st, privateKey, contractAddress, output, compil |
|
|
|
|
tx: tx, |
|
|
|
|
address: contractAddress |
|
|
|
|
}, new StorageResolver({ web3 }), traceManager) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const stateVarsMyContract = stateDecoder.extractStateVariables('MyContract', output.sources) |
|
|
|
|
stateDecoder.decodeState(stateVarsMyContract, storageViewerMyContract).then((result) => { |
|
|
|
|
const contractAddressOtherContract = result['myCall'].value |
|
|
|
@ -97,31 +97,31 @@ function testRevertStateSubCall (st, privateKey, contractAddress, output, compil |
|
|
|
|
tx: tx, |
|
|
|
|
address: contractAddressOtherContract |
|
|
|
|
}, new StorageResolver({ web3 }), traceManager) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const stateVars = stateDecoder.extractStateVariables('OtherContract', output.sources) |
|
|
|
|
stateDecoder.decodeState(stateVars, storageViewerOtherContract1).then((result) => { |
|
|
|
|
// value should be set
|
|
|
|
|
st.equal(result['p'].value, '234') |
|
|
|
|
stateDecoder.decodeState(stateVars, storageViewerOtherContract2).then((result) => { |
|
|
|
|
// in the other sub call, the value is reverted
|
|
|
|
|
st.equal(result['p'].value, '0') |
|
|
|
|
stateDecoder.decodeState(stateVars, storageViewerOtherContract3).then((result) => { |
|
|
|
|
// and reset back to 234
|
|
|
|
|
st.equal(result['p'].value, '234') |
|
|
|
|
cb() |
|
|
|
|
}, (reason) => { |
|
|
|
|
console.log('fail') |
|
|
|
|
st.end(reason) |
|
|
|
|
}) |
|
|
|
|
// in the other sub call, the value is reverted
|
|
|
|
|
st.equal(result['p'].value, '0') |
|
|
|
|
stateDecoder.decodeState(stateVars, storageViewerOtherContract3).then((result) => { |
|
|
|
|
// and reset back to 234
|
|
|
|
|
st.equal(result['p'].value, '234') |
|
|
|
|
cb() |
|
|
|
|
}, (reason) => { |
|
|
|
|
console.log('fail') |
|
|
|
|
st.end(reason) |
|
|
|
|
}) |
|
|
|
|
}, (reason) => { |
|
|
|
|
console.log('fail') |
|
|
|
|
st.end(reason) |
|
|
|
|
}) |
|
|
|
|
}, (reason) => { |
|
|
|
|
console.log('fail') |
|
|
|
|
st.end(reason) |
|
|
|
|
}) |
|
|
|
|
})
|
|
|
|
|
}, (reason) => { |
|
|
|
|
console.log('fail') |
|
|
|
|
st.end(reason) |
|
|
|
|
console.log('fail') |
|
|
|
|
st.end(reason) |
|
|
|
|
}) |
|
|
|
|
traceManager.resolveTrace(tx).then(() => { |
|
|
|
|
debuggerEvent.trigger('newTraceLoaded', [traceManager.trace]) |
|
|
|
|