From 996832ef8e046623c17667f868d9de00e0697f47 Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Tue, 13 Oct 2020 12:32:17 +0100 Subject: [PATCH] Fix failing tests --- libs/remix-debug/test/debugger.js | 2 +- libs/remix-debug/test/decoder/contracts/structArrayLocal.js | 4 ---- libs/remix-debug/test/decoder/localsTests/structArray.js | 4 +--- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/libs/remix-debug/test/debugger.js b/libs/remix-debug/test/debugger.js index 1e2b208a3c..43d8a9e5f8 100644 --- a/libs/remix-debug/test/debugger.js +++ b/libs/remix-debug/test/debugger.js @@ -257,7 +257,7 @@ function testDebugging (debugManager) { tape('traceManager.decodeLocalsAt', async (t) => { t.plan(1) - const tested = JSON.parse('{"proposalNames":{"value":[{"value":"0x48656C6C6F20576F726C64210000000000000000000000000000000000000000","type":"bytes32"}],"length":"0x1","type":"bytes32[]"},"p":{"value":"45","type":"uint256"},"addressLocal":{"value":"0x4B0897B0513FDC7C541B6D9D7E929C4E5364D2DB","type":"address"},"i":{"value":"2","type":"uint256"},"proposalsLocals":{"value":[{"value":{"name":{"value":"0x48656C6C6F20576F726C64210000000000000000000000000000000000000000","type":"bytes32"},"voteCount":{"value":"0","type":"uint256"}},"type":"struct Ballot.Proposal"}],"length":"0x1","type":"struct Ballot.Proposal[]"}}') + const tested = JSON.parse('{"proposalNames":{"value":[{"value":"0x48656C6C6F20576F726C64210000000000000000000000000000000000000000","type":"bytes32"}],"length":"0x1","type":"bytes32[]","cursor":1,"hasNext":false},"p":{"value":"45","type":"uint256"},"addressLocal":{"value":"0x4B0897B0513FDC7C541B6D9D7E929C4E5364D2DB","type":"address"},"i":{"value":"2","type":"uint256"},"proposalsLocals":{"value":[{"value":{"name":{"value":"0x48656C6C6F20576F726C64210000000000000000000000000000000000000000","type":"bytes32"},"voteCount":{"value":"0","type":"uint256"}},"type":"struct Ballot.Proposal"}],"length":"0x1","type":"struct Ballot.Proposal[]"}}') try { const address = debugManager.traceManager.getCurrentCalledAddressAt(330) const location = await debugManager.sourceLocationFromVMTraceIndex(address, 330) diff --git a/libs/remix-debug/test/decoder/contracts/structArrayLocal.js b/libs/remix-debug/test/decoder/contracts/structArrayLocal.js index 48e695a5f5..c8391005d8 100644 --- a/libs/remix-debug/test/decoder/contracts/structArrayLocal.js +++ b/libs/remix-debug/test/decoder/contracts/structArrayLocal.js @@ -79,10 +79,6 @@ contract structArrayLocal { arrayStruct.b[1] = -23; arrayStruct.b[2] = -3; arrayStruct.c = enumdef.three; - bytes32[] memory dynamic = new bytes32[](2); - - dynamic[0] = 0x7465737400000000000000000000000000000000000000000000000000000000; - dynamic[1] = 0x7465737400000000000000000000000000000000000000000000000000000000; } } `} diff --git a/libs/remix-debug/test/decoder/localsTests/structArray.js b/libs/remix-debug/test/decoder/localsTests/structArray.js index 8b5b5d99bf..35a0f4cf50 100644 --- a/libs/remix-debug/test/decoder/localsTests/structArray.js +++ b/libs/remix-debug/test/decoder/localsTests/structArray.js @@ -30,7 +30,7 @@ module.exports = function (st, vm, privateKey, contractBytecode, compilationResu st.fail(error) }) callTree.event.register('callTreeReady', (scopes, scopeStarts) => { - helper.decodeLocals(st, 1719, traceManager, callTree, function (locals) { + helper.decodeLocals(st, 1622, traceManager, callTree, function (locals) { try { st.equals(locals['bytesSimple'].length, '0x14') st.equals(locals['bytesSimple'].value, '0x746573745f7375706572') @@ -91,8 +91,6 @@ module.exports = function (st, vm, privateKey, contractBytecode, compilationResu st.equals(locals['arrayStruct'].value.b.value[1].value, '-23') st.equals(locals['arrayStruct'].value.b.value[2].value, '-3') st.equals(locals['arrayStruct'].value.c.value, 'three') - st.equals(locals['dynamic'].value[0], '0x74657374') - st.equals(locals['dynamic'].value[1], '0x74657374') st.equals(Object.keys(locals).length, 8) } catch (e) {