|
|
|
@ -8,7 +8,7 @@ tape('solidity', function (t) { |
|
|
|
|
t.test('astHelper, decodeInfo', function (st) { |
|
|
|
|
var output = compiler.compile(contracts, 0) |
|
|
|
|
|
|
|
|
|
var stateDec = index.solidity.astHelper.extractStateVariables('contractUint', output.sources) |
|
|
|
|
var stateDec = index.solidity.astHelper.extractState('contractUint', output.sources).stateItems |
|
|
|
|
var decodeInfo = index.solidity.decodeInfo.parseType(stateDec[0].attributes.type, stateDec) |
|
|
|
|
checkDecodeInfo(st, decodeInfo, 1, 1, 'uint') |
|
|
|
|
decodeInfo = index.solidity.decodeInfo.parseType(stateDec[2].attributes.type, stateDec) |
|
|
|
@ -18,7 +18,7 @@ tape('solidity', function (t) { |
|
|
|
|
decodeInfo = index.solidity.decodeInfo.parseType(stateDec[4].attributes.type, stateDec) |
|
|
|
|
checkDecodeInfo(st, decodeInfo, 1, 16, 'bytesX') |
|
|
|
|
|
|
|
|
|
stateDec = index.solidity.astHelper.extractStateVariables('contractStructAndArray', output.sources) |
|
|
|
|
stateDec = index.solidity.astHelper.extractState('contractStructAndArray', output.sources).stateItems |
|
|
|
|
decodeInfo = index.solidity.decodeInfo.parseType(stateDec[1].attributes.type, stateDec) |
|
|
|
|
checkDecodeInfo(st, decodeInfo, 2, 32, 'struct') |
|
|
|
|
decodeInfo = index.solidity.decodeInfo.parseType(stateDec[2].attributes.type, stateDec) |
|
|
|
@ -26,7 +26,7 @@ tape('solidity', function (t) { |
|
|
|
|
decodeInfo = index.solidity.decodeInfo.parseType(stateDec[3].attributes.type, stateDec) |
|
|
|
|
checkDecodeInfo(st, decodeInfo, 2, 32, 'array') |
|
|
|
|
|
|
|
|
|
stateDec = index.solidity.astHelper.extractStateVariables('contractArray', output.sources) |
|
|
|
|
stateDec = index.solidity.astHelper.extractState('contractArray', output.sources).stateItems |
|
|
|
|
decodeInfo = index.solidity.decodeInfo.parseType(stateDec[0].attributes.type, stateDec) |
|
|
|
|
checkDecodeInfo(st, decodeInfo, 1, 32, 'array') |
|
|
|
|
decodeInfo = index.solidity.decodeInfo.parseType(stateDec[1].attributes.type, stateDec) |
|
|
|
@ -34,11 +34,11 @@ tape('solidity', function (t) { |
|
|
|
|
decodeInfo = index.solidity.decodeInfo.parseType(stateDec[2].attributes.type, stateDec) |
|
|
|
|
checkDecodeInfo(st, decodeInfo, 4, 32, 'array') |
|
|
|
|
|
|
|
|
|
stateDec = index.solidity.astHelper.extractStateVariables('contractEnum', output.sources) |
|
|
|
|
stateDec = index.solidity.astHelper.extractState('contractEnum', output.sources).stateItems |
|
|
|
|
decodeInfo = index.solidity.decodeInfo.parseType(stateDec[1].attributes.type, stateDec) |
|
|
|
|
checkDecodeInfo(st, decodeInfo, 1, 2, 'enum') |
|
|
|
|
|
|
|
|
|
stateDec = index.solidity.astHelper.extractStateVariables('contractSmallVariable', output.sources) |
|
|
|
|
stateDec = index.solidity.astHelper.extractState('contractSmallVariable', output.sources).stateItems |
|
|
|
|
decodeInfo = index.solidity.decodeInfo.parseType(stateDec[0].attributes.type, stateDec) |
|
|
|
|
checkDecodeInfo(st, decodeInfo, 1, 1, 'int') |
|
|
|
|
decodeInfo = index.solidity.decodeInfo.parseType(stateDec[1].attributes.type, stateDec) |
|
|
|
|