Java Code Examples for org.web3j.rlp.RlpString#create()

The following examples show how to use org.web3j.rlp.RlpString#create() . 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: CustomStaticArray.java    From client-sdk-java with Apache License 2.0 5 votes vote down vote up
public RlpType getRlpEncodeData() {
    if (list != null ) {
        List<RlpType> rlpListList = new ArrayList<>();
        for (T t : list) {
            rlpListList.add(t.getRlpEncodeData());
        }
        return RlpString.create(RlpEncoder.encode(new RlpList(rlpListList)));
    }
    throw new RuntimeException("unsupported types");
}
 
Example 2
Source File: RestrictingPlan.java    From client-sdk-java with Apache License 2.0 4 votes vote down vote up
@Override
public RlpType getRlpEncodeData() {
    return new RlpList(RlpString.create(epoch), RlpString.create(amount));
}
 
Example 3
Source File: NodeId.java    From client-sdk-java with Apache License 2.0 4 votes vote down vote up
@Override
public RlpType getRlpEncodeData() {
    return RlpString.create(Numeric.hexStringToByteArray(nodeId));
}
 
Example 4
Source File: Base64String.java    From web3j with Apache License 2.0 4 votes vote down vote up
public RlpString asRlp() {
    return RlpString.create(raw());
}