remix-project mirror
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
remix-project/libs/remix-debug/test/decoder/storageDecoder.ts

280 lines
16 KiB

8 years ago
'use strict'
import tape from 'tape'
4 years ago
import { compile } from 'solc'
import * as stateDecoder from '../../src/solidity-decoder/stateDecoder'
4 years ago
import { MockStorageResolver } from './mockStorageResolver'
import { compilerInput } from '../helpers/compilerHelper'
# This is a combination of 50 commits. # This is the 1st commit message: executors # This is the commit message #2: libs # This is the commit message #3: remixd # This is the commit message #4: add react app # This is the commit message #5: debugging # This is the commit message #6: debug + sol # This is the commit message #7: fixes # This is the commit message #8: tsconfig # This is the commit message #9: ast walker # This is the commit message #10: as walker # This is the commit message #11: remixd etc # This is the commit message #12: commander # This is the commit message #13: remove jest # This is the commit message #14: rm ui files # This is the commit message #15: rm reserved keywords # This is the commit message #16: testrunner # This is the commit message #17: compiler # This is the commit message #18: production build # This is the commit message #19: config # This is the commit message #20: config # This is the commit message #21: web types # This is the commit message #22: update react # This is the commit message #23: add vm # This is the commit message #24: add workers # This is the commit message #25: worker2 # This is the commit message #26: rm react app # This is the commit message #27: remixd # This is the commit message #28: worker fix # This is the commit message #29: fix detection # This is the commit message #30: revert react # This is the commit message #31: rename type # This is the commit message #32: loading handler # This is the commit message #33: remove import # This is the commit message #34: rename # This is the commit message #35: local plugin # This is the commit message #36: etherscan # This is the commit message #37: revert react # This is the commit message #38: port # This is the commit message #39: rm worker # This is the commit message #40: publicpath # This is the commit message #41: fix test # This is the commit message #42: 112 # This is the commit message #43: show version # This is the commit message #44: "axios": "1.1.2", # This is the commit message #45: config # This is the commit message #46: lint # This is the commit message #47: fix build # This is the commit message #48: lint # This is the commit message #49: error on purpose # This is the commit message #50: test error
2 years ago
const testMappingStorage = require('./stateTests/mapping')
8 years ago
tape('solidity', function (t) {
t.test('storage decoder', function (st) {
2 years ago
console.log('test int storage')
8 years ago
testIntStorage(st, function () {
2 years ago
console.log('test byte storage')
8 years ago
testByteStorage(st, function () {
2 years ago
console.log('test struct storage')
8 years ago
testStructArrayStorage(st, function () {
2 years ago
console.log('test mapping storage')
7 years ago
testMappingStorage(st, function () {
st.end()
})
8 years ago
})
})
})
8 years ago
})
})
8 years ago
function testIntStorage (st, cb) {
# This is a combination of 50 commits. # This is the 1st commit message: executors # This is the commit message #2: libs # This is the commit message #3: remixd # This is the commit message #4: add react app # This is the commit message #5: debugging # This is the commit message #6: debug + sol # This is the commit message #7: fixes # This is the commit message #8: tsconfig # This is the commit message #9: ast walker # This is the commit message #10: as walker # This is the commit message #11: remixd etc # This is the commit message #12: commander # This is the commit message #13: remove jest # This is the commit message #14: rm ui files # This is the commit message #15: rm reserved keywords # This is the commit message #16: testrunner # This is the commit message #17: compiler # This is the commit message #18: production build # This is the commit message #19: config # This is the commit message #20: config # This is the commit message #21: web types # This is the commit message #22: update react # This is the commit message #23: add vm # This is the commit message #24: add workers # This is the commit message #25: worker2 # This is the commit message #26: rm react app # This is the commit message #27: remixd # This is the commit message #28: worker fix # This is the commit message #29: fix detection # This is the commit message #30: revert react # This is the commit message #31: rename type # This is the commit message #32: loading handler # This is the commit message #33: remove import # This is the commit message #34: rename # This is the commit message #35: local plugin # This is the commit message #36: etherscan # This is the commit message #37: revert react # This is the commit message #38: port # This is the commit message #39: rm worker # This is the commit message #40: publicpath # This is the commit message #41: fix test # This is the commit message #42: 112 # This is the commit message #43: show version # This is the commit message #44: "axios": "1.1.2", # This is the commit message #45: config # This is the commit message #46: lint # This is the commit message #47: fix build # This is the commit message #48: lint # This is the commit message #49: error on purpose # This is the commit message #50: test error
2 years ago
const intStorage = require('./contracts/intStorage')
let output = compile(compilerInput(intStorage.contract))
output = JSON.parse(output)
# This is a combination of 50 commits. # This is the 1st commit message: executors # This is the commit message #2: libs # This is the commit message #3: remixd # This is the commit message #4: add react app # This is the commit message #5: debugging # This is the commit message #6: debug + sol # This is the commit message #7: fixes # This is the commit message #8: tsconfig # This is the commit message #9: ast walker # This is the commit message #10: as walker # This is the commit message #11: remixd etc # This is the commit message #12: commander # This is the commit message #13: remove jest # This is the commit message #14: rm ui files # This is the commit message #15: rm reserved keywords # This is the commit message #16: testrunner # This is the commit message #17: compiler # This is the commit message #18: production build # This is the commit message #19: config # This is the commit message #20: config # This is the commit message #21: web types # This is the commit message #22: update react # This is the commit message #23: add vm # This is the commit message #24: add workers # This is the commit message #25: worker2 # This is the commit message #26: rm react app # This is the commit message #27: remixd # This is the commit message #28: worker fix # This is the commit message #29: fix detection # This is the commit message #30: revert react # This is the commit message #31: rename type # This is the commit message #32: loading handler # This is the commit message #33: remove import # This is the commit message #34: rename # This is the commit message #35: local plugin # This is the commit message #36: etherscan # This is the commit message #37: revert react # This is the commit message #38: port # This is the commit message #39: rm worker # This is the commit message #40: publicpath # This is the commit message #41: fix test # This is the commit message #42: 112 # This is the commit message #43: show version # This is the commit message #44: "axios": "1.1.2", # This is the commit message #45: config # This is the commit message #46: lint # This is the commit message #47: fix build # This is the commit message #48: lint # This is the commit message #49: error on purpose # This is the commit message #50: test error
2 years ago
let mockStorageResolver
for (const storage of [intStorage.fullStorage, shrinkStorage(intStorage.fullStorage)]) {
8 years ago
mockStorageResolver = new MockStorageResolver(storage)
stateDecoder.solidityState(mockStorageResolver, output.sources, 'intStorage').then((decoded) => {
st.equal(decoded['ui8'].value, '130')
st.equal(decoded['ui16'].value, '456')
st.equal(decoded['ui32'].value, '4356')
st.equal(decoded['ui64'].value, '3543543543')
st.equal(decoded['ui128'].value, '234567')
st.equal(decoded['ui256'].value, '115792089237316195423570985008687907853269984665640564039457584007880697216513')
st.equal(decoded['ui'].value, '123545666')
st.equal(decoded['i8'].value, '-45')
st.equal(decoded['i16'].value, '-1234')
st.equal(decoded['i32'].value, '3455')
st.equal(decoded['i64'].value, '-35566')
st.equal(decoded['i128'].value, '-444444')
st.equal(decoded['i256'].value, '3434343')
st.equal(decoded['i'].value, '-32432423423')
st.equal(decoded['ishrink'].value, '2')
})
8 years ago
}
8 years ago
8 years ago
mockStorageResolver = new MockStorageResolver({})
stateDecoder.solidityState(mockStorageResolver, output.sources, 'intStorage').then((decoded) => {
st.equal(decoded['ui8'].value, '0')
st.equal(decoded['ui16'].value, '0')
st.equal(decoded['ui32'].value, '0')
st.equal(decoded['ui64'].value, '0')
st.equal(decoded['ui128'].value, '0')
st.equal(decoded['ui256'].value, '0')
st.equal(decoded['ui'].value, '0')
st.equal(decoded['i8'].value, '0')
st.equal(decoded['i16'].value, '0')
st.equal(decoded['i32'].value, '0')
st.equal(decoded['i64'].value, '0')
st.equal(decoded['i128'].value, '0')
st.equal(decoded['i256'].value, '0')
st.equal(decoded['i'].value, '0')
st.equal(decoded['ishrink'].value, '0')
cb()
})
8 years ago
}
8 years ago
function testByteStorage (st, cb) {
# This is a combination of 50 commits. # This is the 1st commit message: executors # This is the commit message #2: libs # This is the commit message #3: remixd # This is the commit message #4: add react app # This is the commit message #5: debugging # This is the commit message #6: debug + sol # This is the commit message #7: fixes # This is the commit message #8: tsconfig # This is the commit message #9: ast walker # This is the commit message #10: as walker # This is the commit message #11: remixd etc # This is the commit message #12: commander # This is the commit message #13: remove jest # This is the commit message #14: rm ui files # This is the commit message #15: rm reserved keywords # This is the commit message #16: testrunner # This is the commit message #17: compiler # This is the commit message #18: production build # This is the commit message #19: config # This is the commit message #20: config # This is the commit message #21: web types # This is the commit message #22: update react # This is the commit message #23: add vm # This is the commit message #24: add workers # This is the commit message #25: worker2 # This is the commit message #26: rm react app # This is the commit message #27: remixd # This is the commit message #28: worker fix # This is the commit message #29: fix detection # This is the commit message #30: revert react # This is the commit message #31: rename type # This is the commit message #32: loading handler # This is the commit message #33: remove import # This is the commit message #34: rename # This is the commit message #35: local plugin # This is the commit message #36: etherscan # This is the commit message #37: revert react # This is the commit message #38: port # This is the commit message #39: rm worker # This is the commit message #40: publicpath # This is the commit message #41: fix test # This is the commit message #42: 112 # This is the commit message #43: show version # This is the commit message #44: "axios": "1.1.2", # This is the commit message #45: config # This is the commit message #46: lint # This is the commit message #47: fix build # This is the commit message #48: lint # This is the commit message #49: error on purpose # This is the commit message #50: test error
2 years ago
const byteStorage = require('./contracts/byteStorage')
let output = compile(compilerInput(byteStorage.contract))
output = JSON.parse(output)
# This is a combination of 50 commits. # This is the 1st commit message: executors # This is the commit message #2: libs # This is the commit message #3: remixd # This is the commit message #4: add react app # This is the commit message #5: debugging # This is the commit message #6: debug + sol # This is the commit message #7: fixes # This is the commit message #8: tsconfig # This is the commit message #9: ast walker # This is the commit message #10: as walker # This is the commit message #11: remixd etc # This is the commit message #12: commander # This is the commit message #13: remove jest # This is the commit message #14: rm ui files # This is the commit message #15: rm reserved keywords # This is the commit message #16: testrunner # This is the commit message #17: compiler # This is the commit message #18: production build # This is the commit message #19: config # This is the commit message #20: config # This is the commit message #21: web types # This is the commit message #22: update react # This is the commit message #23: add vm # This is the commit message #24: add workers # This is the commit message #25: worker2 # This is the commit message #26: rm react app # This is the commit message #27: remixd # This is the commit message #28: worker fix # This is the commit message #29: fix detection # This is the commit message #30: revert react # This is the commit message #31: rename type # This is the commit message #32: loading handler # This is the commit message #33: remove import # This is the commit message #34: rename # This is the commit message #35: local plugin # This is the commit message #36: etherscan # This is the commit message #37: revert react # This is the commit message #38: port # This is the commit message #39: rm worker # This is the commit message #40: publicpath # This is the commit message #41: fix test # This is the commit message #42: 112 # This is the commit message #43: show version # This is the commit message #44: "axios": "1.1.2", # This is the commit message #45: config # This is the commit message #46: lint # This is the commit message #47: fix build # This is the commit message #48: lint # This is the commit message #49: error on purpose # This is the commit message #50: test error
2 years ago
let mockStorageResolver
for (const storage of [byteStorage.storage, shrinkStorage(byteStorage.storage)]) {
8 years ago
mockStorageResolver = new MockStorageResolver(storage)
stateDecoder.solidityState(mockStorageResolver, output.sources, 'byteStorage').then((decoded) => {
st.equal(decoded['b1'].value, false)
st.equal(decoded['a1'].value, '0xFE350F199F244AC9A79038D254400B632A633225')
st.equal(decoded['b2'].value, true)
st.equal(decoded['dynb1'].value, '0x64796e616d69636279746573')
st.equal(decoded['dynb1'].length, '0xc')
st.equal(decoded['stab'].value, '0x01')
st.equal(decoded['stab1'].value, '0x12')
st.equal(decoded['stab2'].value, '0x1579')
st.equal(decoded['stab3'].value, '0x359356')
st.equal(decoded['stab4'].value, '0x23750000')
st.equal(decoded['stab5'].value, '0x0235764500')
st.equal(decoded['stab6'].value, '0x324435000000')
st.equal(decoded['stab7'].value, '0x00432400000000')
st.equal(decoded['stab8'].value, '0x3245546457650000')
st.equal(decoded['stab9'].value, '0x034345430000000000')
st.equal(decoded['stab10'].value, '0x04543543654657000000')
st.equal(decoded['stab11'].value, '0x5435465400000000000000')
st.equal(decoded['stab12'].value, '0x030000000000000000000000')
st.equal(decoded['stab13'].value, '0x03243242345435000000000000')
st.equal(decoded['stab14'].value, '0x3245435435435300000000000000')
st.equal(decoded['stab15'].value, '0x032454434435000000000000000000')
st.equal(decoded['stab16'].value, '0x32454354440000000000000000000000')
st.equal(decoded['stab17'].value, '0x0324543432432432450000000000000000')
st.equal(decoded['stab18'].value, '0x032453432543543500000000000000000000')
st.equal(decoded['stab19'].value, '0x03245434354354350000000000000000000000')
st.equal(decoded['stab20'].value, '0x032454543543AB35000000000000000000000000')
st.equal(decoded['stab21'].value, '0x324544324234350000000000000000000000000000')
st.equal(decoded['stab22'].value, '0x324543AEF50000000000000000000000000000000000')
st.equal(decoded['stab23'].value, '0x3245435FFF000000000000000000000000000000000000')
st.equal(decoded['stab24'].value, '0x3245435F0000000000000000000000000000000000000000')
st.equal(decoded['stab25'].value, '0x3245435F000000000000000000000000000000000000000000')
st.equal(decoded['stab26'].value, '0x3245435F00000000000000000000000000000000000000000000')
st.equal(decoded['stab27'].value, '0x03245FFFFFFF000000000000000000000000000000000000000000')
st.equal(decoded['stab28'].value, '0x03241235000000000000000000000000000000000000000000000000')
st.equal(decoded['stab29'].value, '0x0325213213000000000000000000000000000000000000000000000000')
st.equal(decoded['stab30'].value, '0x032454352324230000000000000000000000000000000000000000000000')
st.equal(decoded['stab31'].value, '0x32454351230000000000000000000000000000000000000000000000000000')
st.equal(decoded['stab32'].value, '0x324324423432543543AB00000000000000000000000000000000000000000000')
st.equal(decoded['enumDec'].value, 'e240')
st.equal(decoded['str1'].value, 'short')
st.equal(decoded['str12'].value, 'шеллы')
8 years ago
st.equal(decoded['str2'].value, 'long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long')
})
8 years ago
}
8 years ago
mockStorageResolver = new MockStorageResolver({})
stateDecoder.solidityState(mockStorageResolver, output.sources, 'byteStorage').then((decoded) => {
st.equal(decoded['b1'].value, false)
st.equal(decoded['a1'].value, '0x0000000000000000000000000000000000000000')
st.equal(decoded['b2'].value, false)
st.equal(decoded['dynb1'].value, '0x')
st.equal(decoded['dynb1'].length, '0x0')
st.equal(decoded['stab'].value, '0x00')
st.equal(decoded['stab1'].value, '0x00')
st.equal(decoded['stab2'].value, '0x0000')
st.equal(decoded['stab3'].value, '0x000000')
st.equal(decoded['stab4'].value, '0x00000000')
st.equal(decoded['stab5'].value, '0x0000000000')
st.equal(decoded['stab6'].value, '0x000000000000')
st.equal(decoded['stab7'].value, '0x00000000000000')
st.equal(decoded['stab8'].value, '0x0000000000000000')
st.equal(decoded['stab9'].value, '0x000000000000000000')
st.equal(decoded['stab10'].value, '0x00000000000000000000')
st.equal(decoded['stab11'].value, '0x0000000000000000000000')
st.equal(decoded['stab12'].value, '0x000000000000000000000000')
st.equal(decoded['stab13'].value, '0x00000000000000000000000000')
st.equal(decoded['stab14'].value, '0x0000000000000000000000000000')
st.equal(decoded['stab15'].value, '0x000000000000000000000000000000')
st.equal(decoded['stab16'].value, '0x00000000000000000000000000000000')
st.equal(decoded['stab17'].value, '0x0000000000000000000000000000000000')
st.equal(decoded['stab18'].value, '0x000000000000000000000000000000000000')
st.equal(decoded['stab19'].value, '0x00000000000000000000000000000000000000')
st.equal(decoded['stab20'].value, '0x0000000000000000000000000000000000000000')
st.equal(decoded['stab21'].value, '0x000000000000000000000000000000000000000000')
st.equal(decoded['stab22'].value, '0x00000000000000000000000000000000000000000000')
st.equal(decoded['stab23'].value, '0x0000000000000000000000000000000000000000000000')
st.equal(decoded['stab24'].value, '0x000000000000000000000000000000000000000000000000')
st.equal(decoded['stab25'].value, '0x00000000000000000000000000000000000000000000000000')
st.equal(decoded['stab26'].value, '0x0000000000000000000000000000000000000000000000000000')
st.equal(decoded['stab27'].value, '0x000000000000000000000000000000000000000000000000000000')
st.equal(decoded['stab28'].value, '0x00000000000000000000000000000000000000000000000000000000')
st.equal(decoded['stab29'].value, '0x0000000000000000000000000000000000000000000000000000000000')
st.equal(decoded['stab30'].value, '0x000000000000000000000000000000000000000000000000000000000000')
st.equal(decoded['stab31'].value, '0x00000000000000000000000000000000000000000000000000000000000000')
st.equal(decoded['stab32'].value, '0x0000000000000000000000000000000000000000000000000000000000000000')
st.equal(decoded['enumDec'].value, 'e0')
st.equal(decoded['str1'].length, '0x0')
st.equal(decoded['str2'].length, '0x0')
st.equal(decoded['str1'].value, '')
st.equal(decoded['str12'].value, '')
8 years ago
st.equal(decoded['str2'].value, '')
cb()
})
}
function shrinkStorage (storage) {
# This is a combination of 50 commits. # This is the 1st commit message: executors # This is the commit message #2: libs # This is the commit message #3: remixd # This is the commit message #4: add react app # This is the commit message #5: debugging # This is the commit message #6: debug + sol # This is the commit message #7: fixes # This is the commit message #8: tsconfig # This is the commit message #9: ast walker # This is the commit message #10: as walker # This is the commit message #11: remixd etc # This is the commit message #12: commander # This is the commit message #13: remove jest # This is the commit message #14: rm ui files # This is the commit message #15: rm reserved keywords # This is the commit message #16: testrunner # This is the commit message #17: compiler # This is the commit message #18: production build # This is the commit message #19: config # This is the commit message #20: config # This is the commit message #21: web types # This is the commit message #22: update react # This is the commit message #23: add vm # This is the commit message #24: add workers # This is the commit message #25: worker2 # This is the commit message #26: rm react app # This is the commit message #27: remixd # This is the commit message #28: worker fix # This is the commit message #29: fix detection # This is the commit message #30: revert react # This is the commit message #31: rename type # This is the commit message #32: loading handler # This is the commit message #33: remove import # This is the commit message #34: rename # This is the commit message #35: local plugin # This is the commit message #36: etherscan # This is the commit message #37: revert react # This is the commit message #38: port # This is the commit message #39: rm worker # This is the commit message #40: publicpath # This is the commit message #41: fix test # This is the commit message #42: 112 # This is the commit message #43: show version # This is the commit message #44: "axios": "1.1.2", # This is the commit message #45: config # This is the commit message #46: lint # This is the commit message #47: fix build # This is the commit message #48: lint # This is the commit message #49: error on purpose # This is the commit message #50: test error
2 years ago
const shrinkedStorage = {}
const regex = /0x(00)*(..)/
for (const key in storage) {
const value = storage[key]
shrinkedStorage[key.replace(regex, '0x$2')] = value.replace(regex, '0x$2')
}
return shrinkedStorage
}
8 years ago
function testStructArrayStorage (st, cb) {
# This is a combination of 50 commits. # This is the 1st commit message: executors # This is the commit message #2: libs # This is the commit message #3: remixd # This is the commit message #4: add react app # This is the commit message #5: debugging # This is the commit message #6: debug + sol # This is the commit message #7: fixes # This is the commit message #8: tsconfig # This is the commit message #9: ast walker # This is the commit message #10: as walker # This is the commit message #11: remixd etc # This is the commit message #12: commander # This is the commit message #13: remove jest # This is the commit message #14: rm ui files # This is the commit message #15: rm reserved keywords # This is the commit message #16: testrunner # This is the commit message #17: compiler # This is the commit message #18: production build # This is the commit message #19: config # This is the commit message #20: config # This is the commit message #21: web types # This is the commit message #22: update react # This is the commit message #23: add vm # This is the commit message #24: add workers # This is the commit message #25: worker2 # This is the commit message #26: rm react app # This is the commit message #27: remixd # This is the commit message #28: worker fix # This is the commit message #29: fix detection # This is the commit message #30: revert react # This is the commit message #31: rename type # This is the commit message #32: loading handler # This is the commit message #33: remove import # This is the commit message #34: rename # This is the commit message #35: local plugin # This is the commit message #36: etherscan # This is the commit message #37: revert react # This is the commit message #38: port # This is the commit message #39: rm worker # This is the commit message #40: publicpath # This is the commit message #41: fix test # This is the commit message #42: 112 # This is the commit message #43: show version # This is the commit message #44: "axios": "1.1.2", # This is the commit message #45: config # This is the commit message #46: lint # This is the commit message #47: fix build # This is the commit message #48: lint # This is the commit message #49: error on purpose # This is the commit message #50: test error
2 years ago
const structArrayStorage = require('./contracts/structArrayStorage')
let output = compile(compilerInput(structArrayStorage.contract))
output = JSON.parse(output)
# This is a combination of 50 commits. # This is the 1st commit message: executors # This is the commit message #2: libs # This is the commit message #3: remixd # This is the commit message #4: add react app # This is the commit message #5: debugging # This is the commit message #6: debug + sol # This is the commit message #7: fixes # This is the commit message #8: tsconfig # This is the commit message #9: ast walker # This is the commit message #10: as walker # This is the commit message #11: remixd etc # This is the commit message #12: commander # This is the commit message #13: remove jest # This is the commit message #14: rm ui files # This is the commit message #15: rm reserved keywords # This is the commit message #16: testrunner # This is the commit message #17: compiler # This is the commit message #18: production build # This is the commit message #19: config # This is the commit message #20: config # This is the commit message #21: web types # This is the commit message #22: update react # This is the commit message #23: add vm # This is the commit message #24: add workers # This is the commit message #25: worker2 # This is the commit message #26: rm react app # This is the commit message #27: remixd # This is the commit message #28: worker fix # This is the commit message #29: fix detection # This is the commit message #30: revert react # This is the commit message #31: rename type # This is the commit message #32: loading handler # This is the commit message #33: remove import # This is the commit message #34: rename # This is the commit message #35: local plugin # This is the commit message #36: etherscan # This is the commit message #37: revert react # This is the commit message #38: port # This is the commit message #39: rm worker # This is the commit message #40: publicpath # This is the commit message #41: fix test # This is the commit message #42: 112 # This is the commit message #43: show version # This is the commit message #44: "axios": "1.1.2", # This is the commit message #45: config # This is the commit message #46: lint # This is the commit message #47: fix build # This is the commit message #48: lint # This is the commit message #49: error on purpose # This is the commit message #50: test error
2 years ago
const mockStorageResolver = new MockStorageResolver(structArrayStorage.storage)
8 years ago
stateDecoder.solidityState(mockStorageResolver, output.sources, 'structArrayStorage').then((decoded) => {
st.equal(decoded['intStructDec'].value['i8'].value, '32')
st.equal(decoded['intStructDec'].value['i16'].value, '-54')
st.equal(decoded['intStructDec'].value['ui32'].value, '128')
st.equal(decoded['intStructDec'].value['i256'].value, '-1243565465756')
st.equal(decoded['intStructDec'].value['ui16'].value, '34556')
st.equal(decoded['intStructDec'].value['i32'].value, '-345446546')
st.equal(decoded['i5'].length, '0x7')
st.equal(decoded['i5'].value[0].value, '-2134')
st.equal(decoded['i5'].value[1].value, '345')
st.equal(decoded['i5'].value[2].value, '-3246')
st.equal(decoded['i5'].value[3].value, '4357')
st.equal(decoded['i5'].value[4].value, '324')
st.equal(decoded['i5'].value[5].value, '-2344')
st.equal(decoded['i5'].value[6].value, '3254')
st.equal(decoded['idyn5'].length, '0x9')
st.equal(decoded['idyn5'].value[0].value, '-2134')
st.equal(decoded['idyn5'].value[1].value, '345')
st.equal(decoded['idyn5'].value[2].value, '-3246')
st.equal(decoded['idyn5'].value[3].value, '4357')
st.equal(decoded['idyn5'].value[4].value, '324')
st.equal(decoded['idyn5'].value[5].value, '-2344')
st.equal(decoded['idyn5'].value[6].value, '3254')
st.equal(decoded['idyn5'].value[7].value, '-254')
st.equal(decoded['idyn5'].value[8].value, '-2354')
st.equal(decoded['dyn1'].length, '0x4')
st.equal(decoded['dyn1'].value[0].length, '0x1')
st.equal(decoded['dyn1'].value[0].value[0].value, '3')
st.equal(decoded['dyn1'].value[1].length, '0x3')
st.equal(decoded['dyn1'].value[1].value[0].value, '12')
st.equal(decoded['dyn1'].value[1].value[1].value, '-12')
st.equal(decoded['dyn1'].value[1].value[2].value, '-1234')
st.equal(decoded['dyn1'].value[2].length, '0xa')
st.equal(decoded['dyn1'].value[2].value[0].value, '1')
st.equal(decoded['dyn1'].value[2].value[1].value, '12')
st.equal(decoded['dyn1'].value[2].value[2].value, '1235')
st.equal(decoded['dyn1'].value[2].value[3].value, '-12')
st.equal(decoded['dyn1'].value[2].value[4].value, '-123456')
st.equal(decoded['dyn1'].value[2].value[5].value, '-23435435')
st.equal(decoded['dyn1'].value[2].value[6].value, '543543')
st.equal(decoded['dyn1'].value[2].value[7].value, '2')
st.equal(decoded['dyn1'].value[2].value[8].value, '-1')
st.equal(decoded['dyn1'].value[2].value[9].value, '232432')
st.equal(decoded['dyn1'].value[3].length, '0x2')
st.equal(decoded['dyn1'].value[3].value[0].value, '232432')
st.equal(decoded['dyn1'].value[3].value[0].value, '232432')
st.equal(decoded['dyn2'].length, '0x2')
st.equal(decoded['dyn2'].value[0].length, '0x4')
st.equal(decoded['dyn2'].value[0].value[0].value[0].value, '23')
st.equal(decoded['dyn2'].value[0].value[0].value[1].value, '-23')
st.equal(decoded['dyn2'].value[0].value[0].value[2].value, '-28')
st.equal(decoded['dyn2'].value[0].value[1].value[0].value, '23')
st.equal(decoded['dyn2'].value[0].value[1].value[1].value, '-23')
st.equal(decoded['dyn2'].value[0].value[1].value[2].value, '-28')
st.equal(decoded['dyn2'].value[0].value[2].value[0].value, '23')
st.equal(decoded['dyn2'].value[0].value[2].value[1].value, '-23')
st.equal(decoded['dyn2'].value[0].value[2].value[2].value, '-28')
st.equal(decoded['dyn2'].value[0].value[3].value[0].value, '23')
st.equal(decoded['dyn2'].value[0].value[3].value[1].value, '-23')
st.equal(decoded['dyn2'].value[0].value[3].value[2].value, '-28')
st.equal(decoded['dyn2'].value[1].length, '0x4')
st.equal(decoded['dyn2'].value[1].value[0].value[0].value, '23')
st.equal(decoded['dyn2'].value[1].value[0].value[1].value, '-23')
st.equal(decoded['dyn2'].value[1].value[0].value[2].value, '-28')
st.equal(decoded['dyn2'].value[1].value[1].value[0].value, '23')
st.equal(decoded['dyn2'].value[1].value[1].value[1].value, '-23')
st.equal(decoded['dyn2'].value[1].value[1].value[2].value, '-28')
st.equal(decoded['dyn2'].value[1].value[2].value[0].value, '23')
st.equal(decoded['dyn2'].value[1].value[2].value[1].value, '-23')
st.equal(decoded['dyn2'].value[1].value[2].value[2].value, '-28')
st.equal(decoded['dyn2'].value[1].value[3].value[0].value, '23')
st.equal(decoded['dyn2'].value[1].value[3].value[1].value, '-23')
st.equal(decoded['dyn2'].value[1].value[3].value[2].value, '-28')
st.equal(decoded['arrayStruct'].value[0].value[0].value.i8.value, '34')
st.equal(decoded['arrayStruct'].value[0].value[0].value.str.value, 'test_str_short')
st.equal(decoded['arrayStruct'].value[0].value[1].value.i8.value, '-123')
st.equal(decoded['arrayStruct'].value[0].value[1].value.str.value, 'test_str_long test_str_lo ngtest_str_longtest_str_ longtest_str_longtest_ str_longtest_str_l ongtest_str_long')
st.equal(decoded['arrayStruct'].value[1].value[0].value.i8.value, '50')
st.equal(decoded['arrayStruct'].value[1].value[0].value.str.value, 'test_str_short')
st.equal(decoded['arrayStruct'].value[2].value[0].value.i8.value, '60')
st.equal(decoded['arrayStruct'].value[2].value[0].value.str.value, 'test_str_short')
st.equal(decoded['arrayStruct'].value[2].value[1].value.i8.value, '84')
st.equal(decoded['arrayStruct'].value[2].value[1].value.str.value, 'test_str_long test_str_lo ngtest_str_longtest_str_ longtest_str_longtest_ str_longtest_str_l ongtest_str_long')
st.equal(decoded['arrayStruct'].value[2].value[2].value.i8.value, '-34')
st.equal(decoded['arrayStruct'].value[2].value[2].value.str.value, 'test_str_short')
cb()
})
}