use of org.fisco.bcos.web3j.abi.datatypes.generated.StaticArray3 in project web3sdk by FISCO-BCOS.
the class FunctionEncoderTest method testMixTypeEncode5.
@Test
public void testMixTypeEncode5() {
// function
// set0(uint256,address,string,uint256[],uint256[3],string[],string[3],uint256[][],uint256[3][])
Function function = new Function("set0", Arrays.asList(new Uint256(123), new Address("0x692a70d2e424a56d2c6c27aa97d1a86395877b3a"), new Utf8String("string c"), new DynamicArray<>(new Uint256(1), new Uint256(2), new Uint256(3)), new StaticArray3<>(new Uint256(4), new Uint256(5), new Uint256(6)), new DynamicArray<>(new Utf8String("abc"), new Utf8String("def"), new Utf8String("ghi")), new StaticArray3<>(new Utf8String("abc"), new Utf8String("def"), new Utf8String("ghi")), new DynamicArray<>(new DynamicArray<>(new Uint256(1), new Uint256(1), new Uint256(1)), new DynamicArray<>(new Uint256(2), new Uint256(2), new Uint256(2)), new DynamicArray<>(new Uint256(3), new Uint256(3), new Uint256(3))), new DynamicArray<>(new StaticArray3<>(new Uint256(4), new Uint256(4), new Uint256(4)), new StaticArray3<>(new Uint256(5), new Uint256(5), new Uint256(5)))), Collections.singletonList(new TypeReference<DynamicArray<Utf8String>>() {
}));
assertThat(FunctionEncoder.encodeParameters(function.getInputParameters(), new StringBuilder()), is("000000000000000000000000000000000000000000000000000000000000007b00000000000000000000000069" + "2a70d2e424a56d2c6c27aa97d1a86395877b3a0000000000000000000000000000000000000000000000000000" + "00000000016000000000000000000000000000000000000000000000000000000000000001a000000000000000" + "000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000" + "000000000000000000000005000000000000000000000000000000000000000000000000000000000000000600" + "000000000000000000000000000000000000000000000000000000000002200000000000000000000000000000" + "000000000000000000000000000000000360000000000000000000000000000000000000000000000000000000" + "000000048000000000000000000000000000000000000000000000000000000000000006800000000000000000" + "000000000000000000000000000000000000000000000008737472696e67206300000000000000000000000000" + "000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000" + "000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000" + "000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000" + "000000030000000000000000000000000000000000000000000000000000000000000003000000000000000000" + "000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000" + "000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000" + "000000000000000000000000000000000000000000000000000000000361626300000000000000000000000000" + "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + "000003646566000000000000000000000000000000000000000000000000000000000000000000000000000000" + "000000000000000000000000000000000000000000036768690000000000000000000000000000000000000000" + "000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000" + "000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000" + "0000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000" + "000361626300000000000000000000000000000000000000000000000000000000000000000000000000000000" + "000000000000000000000000000000000000000003646566000000000000000000000000000000000000000000" + "000000000000000000000000000000000000000000000000000000000000000000000000000000036768690000" + "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + "000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000" + "6000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000" + "000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000" + "000000000000030000000000000000000000000000000000000000000000000000000000000001000000000000" + "000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000" + "000000000000000000000000010000000000000000000000000000000000000000000000000000000000000003" + "000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000" + "000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000" + "000000000002000000000000000000000000000000000000000000000000000000000000000300000000000000" + "000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000" + "000000000000000000000003000000000000000000000000000000000000000000000000000000000000000300" + "000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000" + "000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000" + "000000000400000000000000000000000000000000000000000000000000000000000000040000000000000000" + "000000000000000000000000000000000000000000000005000000000000000000000000000000000000000000" + "00000000000000000000050000000000000000000000000000000000000000000000000000000000000005"));
}
use of org.fisco.bcos.web3j.abi.datatypes.generated.StaticArray3 in project web3sdk by FISCO-BCOS.
the class FunctionEncoderTest method testBuildMessageSignature.
@Test
public void testBuildMessageSignature() {
assertThat(FunctionEncoder.buildMethodSignature("empty", Collections.emptyList()), is("empty()"));
assertThat(FunctionEncoder.buildMethodSignature("baz", Arrays.asList(new Uint32(BigInteger.valueOf(69)), new Bool(true))), is("baz(uint32,bool)"));
assertThat(FunctionEncoder.buildMethodSignature("test", Arrays.asList(new DynamicArray<DynamicArray<Uint256>>(new DynamicArray<Uint256>(new Uint256(1), new Uint256(2)), new DynamicArray<Uint256>(new Uint256(3))), new DynamicArray<Utf8String>(new Utf8String("one"), new Utf8String("two"), new Utf8String("three")))), is("test(uint256[][],string[])"));
assertThat(FunctionEncoder.buildMethodSignature("test", Arrays.asList(new Uint256(0x123), new DynamicArray<Uint32>(new Uint32(0x456), new Uint32(0x789)), new Bytes10("1234567890".getBytes()), new DynamicBytes("Hello, world!".getBytes()))), is("test(uint256,uint32[],bytes10,bytes)"));
assertThat(FunctionEncoder.buildMethodSignature("sam", Arrays.asList(new DynamicBytes("dave".getBytes()), new Bool(true), new DynamicArray<Uint256>(new Uint256(1), new Uint256(2), new Uint256(3)))), is("sam(bytes,bool,uint256[])"));
Arrays.asList(new DynamicArray<DynamicArray<DynamicArray<DynamicArray<Utf8String>>>>(new DynamicArray(new DynamicArray(new DynamicArray(new Utf8String("adfsafjljkl"), new Utf8String("dsafhjk;jlk;jadfl;kjkl"), new Utf8String("ada"))))));
assertThat(FunctionEncoder.buildMethodSignature("dave", Arrays.asList(new DynamicArray<DynamicArray<DynamicArray<DynamicArray<Utf8String>>>>(new DynamicArray(new DynamicArray(new DynamicArray(new Utf8String("adfsafjljkl"), new Utf8String("dsafhjk;jlk;jadfl;kjkl"), new Utf8String("ada"))))))), is("dave(string[][][][])"));
assertThat(FunctionEncoder.buildMethodSignature("test", Arrays.asList(new Uint256(100), new Int256(-100), new Utf8String("abc"), new DynamicArray<Type>(new Utf8String("abc"), new Utf8String("abc"), new Utf8String("abc")), new StaticArray3<Type>(new Utf8String("abc"), new Utf8String("abc"), new Utf8String("abc")))), is("test(uint256,int256,string,string[],string[3])"));
Arrays.asList(new StaticArray3<>(new DynamicArray<Type>(new Uint256(1)), new DynamicArray<Type>(new Uint256(2), new Uint256(3)), new DynamicArray<Type>(new Uint256(4), new Uint256(5), new Uint256(6))));
assertThat(FunctionEncoder.buildMethodSignature("test", Arrays.asList(new StaticArray3<>(new DynamicArray<Type>(new Uint256(1)), new DynamicArray<Type>(new Uint256(2), new Uint256(3)), new DynamicArray<Type>(new Uint256(4), new Uint256(5), new Uint256(6))))), is("test(uint256[][3])"));
assertThat(FunctionEncoder.buildMethodSignature("set", Arrays.asList(new Uint256(123), new Address("0x692a70d2e424a56d2c6c27aa97d1a86395877b3a"), new Utf8String("string c"), new DynamicArray<>(new Uint256(1), new Uint256(2), new Uint256(3)), new StaticArray3<>(new Uint256(4), new Uint256(5), new Uint256(6)), new DynamicArray<>(new Utf8String("abc"), new Utf8String("def"), new Utf8String("ghi")), new StaticArray3<>(new Utf8String("abc"), new Utf8String("def"), new Utf8String("ghi")), new DynamicArray<>(new DynamicArray<>(new Uint256(1), new Uint256(1), new Uint256(1)), new DynamicArray<>(new Uint256(2), new Uint256(2), new Uint256(2)), new DynamicArray<>(new Uint256(3), new Uint256(3), new Uint256(3))), new DynamicArray<>(new StaticArray3<>(new Uint256(4), new Uint256(4), new Uint256(4)), new StaticArray3<>(new Uint256(5), new Uint256(5), new Uint256(5))))), is("set(uint256,address,string,uint256[],uint256[3],string[],string[3],uint256[][],uint256[3][])"));
assertThat(FunctionEncoder.buildMethodSignature("set", Arrays.asList(new Utf8String("aaafadsfsfadsfdasf"), new Address("0x35ef07393b57464e93deb59175ff72e6499450cf"), new Uint256(11111), new Int256(-11111))), is("set(string,address,uint256,int256)"));
assertThat(FunctionEncoder.buildMethodSignature("set", Arrays.asList(new Utf8String("daslfjaklfdaskl"), new Uint256(1111), new StaticArray6<>(new Uint256(1), new Uint256(2), new Uint256(3), new Uint256(4), new Uint256(5), new Uint256(6)), new DynamicArray<>(new Uint256(1), new Uint256(2), new Uint256(3), new Uint256(4), new Uint256(5), new Uint256(6)), new Bool(false), new Address("0x692a70d2e424a56d2c6c27aa97d1a86395877b3a"))), is("set(string,uint256,uint256[6],uint256[],bool,address)"));
}
use of org.fisco.bcos.web3j.abi.datatypes.generated.StaticArray3 in project web3sdk by FISCO-BCOS.
the class UtilsTest method encodeGetLengthTest.
@Test
public void encodeGetLengthTest() {
// uint256
assertThat(Utils.getLength(Arrays.asList(new Uint256(1))), is(1));
// int256
assertThat(Utils.getLength(Arrays.asList(new Int256(1))), is(1));
// bool
assertThat(Utils.getLength(Arrays.asList(new Bool(true))), is(1));
// address
assertThat(Utils.getLength(Arrays.asList(new Address("0xb87213121fb89cbd8b877cb1bb3ff84dd2869cfa"))), is(1));
// bytes2
assertThat(Utils.getLength(Arrays.asList(new Bytes2("ab".getBytes()))), is(1));
// bytes32
assertThat(Utils.getLength(Arrays.asList(new Bytes32("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()))), is(1));
// bytes
assertThat(Utils.getLength(Arrays.asList(new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()))), is(1));
// string
assertThat(Utils.getLength(Arrays.asList(new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d"))), is(1));
// uint256[4]
assertThat(Utils.getLength(Arrays.asList(new StaticArray4<Uint256>(new Uint256(1), new Uint256(1), new Uint256(1), new Uint256(1)))), is(4));
// uint256[5]
assertThat(Utils.getLength(Arrays.asList(new StaticArray5<Uint256>(new Uint256(1), new Uint256(1), new Uint256(1), new Uint256(1), new Uint256(1)))), is(5));
// uint256[]
assertThat(Utils.getLength(Arrays.asList(new DynamicArray<Uint256>(new Uint256(1), new Uint256(1), new Uint256(1), new Uint256(1), new Uint256(1)))), is(1));
// uint256[][2]
assertThat(Utils.getLength(Arrays.asList(new StaticArray2<DynamicArray>(new DynamicArray<Uint256>(new Uint256(1), new Uint256(1), new Uint256(1), new Uint256(1), new Uint256(1)), new DynamicArray<Uint256>(new Uint256(1), new Uint256(1), new Uint256(1), new Uint256(1), new Uint256(1))))), is(1));
// uint256[2][]
assertThat(Utils.getLength(Arrays.asList(new DynamicArray<StaticArray2>(new StaticArray2<Uint256>(new Uint256(1), new Uint256(1)), new StaticArray2<Uint256>(new Uint256(1), new Uint256(1))))), is(1));
// uint256[][]
assertThat(Utils.getLength(Arrays.asList(new DynamicArray<DynamicArray>(new DynamicArray<Uint256>(new Uint256(1), new Uint256(1)), new DynamicArray<Uint256>(new Uint256(1), new Uint256(1))))), is(1));
// uint256[2][2]
assertThat(Utils.getLength(Arrays.asList(new StaticArray2<StaticArray2>(new StaticArray2<Uint256>(new Uint256(1), new Uint256(1)), new StaticArray2<Uint256>(new Uint256(1), new Uint256(1))))), is(4));
// int256[4]
assertThat(Utils.getLength(Arrays.asList(new StaticArray4<Int256>(new Int256(1), new Int256(1), new Int256(1), new Int256(1)))), is(4));
// int256[5]
assertThat(Utils.getLength(Arrays.asList(new StaticArray5<Int256>(new Int256(1), new Int256(1), new Int256(1), new Int256(1), new Int256(1)))), is(5));
// int256[]
assertThat(Utils.getLength(Arrays.asList(new DynamicArray<Int256>(new Int256(1), new Int256(1), new Int256(1), new Int256(1), new Int256(1)))), is(1));
// int256[][2]
assertThat(Utils.getLength(Arrays.asList(new StaticArray2<DynamicArray>(new DynamicArray<Int256>(new Int256(1), new Int256(1), new Int256(1), new Int256(1), new Int256(1)), new DynamicArray<Int256>(new Int256(1), new Int256(1), new Int256(1), new Int256(1), new Int256(1))))), is(1));
// int256[][]
assertThat(Utils.getLength(Arrays.asList(new DynamicArray<DynamicArray>(new DynamicArray<Int256>(new Int256(1), new Int256(1), new Int256(1), new Int256(1), new Int256(1)), new DynamicArray<Int256>(new Int256(1), new Int256(1), new Int256(1), new Int256(1), new Int256(1))))), is(1));
// int256[2][]
assertThat(Utils.getLength(Arrays.asList(new DynamicArray<StaticArray2>(new StaticArray2<Int256>(new Int256(1), new Int256(1)), new StaticArray2<Int256>(new Int256(1), new Int256(1))))), is(1));
// int256[2][2]
assertThat(Utils.getLength(Arrays.asList(new StaticArray2<StaticArray2>(new StaticArray2<Int256>(new Int256(1), new Int256(1)), new StaticArray2<Int256>(new Int256(1), new Int256(1))))), is(4));
// bool[4]
assertThat(Utils.getLength(Arrays.asList(new StaticArray4<Bool>(new Bool(true), new Bool(true), new Bool(true), new Bool(true)))), is(4));
// bool[10]
assertThat(Utils.getLength(Arrays.asList(new StaticArray10<Bool>(new Bool(true), new Bool(true), new Bool(true), new Bool(true), new Bool(true), new Bool(true), new Bool(true), new Bool(true), new Bool(true), new Bool(true)))), is(10));
// bool[]
assertThat(Utils.getLength(Arrays.asList(new DynamicArray<Bool>(new Bool(true), new Bool(true), new Bool(true), new Bool(true), new Bool(true), new Bool(true), new Bool(true), new Bool(true), new Bool(true), new Bool(true)))), is(1));
// bool[][2]
assertThat(Utils.getLength(Arrays.asList(new StaticArray2<DynamicArray>(new DynamicArray<Bool>(new Bool(true), new Bool(true), new Bool(true), new Bool(true), new Bool(true)), new DynamicArray<Bool>(new Bool(true), new Bool(true), new Bool(true), new Bool(true), new Bool(true))))), is(1));
// bool[2][]
assertThat(Utils.getLength(Arrays.asList(new DynamicArray<StaticArray2>(new StaticArray2<Bool>(new Bool(true), new Bool(true)), new StaticArray2<Bool>(new Bool(true), new Bool(true))))), is(1));
// bool[][]
assertThat(Utils.getLength(Arrays.asList(new DynamicArray<DynamicArray>(new DynamicArray<Bool>(new Bool(true), new Bool(true)), new DynamicArray<Bool>(new Bool(true), new Bool(true))))), is(1));
// bool[2][2]
assertThat(Utils.getLength(Arrays.asList(new StaticArray2<StaticArray2>(new StaticArray2<Bool>(new Bool(true), new Bool(true)), new StaticArray2<Bool>(new Bool(true), new Bool(true))))), is(4));
// bool[2][2][2]
assertThat(Utils.getLength(Arrays.asList(new StaticArray2<StaticArray2<StaticArray2>>(new StaticArray2<StaticArray2>(new StaticArray2<Bool>(new Bool(true), new Bool(true)), new StaticArray2<Bool>(new Bool(true), new Bool(true))), new StaticArray2<StaticArray2>(new StaticArray2<Bool>(new Bool(true), new Bool(true)), new StaticArray2<Bool>(new Bool(true), new Bool(true)))))), is(8));
// address[4]
assertThat(Utils.getLength(Arrays.asList(new StaticArray4<Address>(new Address("0xb87213121fb89cbd8b877cb1bb3ff84dd2869cfa"), new Address("0xb87213121fb89cbd8b877cb1bb3ff84dd2869cfa"), new Address("0xb87213121fb89cbd8b877cb1bb3ff84dd2869cfa"), new Address("0xb87213121fb89cbd8b877cb1bb3ff84dd2869cfa")))), is(4));
// address[5]
assertThat(Utils.getLength(Arrays.asList(new StaticArray5<Address>(new Address("0xb87213121fb89cbd8b877cb1bb3ff84dd2869cfa"), new Address("0xb87213121fb89cbd8b877cb1bb3ff84dd2869cfa"), new Address("0xb87213121fb89cbd8b877cb1bb3ff84dd2869cfa"), new Address("0xb87213121fb89cbd8b877cb1bb3ff84dd2869cfa"), new Address("0xb87213121fb89cbd8b877cb1bb3ff84dd2869cfa")))), is(5));
// address[]
assertThat(Utils.getLength(Arrays.asList(new DynamicArray<Address>(new Address("0xb87213121fb89cbd8b877cb1bb3ff84dd2869cfa"), new Address("0xb87213121fb89cbd8b877cb1bb3ff84dd2869cfa"), new Address("0xb87213121fb89cbd8b877cb1bb3ff84dd2869cfa"), new Address("0xb87213121fb89cbd8b877cb1bb3ff84dd2869cfa"), new Address("0xb87213121fb89cbd8b877cb1bb3ff84dd2869cfa")))), is(1));
// address[][2]
assertThat(Utils.getLength(Arrays.asList(new StaticArray2<DynamicArray>(new DynamicArray<Address>(new Address("0xb87213121fb89cbd8b877cb1bb3ff84dd2869cfa"), new Address("0xb87213121fb89cbd8b877cb1bb3ff84dd2869cfa"), new Address("0xb87213121fb89cbd8b877cb1bb3ff84dd2869cfa"), new Address("0xb87213121fb89cbd8b877cb1bb3ff84dd2869cfa"), new Address("0xb87213121fb89cbd8b877cb1bb3ff84dd2869cfa")), new DynamicArray<Address>(new Address("0xb87213121fb89cbd8b877cb1bb3ff84dd2869cfa"), new Address("0xb87213121fb89cbd8b877cb1bb3ff84dd2869cfa"), new Address("0xb87213121fb89cbd8b877cb1bb3ff84dd2869cfa"), new Address("0xb87213121fb89cbd8b877cb1bb3ff84dd2869cfa"), new Address("0xb87213121fb89cbd8b877cb1bb3ff84dd2869cfa"))))), is(1));
// address[2][]
assertThat(Utils.getLength(Arrays.asList(new DynamicArray<StaticArray2>(new StaticArray2<Address>(new Address("0xb87213121fb89cbd8b877cb1bb3ff84dd2869cfa"), new Address("0xb87213121fb89cbd8b877cb1bb3ff84dd2869cfa")), new StaticArray2<Address>(new Address("0xb87213121fb89cbd8b877cb1bb3ff84dd2869cfa"), new Address("0xb87213121fb89cbd8b877cb1bb3ff84dd2869cfa"))))), is(1));
// address[][]
assertThat(Utils.getLength(Arrays.asList(new DynamicArray<DynamicArray>(new DynamicArray<Address>(new Address("0xb87213121fb89cbd8b877cb1bb3ff84dd2869cfa"), new Address("0xb87213121fb89cbd8b877cb1bb3ff84dd2869cfa")), new DynamicArray<Address>(new Address("0xb87213121fb89cbd8b877cb1bb3ff84dd2869cfa"), new Address("0xb87213121fb89cbd8b877cb1bb3ff84dd2869cfa"))))), is(1));
// address[3][3]
assertThat(Utils.getLength(Arrays.asList(new StaticArray3<StaticArray3>(new StaticArray3<Address>(new Address("0xb87213121fb89cbd8b877cb1bb3ff84dd2869cfa"), new Address("0xb87213121fb89cbd8b877cb1bb3ff84dd2869cfa"), new Address("0xb87213121fb89cbd8b877cb1bb3ff84dd2869cfa")), new StaticArray3<Address>(new Address("0xb87213121fb89cbd8b877cb1bb3ff84dd2869cfa"), new Address("0xb87213121fb89cbd8b877cb1bb3ff84dd2869cfa"), new Address("0xb87213121fb89cbd8b877cb1bb3ff84dd2869cfa")), new StaticArray3<Address>(new Address("0xb87213121fb89cbd8b877cb1bb3ff84dd2869cfa"), new Address("0xb87213121fb89cbd8b877cb1bb3ff84dd2869cfa"), new Address("0xb87213121fb89cbd8b877cb1bb3ff84dd2869cfa"))))), is(9));
// bytes32[6]
assertThat(Utils.getLength(Arrays.asList(new StaticArray6<Bytes32>(new Bytes32("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new Bytes32("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new Bytes32("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new Bytes32("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new Bytes32("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new Bytes32("b87213121fb89cbd8b877cb1bb3ff84d".getBytes())))), is(6));
// bytes32[]
assertThat(Utils.getLength(Arrays.asList(new DynamicArray<Bytes32>(new Bytes32("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new Bytes32("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new Bytes32("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new Bytes32("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new Bytes32("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new Bytes32("b87213121fb89cbd8b877cb1bb3ff84d".getBytes())))), is(1));
// bytes32[][2]
assertThat(Utils.getLength(Arrays.asList(new StaticArray2<DynamicArray>(new DynamicArray<Bytes32>(new Bytes32("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new Bytes32("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new Bytes32("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new Bytes32("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new Bytes32("b87213121fb89cbd8b877cb1bb3ff84d".getBytes())), new DynamicArray<Bytes32>(new Bytes32("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new Bytes32("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new Bytes32("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new Bytes32("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new Bytes32("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()))))), is(1));
// bytes32[2][]
assertThat(Utils.getLength(Arrays.asList(new DynamicArray<StaticArray2>(new StaticArray2<Bytes32>(new Bytes32("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new Bytes32("b87213121fb89cbd8b877cb1bb3ff84d".getBytes())), new StaticArray2<Bytes32>(new Bytes32("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new Bytes32("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()))))), is(1));
// bytes32[][]
assertThat(Utils.getLength(Arrays.asList(new DynamicArray<DynamicArray>(new DynamicArray<Bytes32>(new Bytes32("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new Bytes32("b87213121fb89cbd8b877cb1bb3ff84d".getBytes())), new DynamicArray<Bytes32>(new Bytes32("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new Bytes32("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()))))), is(1));
// bytes32[3][3]
assertThat(Utils.getLength(Arrays.asList(new StaticArray3<StaticArray3>(new StaticArray3<Bytes32>(new Bytes32("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new Bytes32("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new Bytes32("b87213121fb89cbd8b877cb1bb3ff84d".getBytes())), new StaticArray3<Bytes32>(new Bytes32("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new Bytes32("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new Bytes32("b87213121fb89cbd8b877cb1bb3ff84d".getBytes())), new StaticArray3<Bytes32>(new Bytes32("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new Bytes32("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new Bytes32("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()))))), is(9));
// string[2]
assertThat(Utils.getLength(Arrays.asList(new StaticArray2<Utf8String>(new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d"), new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d")))), is(1));
// string[4]
assertThat(Utils.getLength(Arrays.asList(new StaticArray4<Utf8String>(new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d"), new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d"), new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d"), new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d")))), is(1));
// string[]
assertThat(Utils.getLength(Arrays.asList(new DynamicArray<Utf8String>(new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d"), new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d"), new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d"), new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d")))), is(1));
// string[][2]
assertThat(Utils.getLength(Arrays.asList(new StaticArray2<DynamicArray>(new DynamicArray<Utf8String>(new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d"), new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d"), new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d"), new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d"), new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d")), new DynamicArray<Utf8String>(new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d"), new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d"), new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d"), new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d"), new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d"))))), is(1));
// string[2][]
assertThat(Utils.getLength(Arrays.asList(new DynamicArray<StaticArray2>(new StaticArray2<Utf8String>(new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d"), new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d")), new StaticArray2<Utf8String>(new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d"), new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d"))))), is(1));
// string[][]
assertThat(Utils.getLength(Arrays.asList(new DynamicArray<DynamicArray>(new DynamicArray<Utf8String>(new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d"), new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d")), new DynamicArray<Utf8String>(new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d"), new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d"))))), is(1));
// string[3][3]
assertThat(Utils.getLength(Arrays.asList(new StaticArray3<StaticArray3>(new StaticArray3<Utf8String>(new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d"), new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d"), new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d")), new StaticArray3<Utf8String>(new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d"), new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d"), new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d")), new StaticArray3<Utf8String>(new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d"), new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d"), new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d"))))), is(1));
// bytes[2]
assertThat(Utils.getLength(Arrays.asList(new StaticArray2<DynamicBytes>(new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes())))), is(1));
// bytes[3]
assertThat(Utils.getLength(Arrays.asList(new StaticArray3<DynamicBytes>(new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes())))), is(1));
// bytes[]
assertThat(Utils.getLength(Arrays.asList(new DynamicArray<DynamicBytes>(new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes())))), is(1));
// bytes[][2]
assertThat(Utils.getLength(Arrays.asList(new StaticArray2<DynamicArray>(new DynamicArray<DynamicBytes>(new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes())), new DynamicArray<DynamicBytes>(new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()))))), is(1));
// bytes[2][]
assertThat(Utils.getLength(Arrays.asList(new DynamicArray<StaticArray2>(new StaticArray2<DynamicBytes>(new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes())), new StaticArray2<DynamicBytes>(new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()))))), is(1));
// bytes[][]
assertThat(Utils.getLength(Arrays.asList(new DynamicArray<DynamicArray>(new DynamicArray<DynamicBytes>(new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes())), new DynamicArray<DynamicBytes>(new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()))))), is(1));
// bytes[3][3]
assertThat(Utils.getLength(Arrays.asList(new StaticArray3<StaticArray3>(new StaticArray3<DynamicBytes>(new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes())), new StaticArray3<DynamicBytes>(new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes())), new StaticArray3<DynamicBytes>(new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()))))), is(1));
// int256
assertThat(Utils.getLength(Arrays.asList(new Int256(1))), is(1));
// uint256
assertThat(Utils.getLength(Arrays.asList(new Uint256(1))), is(1));
// int
assertThat(Utils.getLength(Arrays.asList(new Int(new BigInteger("1")))), is(1));
// uint
assertThat(Utils.getLength(Arrays.asList(new Uint(new BigInteger("1")))), is(1));
// address
assertThat(Utils.getLength(Arrays.asList(new Address("0xb87213121fb89cbd8b877cb1bb3ff84dd2869cfa"))), is(1));
// int,uint,bool,address,bytes32,bytes,string
assertThat(Utils.getLength(Arrays.asList(new Int256(1), new Uint256(1), new Bool(true), new Address("0xb87213121fb89cbd8b877cb1bb3ff84dd2869cfa"), new Bytes32("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new DynamicBytes("aa".getBytes()), new Utf8String("bb"))), is(7));
// int[3],uint[3],bool[3],address[3],bytes32[3],bytes[3],string[3]
assertThat(Utils.getLength(Arrays.asList(new StaticArray3<Int256>(new Int256(1), new Int256(1), new Int256(1)), new StaticArray3<Uint256>(new Uint256(1), new Uint256(1), new Uint256(1)), new StaticArray3<Bool>(new Bool(true), new Bool(false), new Bool(true)), new StaticArray3<Address>(new Address("0xb87213121fb89cbd8b877cb1bb3ff84dd2869cfa"), new Address("0xb87213121fb89cbd8b877cb1bb3ff84dd2869cfa"), new Address("0xb87213121fb89cbd8b877cb1bb3ff84dd2869cfa")), new StaticArray3<Bytes32>(new Bytes32("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new Bytes32("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new Bytes32("b87213121fb89cbd8b877cb1bb3ff84d".getBytes())), new StaticArray3<DynamicBytes>(new DynamicBytes("aa".getBytes()), new DynamicBytes("aa".getBytes()), new DynamicBytes("aa".getBytes())), new StaticArray3<Utf8String>(new Utf8String("bb"), new Utf8String("bb"), new Utf8String("bb")))), is(17));
// int[],uint[],bool[],address[],bytes32[],bytes[],string[]
assertThat(Utils.getLength(Arrays.asList(new DynamicArray<Int256>(new Int256(1), new Int256(1), new Int256(1)), new DynamicArray<Uint256>(new Uint256(1), new Uint256(1), new Uint256(1)), new DynamicArray<Bool>(new Bool(true), new Bool(false), new Bool(true)), new DynamicArray<Address>(new Address("0xb87213121fb89cbd8b877cb1bb3ff84dd2869cfa"), new Address("0xb87213121fb89cbd8b877cb1bb3ff84dd2869cfa"), new Address("0xb87213121fb89cbd8b877cb1bb3ff84dd2869cfa")), new DynamicArray<Bytes32>(new Bytes32("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new Bytes32("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new Bytes32("b87213121fb89cbd8b877cb1bb3ff84d".getBytes())), new DynamicArray<DynamicBytes>(new DynamicBytes("aa".getBytes()), new DynamicBytes("aa".getBytes()), new DynamicBytes("aa".getBytes())), new DynamicArray<Utf8String>(new Utf8String("bb"), new Utf8String("bb"), new Utf8String("bb")))), is(7));
// int,uint,bool,address,bytes32,bytes,string,int[3],uint[3],bool[3],address[3],bytes32[3],bytes[3],string[3]
assertThat(Utils.getLength(Arrays.asList(new Int256(1), new Uint256(1), new Bool(true), new Address("0xb87213121fb89cbd8b877cb1bb3ff84dd2869cfa"), new Bytes32("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new DynamicBytes("aa".getBytes()), new Utf8String("bb"), new StaticArray3<Int256>(new Int256(1), new Int256(1), new Int256(1)), new StaticArray3<Uint256>(new Uint256(1), new Uint256(1), new Uint256(1)), new StaticArray3<Bool>(new Bool(true), new Bool(false), new Bool(true)), new StaticArray3<Address>(new Address("0xb87213121fb89cbd8b877cb1bb3ff84dd2869cfa"), new Address("0xb87213121fb89cbd8b877cb1bb3ff84dd2869cfa"), new Address("0xb87213121fb89cbd8b877cb1bb3ff84dd2869cfa")), new StaticArray3<Bytes32>(new Bytes32("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new Bytes32("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new Bytes32("b87213121fb89cbd8b877cb1bb3ff84d".getBytes())), new StaticArray3<DynamicBytes>(new DynamicBytes("aa".getBytes()), new DynamicBytes("aa".getBytes()), new DynamicBytes("aa".getBytes())), new StaticArray3<Utf8String>(new Utf8String("bb"), new Utf8String("bb"), new Utf8String("bb")))), is(24));
// int,uint,bool,address,bytes32,bytes,string,int[],uint[],bool[],address[],bytes32[],bytes[],string[]
assertThat(Utils.getLength(Arrays.asList(new Int256(1), new Uint256(1), new Bool(true), new Address("0xb87213121fb89cbd8b877cb1bb3ff84dd2869cfa"), new Bytes32("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new DynamicBytes("aa".getBytes()), new Utf8String("bb"), new DynamicArray<Int256>(new Int256(1), new Int256(1), new Int256(1)), new DynamicArray<Uint256>(new Uint256(1), new Uint256(1), new Uint256(1)), new DynamicArray<Bool>(new Bool(true), new Bool(false), new Bool(true)), new DynamicArray<Address>(new Address("0xb87213121fb89cbd8b877cb1bb3ff84dd2869cfa"), new Address("0xb87213121fb89cbd8b877cb1bb3ff84dd2869cfa"), new Address("0xb87213121fb89cbd8b877cb1bb3ff84dd2869cfa")), new DynamicArray<Bytes32>(new Bytes32("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new Bytes32("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new Bytes32("b87213121fb89cbd8b877cb1bb3ff84d".getBytes())), new DynamicArray<DynamicBytes>(new DynamicBytes("aa".getBytes()), new DynamicBytes("aa".getBytes()), new DynamicBytes("aa".getBytes())), new DynamicArray<Utf8String>(new Utf8String("bb"), new Utf8String("bb"), new Utf8String("bb")))), is(14));
// uint256[][2],uint256[2][],uint256[][],uint256[2][2]
assertThat(Utils.getLength(Arrays.asList(new StaticArray2<DynamicArray>(new DynamicArray<Uint256>(new Uint256(1), new Uint256(1), new Uint256(1), new Uint256(1), new Uint256(1)), new DynamicArray<Uint256>(new Uint256(1), new Uint256(1), new Uint256(1), new Uint256(1), new Uint256(1))), new DynamicArray<StaticArray2>(new StaticArray2<Uint256>(new Uint256(1), new Uint256(1)), new StaticArray2<Uint256>(new Uint256(1), new Uint256(1))), new DynamicArray<DynamicArray>(new DynamicArray<Uint256>(new Uint256(1), new Uint256(1)), new DynamicArray<Uint256>(new Uint256(1), new Uint256(1))), new StaticArray2<StaticArray2>(new StaticArray2<Uint256>(new Uint256(1), new Uint256(1)), new StaticArray2<Uint256>(new Uint256(1), new Uint256(1))))), is(7));
// int256[][2],int256[2][],int256[][],int256[2][2]
assertThat(Utils.getLength(Arrays.asList(new StaticArray2<DynamicArray>(new DynamicArray<Int256>(new Int256(1), new Int256(1), new Int256(1), new Int256(1), new Int256(1)), new DynamicArray<Int256>(new Int256(1), new Int256(1), new Int256(1), new Int256(1), new Int256(1))), new DynamicArray<StaticArray2>(new StaticArray2<Int256>(new Int256(1), new Int256(1)), new StaticArray2<Int256>(new Int256(1), new Int256(1))), new DynamicArray<DynamicArray>(new DynamicArray<Int256>(new Int256(1), new Int256(1)), new DynamicArray<Int256>(new Int256(1), new Int256(1))), new StaticArray2<StaticArray2>(new StaticArray2<Int256>(new Int256(1), new Int256(1)), new StaticArray2<Int256>(new Int256(1), new Int256(1))))), is(7));
// string[][2],string[2][],string[][],string[3][3]
assertThat(Utils.getLength(Arrays.asList(new StaticArray2<DynamicArray>(new DynamicArray<Utf8String>(new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d"), new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d"), new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d"), new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d"), new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d")), new DynamicArray<Utf8String>(new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d"), new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d"), new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d"), new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d"), new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d"))), new DynamicArray<StaticArray2>(new StaticArray2<Utf8String>(new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d"), new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d")), new StaticArray2<Utf8String>(new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d"), new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d"))), new DynamicArray<DynamicArray>(new DynamicArray<Utf8String>(new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d"), new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d")), new DynamicArray<Utf8String>(new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d"), new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d"))), new StaticArray3<StaticArray3>(new StaticArray3<Utf8String>(new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d"), new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d"), new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d")), new StaticArray3<Utf8String>(new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d"), new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d"), new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d")), new StaticArray3<Utf8String>(new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d"), new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d"), new Utf8String("b87213121fb89cbd8b877cb1bb3ff84d"))))), is(4));
// bytes[][2],bytes[2][],bytes[][],bytes[2][2]
assertThat(Utils.getLength(Arrays.asList(new StaticArray2<DynamicArray>(new DynamicArray<DynamicBytes>(new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes())), new DynamicArray<DynamicBytes>(new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()))), new DynamicArray<StaticArray2>(new StaticArray2<DynamicBytes>(new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes())), new StaticArray2<DynamicBytes>(new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()))), new DynamicArray<DynamicArray>(new DynamicArray<DynamicBytes>(new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes())), new DynamicArray<DynamicBytes>(new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()))), new StaticArray3<StaticArray3>(new StaticArray3<DynamicBytes>(new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes())), new StaticArray3<DynamicBytes>(new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes())), new StaticArray3<DynamicBytes>(new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()), new DynamicBytes("b87213121fb89cbd8b877cb1bb3ff84d".getBytes()))))), is(4));
}
use of org.fisco.bcos.web3j.abi.datatypes.generated.StaticArray3 in project web3sdk by FISCO-BCOS.
the class EventEncoderTest method testEventbuildMethodSignature7.
@Test
public void testEventbuildMethodSignature7() {
Event event = new Event("test7", Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {
}, new TypeReference<Address>() {
}, new TypeReference<Utf8String>() {
}, new TypeReference<DynamicArray<Uint256>>() {
}, new TypeReference<StaticArray3<Uint256>>() {
}, new TypeReference<DynamicArray<Utf8String>>() {
}, new TypeReference<StaticArray3<Utf8String>>() {
}, new TypeReference<DynamicArray<DynamicArray<Uint256>>>() {
}, new TypeReference<DynamicArray<StaticArray3<Uint256>>>() {
}));
assertThat(EventEncoder.buildMethodSignature(event.getName(), event.getParameters()), is("test7(uint256,address,string,uint256[],uint256[3],string[],string[3],uint256[][],uint256[3][])"));
assertThat(EventEncoder.encode(event), is("0x63c45f0c8793f28acf7f800281aaf63198c09afdef34c785429628237221a648"));
assertThat(EventEncoder.buildEventSignature("test7(uint256,address,string,uint256[],uint256[3],string[],string[3],uint256[][],uint256[3][])"), is("0x63c45f0c8793f28acf7f800281aaf63198c09afdef34c785429628237221a648"));
}
use of org.fisco.bcos.web3j.abi.datatypes.generated.StaticArray3 in project web3sdk by FISCO-BCOS.
the class FunctionReturnDecoderTest method testMixTypeDecode5.
@Test
public void testMixTypeDecode5() {
// function function() constant
// returns(uint256,address,string,uint256[],uint256[3],string[],string[3],uint256[][],uint256[3][])
Function function = new Function("function", Collections.<Type>emptyList(), Arrays.asList(new TypeReference<Uint256>() {
}, new TypeReference<Address>() {
}, new TypeReference<Utf8String>() {
}, new TypeReference<DynamicArray<Uint256>>() {
}, new TypeReference<StaticArray3<Uint256>>() {
}, new TypeReference<DynamicArray<Utf8String>>() {
}, new TypeReference<StaticArray3<Utf8String>>() {
}, new TypeReference<DynamicArray<DynamicArray<Uint256>>>() {
}, new TypeReference<DynamicArray<StaticArray3<Uint256>>>() {
}));
assertThat(FunctionReturnDecoder.decode("000000000000000000000000000000000000000000000000000000000000007b00000000000000000000000069" + "2a70d2e424a56d2c6c27aa97d1a86395877b3a0000000000000000000000000000000000000000000000000000" + "00000000016000000000000000000000000000000000000000000000000000000000000001a000000000000000" + "000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000" + "000000000000000000000005000000000000000000000000000000000000000000000000000000000000000600" + "000000000000000000000000000000000000000000000000000000000002200000000000000000000000000000" + "000000000000000000000000000000000360000000000000000000000000000000000000000000000000000000" + "000000048000000000000000000000000000000000000000000000000000000000000006800000000000000000" + "000000000000000000000000000000000000000000000008737472696e67206300000000000000000000000000" + "000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000" + "000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000" + "000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000" + "000000030000000000000000000000000000000000000000000000000000000000000003000000000000000000" + "000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000" + "000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000" + "000000000000000000000000000000000000000000000000000000000361626300000000000000000000000000" + "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + "000003646566000000000000000000000000000000000000000000000000000000000000000000000000000000" + "000000000000000000000000000000000000000000036768690000000000000000000000000000000000000000" + "000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000" + "000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000" + "0000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000" + "000361626300000000000000000000000000000000000000000000000000000000000000000000000000000000" + "000000000000000000000000000000000000000003646566000000000000000000000000000000000000000000" + "000000000000000000000000000000000000000000000000000000000000000000000000000000036768690000" + "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + "000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000" + "6000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000" + "000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000" + "000000000000030000000000000000000000000000000000000000000000000000000000000001000000000000" + "000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000" + "000000000000000000000000010000000000000000000000000000000000000000000000000000000000000003" + "000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000" + "000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000" + "000000000002000000000000000000000000000000000000000000000000000000000000000300000000000000" + "000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000" + "000000000000000000000003000000000000000000000000000000000000000000000000000000000000000300" + "000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000" + "000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000" + "000000000400000000000000000000000000000000000000000000000000000000000000040000000000000000" + "000000000000000000000000000000000000000000000005000000000000000000000000000000000000000000" + "00000000000000000000050000000000000000000000000000000000000000000000000000000000000005", function.getOutputParameters()), equalTo(Arrays.asList(new Uint256(123), new Address("0x692a70d2e424a56d2c6c27aa97d1a86395877b3a"), new Utf8String("string c"), new DynamicArray<>(new Uint256(1), new Uint256(2), new Uint256(3)), new StaticArray3<>(new Uint256(4), new Uint256(5), new Uint256(6)), new DynamicArray<>(new Utf8String("abc"), new Utf8String("def"), new Utf8String("ghi")), new StaticArray3<>(new Utf8String("abc"), new Utf8String("def"), new Utf8String("ghi")), new DynamicArray<>(new DynamicArray<>(new Uint256(1), new Uint256(1), new Uint256(1)), new DynamicArray<>(new Uint256(2), new Uint256(2), new Uint256(2)), new DynamicArray<>(new Uint256(3), new Uint256(3), new Uint256(3))), new DynamicArray<>(new StaticArray3<>(new Uint256(4), new Uint256(4), new Uint256(4)), new StaticArray3<>(new Uint256(5), new Uint256(5), new Uint256(5))))));
}
Aggregations