Search in sources :

Example 41 with Uint256

use of org.fisco.bcos.web3j.abi.datatypes.generated.Uint256 in project web3sdk by FISCO-BCOS.

the class UtilsTest method testTypeMapNested.

@Test
public void testTypeMapNested() {
    List<BigInteger> innerList1 = Arrays.asList(BigInteger.valueOf(1), BigInteger.valueOf(2));
    List<BigInteger> innerList2 = Arrays.asList(BigInteger.valueOf(3), BigInteger.valueOf(4));
    final List<List<BigInteger>> input = Arrays.asList(innerList1, innerList2);
    StaticArray2<Uint256> staticArray1 = new StaticArray2<>(new Uint256(1), new Uint256(2));
    StaticArray2<Uint256> staticArray2 = new StaticArray2<>(new Uint256(3), new Uint256(4));
    List<StaticArray2<Uint256>> expectedList = Arrays.asList(staticArray1, staticArray2);
    assertThat(Utils.typeMap(input, StaticArray2.class, Uint256.class), equalTo(expectedList));
}
Also used : BigInteger(java.math.BigInteger) ArrayList(java.util.ArrayList) List(java.util.List) Uint256(org.fisco.bcos.web3j.abi.datatypes.generated.Uint256) StaticArray2(org.fisco.bcos.web3j.abi.datatypes.generated.StaticArray2) Test(org.junit.Test)

Aggregations

Uint256 (org.fisco.bcos.web3j.abi.datatypes.generated.Uint256)41 Test (org.junit.Test)38 Int256 (org.fisco.bcos.web3j.abi.datatypes.generated.Int256)21 Utf8String (org.fisco.bcos.web3j.abi.datatypes.Utf8String)17 Bool (org.fisco.bcos.web3j.abi.datatypes.Bool)16 DynamicBytes (org.fisco.bcos.web3j.abi.datatypes.DynamicBytes)16 Address (org.fisco.bcos.web3j.abi.datatypes.Address)15 Bytes32 (org.fisco.bcos.web3j.abi.datatypes.generated.Bytes32)13 Type (org.fisco.bcos.web3j.abi.datatypes.Type)11 NamedType (org.fisco.bcos.web3j.protocol.core.methods.response.AbiDefinition.NamedType)11 Event (org.fisco.bcos.web3j.abi.datatypes.Event)8 ArrayList (java.util.ArrayList)7 TypeReference (org.fisco.bcos.web3j.abi.TypeReference)7 Bytes10 (org.fisco.bcos.web3j.abi.datatypes.generated.Bytes10)7 DynamicArray (org.fisco.bcos.web3j.abi.datatypes.DynamicArray)6 Function (org.fisco.bcos.web3j.abi.datatypes.Function)6 StaticArray3 (org.fisco.bcos.web3j.abi.datatypes.generated.StaticArray3)6 BigInteger (java.math.BigInteger)5 List (java.util.List)5 Log (org.fisco.bcos.web3j.protocol.core.methods.response.Log)5