|
|
@ -9,27 +9,27 @@ tape('solidity', function (t) { |
|
|
|
|
|
|
|
|
|
|
|
var stateDec = index.solidity.astHelper.extractStateVariables('contractUint', output.sources) |
|
|
|
var stateDec = index.solidity.astHelper.extractStateVariables('contractUint', output.sources) |
|
|
|
var decodeInfo = index.solidity.decodeInfo.decode(stateDec[0].attributes.type, stateDec) |
|
|
|
var decodeInfo = index.solidity.decodeInfo.decode(stateDec[0].attributes.type, stateDec) |
|
|
|
checkDecodeInfo(st, decodeInfo, false, 1, 'uint8', 'uint') |
|
|
|
checkDecodeInfo(st, decodeInfo, false, 1, 'uint8') |
|
|
|
decodeInfo = index.solidity.decodeInfo.decode(stateDec[2].attributes.type, stateDec) |
|
|
|
decodeInfo = index.solidity.decodeInfo.decode(stateDec[2].attributes.type, stateDec) |
|
|
|
checkDecodeInfo(st, decodeInfo, false, 32, 'uint256', 'uint') |
|
|
|
checkDecodeInfo(st, decodeInfo, false, 32, 'uint256') |
|
|
|
decodeInfo = index.solidity.decodeInfo.decode(stateDec[3].attributes.type, stateDec) |
|
|
|
decodeInfo = index.solidity.decodeInfo.decode(stateDec[3].attributes.type, stateDec) |
|
|
|
checkDecodeInfo(st, decodeInfo, false, 32, 'uint256', 'uint') |
|
|
|
checkDecodeInfo(st, decodeInfo, false, 32, 'uint256') |
|
|
|
|
|
|
|
|
|
|
|
stateDec = index.solidity.astHelper.extractStateVariables('contractStructAndArray', output.sources) |
|
|
|
stateDec = index.solidity.astHelper.extractStateVariables('contractStructAndArray', output.sources) |
|
|
|
decodeInfo = index.solidity.decodeInfo.decode(stateDec[1].attributes.type, stateDec) |
|
|
|
decodeInfo = index.solidity.decodeInfo.decode(stateDec[1].attributes.type, stateDec) |
|
|
|
checkDecodeInfo(st, decodeInfo, true, 64, 'struct structDef', 'struct') |
|
|
|
checkDecodeInfo(st, decodeInfo, true, 64, 'struct structDef') |
|
|
|
decodeInfo = index.solidity.decodeInfo.decode(stateDec[2].attributes.type, stateDec) |
|
|
|
decodeInfo = index.solidity.decodeInfo.decode(stateDec[2].attributes.type, stateDec) |
|
|
|
checkDecodeInfo(st, decodeInfo, true, 192, 'struct structDef[3]', 'arrayType') |
|
|
|
checkDecodeInfo(st, decodeInfo, true, 192, 'struct structDef[3]') |
|
|
|
decodeInfo = index.solidity.decodeInfo.decode(stateDec[3].attributes.type, stateDec) |
|
|
|
decodeInfo = index.solidity.decodeInfo.decode(stateDec[3].attributes.type, stateDec) |
|
|
|
checkDecodeInfo(st, decodeInfo, true, 48, 'bytes12[4]', 'arrayType') |
|
|
|
checkDecodeInfo(st, decodeInfo, true, 48, 'bytes12[4]') |
|
|
|
|
|
|
|
|
|
|
|
stateDec = index.solidity.astHelper.extractStateVariables('contractArray', output.sources) |
|
|
|
stateDec = index.solidity.astHelper.extractStateVariables('contractArray', output.sources) |
|
|
|
decodeInfo = index.solidity.decodeInfo.decode(stateDec[0].attributes.type, stateDec) |
|
|
|
decodeInfo = index.solidity.decodeInfo.decode(stateDec[0].attributes.type, stateDec) |
|
|
|
checkDecodeInfo(st, decodeInfo, true, 4 * 5, 'uint32[5]', 'arrayType') |
|
|
|
checkDecodeInfo(st, decodeInfo, true, 4 * 5, 'uint32[5]') |
|
|
|
decodeInfo = index.solidity.decodeInfo.decode(stateDec[1].attributes.type, stateDec) |
|
|
|
decodeInfo = index.solidity.decodeInfo.decode(stateDec[1].attributes.type, stateDec) |
|
|
|
checkDecodeInfo(st, decodeInfo, true, 32, 'int8[]', 'arrayType') |
|
|
|
checkDecodeInfo(st, decodeInfo, true, 32, 'int8[]') |
|
|
|
decodeInfo = index.solidity.decodeInfo.decode(stateDec[2].attributes.type, stateDec) |
|
|
|
decodeInfo = index.solidity.decodeInfo.decode(stateDec[2].attributes.type, stateDec) |
|
|
|
checkDecodeInfo(st, decodeInfo, true, 4 * 32, 'int16[][3][][4]', 'arrayType') |
|
|
|
checkDecodeInfo(st, decodeInfo, true, 4 * 32, 'int16[][3][][4]') |
|
|
|
st.end() |
|
|
|
st.end() |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
@ -38,7 +38,6 @@ function checkDecodeInfo (st, decodeInfo, freeSlot, storageBytes, typeName, name |
|
|
|
st.equal(decodeInfo.needsFreeStorageSlot, freeSlot) |
|
|
|
st.equal(decodeInfo.needsFreeStorageSlot, freeSlot) |
|
|
|
st.equal(decodeInfo.storageBytes, storageBytes) |
|
|
|
st.equal(decodeInfo.storageBytes, storageBytes) |
|
|
|
st.equal(decodeInfo.typeName, typeName) |
|
|
|
st.equal(decodeInfo.typeName, typeName) |
|
|
|
st.equal(decodeInfo.name, name) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var contracts = ` |
|
|
|
var contracts = ` |
|
|
|