org.web3j.abi.datatypes.generated.Bytes16 Java Examples

The following examples show how to use org.web3j.abi.datatypes.generated.Bytes16. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: FunctionReturnDecoderTest.java    From client-sdk-java with Apache License 2.0 5 votes vote down vote up
@Test
public void testDecodeIndexedBytes16Value() {
    String rawInput = "0x1234567890123456789012345678901200000000000000000000000000000000";
    byte[] rawInputBytes = Numeric.hexStringToByteArray(rawInput.substring(0, 34));

    assertThat(FunctionReturnDecoder.decodeIndexedValue(
            rawInput,
            new TypeReference<Bytes16>(){}),
            equalTo(new Bytes16(rawInputBytes)));
}
 
Example #2
Source File: FunctionReturnDecoderTest.java    From etherscan-explorer with GNU General Public License v3.0 5 votes vote down vote up
@Test
public void testDecodeIndexedBytes16Value() {
    String rawInput = "0x1234567890123456789012345678901200000000000000000000000000000000";
    byte[] rawInputBytes = Numeric.hexStringToByteArray(rawInput.substring(0, 34));

    assertThat(FunctionReturnDecoder.decodeIndexedValue(
            rawInput,
            new TypeReference<Bytes16>(){}),
            equalTo(new Bytes16(rawInputBytes)));
}
 
Example #3
Source File: EventEmitter.java    From eventeum with Apache License 2.0 5 votes vote down vote up
public RemoteFunctionCall<TransactionReceipt> emitEventBytes16(byte[] bytes16Value) {
    final Function function = new Function(
            FUNC_EMITEVENTBYTES16, 
            Arrays.<Type>asList(new org.web3j.abi.datatypes.generated.Bytes16(bytes16Value)), 
            Collections.<TypeReference<?>>emptyList());
    return executeRemoteCallTransaction(function);
}
 
Example #4
Source File: FunctionReturnDecoderTest.java    From web3j with Apache License 2.0 5 votes vote down vote up
@Test
public void testDecodeIndexedBytes16Value() {
    String rawInput = "0x1234567890123456789012345678901200000000000000000000000000000000";
    byte[] rawInputBytes = Numeric.hexStringToByteArray(rawInput.substring(0, 34));

    assertEquals(
            FunctionReturnDecoder.decodeIndexedValue(rawInput, new TypeReference<Bytes16>() {}),
            (new Bytes16(rawInputBytes)));
}