fix remix-debug unit tests

pull/5101/head
aniket-engg 3 months ago committed by Aniket
parent fa5192828d
commit d02b0d88c1
  1. 2
      libs/remix-debug/test/decoder/decodeInfo.ts
  2. 12
      libs/remix-debug/test/decoder/localsTests/int.ts

@ -47,7 +47,7 @@ tape('solidity', function (t) {
state = astHelper.extractStateDefinitions('test.sol:contractEnum', output.sources, null) state = astHelper.extractStateDefinitions('test.sol:contractEnum', output.sources, null)
stateDef = state.stateDefinitions stateDef = state.stateDefinitions
parsedType = decodeInfo.parseType(stateDef[1].typeDescriptions.typeString, states, 'contractEnum', null) parsedType = decodeInfo.parseType(stateDef[1].typeDescriptions.typeString, states, 'contractEnum', null)
checkDecodeInfo(st, parsedType, 1, 2, 'enum') checkDecodeInfo(st, parsedType, 1, 1, 'enum')
state = astHelper.extractStateDefinitions('test.sol:contractSmallVariable', output.sources, null) state = astHelper.extractStateDefinitions('test.sol:contractSmallVariable', output.sources, null)
stateDef = state.stateDefinitions stateDef = state.stateDefinitions

@ -49,7 +49,7 @@ module.exports = function (st, privateKey, contractBytecode, compilationResult,
try { try {
// test gas cost per line // test gas cost per line
st.equals((await callTree.getGasCostPerLine(0, 16)).gasCost, 11) st.equals((await callTree.getGasCostPerLine(0, 16)).gasCost, 10)
st.equals((await callTree.getGasCostPerLine(0, 32)).gasCost, 84) st.equals((await callTree.getGasCostPerLine(0, 32)).gasCost, 84)
const functions1 = callTree.retrieveFunctionsStack(103) const functions1 = callTree.retrieveFunctionsStack(103)
@ -60,12 +60,12 @@ module.exports = function (st, privateKey, contractBytecode, compilationResult,
st.equals(functions2.length, 3) st.equals(functions2.length, 3)
st.equals(functions3.length, 1) st.equals(functions3.length, 1)
st.equal(functions1[0].gasCost, 54) st.equal(functions1[0].gasCost, 53)
st.equal(functions1[1].gasCost, 436) st.equal(functions1[1].gasCost, 423)
st.equal(functions2[0].gasCost, 23) st.equal(functions2[0].gasCost, 22)
st.equal(functions2[1].gasCost, 54) st.equal(functions2[1].gasCost, 53)
st.equal(functions2[2].gasCost, 436) st.equal(functions2[2].gasCost, 423)
st.equals(Object.keys(functions1[0])[0], 'functionDefinition') st.equals(Object.keys(functions1[0])[0], 'functionDefinition')
st.equals(Object.keys(functions1[0])[1], 'inputs') st.equals(Object.keys(functions1[0])[1], 'inputs')

Loading…
Cancel
Save