org.fisco.bcos.web3j.abi.datatypes.generated.Bytes32 Java Examples

The following examples show how to use org.fisco.bcos.web3j.abi.datatypes.generated.Bytes32. 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: MixContract.java    From web3sdk with Apache License 2.0 6 votes vote down vote up
public RemoteCall<Tuple3<List<byte[]>, List<BigInteger>, List<byte[]>>> read(String name) {
    final Function function =
            new Function(
                    FUNC_READ,
                    Arrays.<Type>asList(
                            new org.fisco.bcos.web3j.abi.datatypes.Utf8String(name)),
                    Arrays.<TypeReference<?>>asList(
                            new TypeReference<DynamicArray<Bytes32>>() {},
                            new TypeReference<DynamicArray<Int256>>() {},
                            new TypeReference<DynamicArray<Bytes32>>() {}));
    return new RemoteCall<Tuple3<List<byte[]>, List<BigInteger>, List<byte[]>>>(
            new Callable<Tuple3<List<byte[]>, List<BigInteger>, List<byte[]>>>() {
                @Override
                public Tuple3<List<byte[]>, List<BigInteger>, List<byte[]>> call()
                        throws Exception {
                    List<Type> results = executeCallMultipleValueReturn(function);
                    return new Tuple3<List<byte[]>, List<BigInteger>, List<byte[]>>(
                            convertToNative((List<Bytes32>) results.get(0).getValue()),
                            convertToNative((List<Int256>) results.get(1).getValue()),
                            convertToNative((List<Bytes32>) results.get(2).getValue()));
                }
            });
}
 
Example #2
Source File: TableTest.java    From web3sdk with Apache License 2.0 6 votes vote down vote up
public RemoteCall<Tuple3<List<byte[]>, List<BigInteger>, List<byte[]>>> select(String name) {
    final Function function =
            new Function(
                    FUNC_SELECT,
                    Arrays.<Type>asList(
                            new org.fisco.bcos.web3j.abi.datatypes.Utf8String(name)),
                    Arrays.<TypeReference<?>>asList(
                            new TypeReference<DynamicArray<Bytes32>>() {},
                            new TypeReference<DynamicArray<Int256>>() {},
                            new TypeReference<DynamicArray<Bytes32>>() {}));
    return new RemoteCall<Tuple3<List<byte[]>, List<BigInteger>, List<byte[]>>>(
            new Callable<Tuple3<List<byte[]>, List<BigInteger>, List<byte[]>>>() {
                @Override
                public Tuple3<List<byte[]>, List<BigInteger>, List<byte[]>> call()
                        throws Exception {
                    List<Type> results = executeCallMultipleValueReturn(function);
                    return new Tuple3<List<byte[]>, List<BigInteger>, List<byte[]>>(
                            convertToNative((List<Bytes32>) results.get(0).getValue()),
                            convertToNative((List<Int256>) results.get(1).getValue()),
                            convertToNative((List<Bytes32>) results.get(2).getValue()));
                }
            });
}
 
Example #3
Source File: EvidenceSignersData.java    From WeBASE-Front with Apache License 2.0 6 votes vote down vote up
public Tuple6<String, String, String, BigInteger, byte[], byte[]> getNewEvidenceInput(TransactionReceipt transactionReceipt) {
    String data = transactionReceipt.getInput().substring(10);
    final Function function = new Function(FUNC_NEWEVIDENCE, 
            Arrays.<Type>asList(), 
            Arrays.<TypeReference<?>>asList(new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Uint8>() {}, new TypeReference<Bytes32>() {}, new TypeReference<Bytes32>() {}));
    List<Type> results = FunctionReturnDecoder.decode(data, function.getOutputParameters());;
    return new Tuple6<String, String, String, BigInteger, byte[], byte[]>(

            (String) results.get(0).getValue(), 
            (String) results.get(1).getValue(), 
            (String) results.get(2).getValue(), 
            (BigInteger) results.get(3).getValue(), 
            (byte[]) results.get(4).getValue(), 
            (byte[]) results.get(5).getValue()
            );
}
 
Example #4
Source File: EvidenceVerify.java    From web3sdk with Apache License 2.0 6 votes vote down vote up
public RemoteCall<TransactionReceipt> insertEvidence(
        String evi,
        String info,
        String id,
        String signAddr,
        byte[] message,
        BigInteger v,
        byte[] r,
        byte[] s) {
    final Function function =
            new Function(
                    FUNC_INSERTEVIDENCE,
                    Arrays.<Type>asList(
                            new org.fisco.bcos.web3j.abi.datatypes.Utf8String(evi),
                            new org.fisco.bcos.web3j.abi.datatypes.Utf8String(info),
                            new org.fisco.bcos.web3j.abi.datatypes.Utf8String(id),
                            new org.fisco.bcos.web3j.abi.datatypes.Address(signAddr),
                            new org.fisco.bcos.web3j.abi.datatypes.generated.Bytes32(message),
                            new org.fisco.bcos.web3j.abi.datatypes.generated.Uint8(v),
                            new org.fisco.bcos.web3j.abi.datatypes.generated.Bytes32(r),
                            new org.fisco.bcos.web3j.abi.datatypes.generated.Bytes32(s)),
                    Collections.<TypeReference<?>>emptyList());
    return executeRemoteCallTransaction(function);
}
 
Example #5
Source File: EvidenceVerify.java    From web3sdk with Apache License 2.0 6 votes vote down vote up
public void insertEvidence(
        String evi,
        String info,
        String id,
        String signAddr,
        byte[] message,
        BigInteger v,
        byte[] r,
        byte[] s,
        TransactionSucCallback callback) {
    final Function function =
            new Function(
                    FUNC_INSERTEVIDENCE,
                    Arrays.<Type>asList(
                            new org.fisco.bcos.web3j.abi.datatypes.Utf8String(evi),
                            new org.fisco.bcos.web3j.abi.datatypes.Utf8String(info),
                            new org.fisco.bcos.web3j.abi.datatypes.Utf8String(id),
                            new org.fisco.bcos.web3j.abi.datatypes.Address(signAddr),
                            new org.fisco.bcos.web3j.abi.datatypes.generated.Bytes32(message),
                            new org.fisco.bcos.web3j.abi.datatypes.generated.Uint8(v),
                            new org.fisco.bcos.web3j.abi.datatypes.generated.Bytes32(r),
                            new org.fisco.bcos.web3j.abi.datatypes.generated.Bytes32(s)),
                    Collections.<TypeReference<?>>emptyList());
    asyncExecuteTransaction(function, callback);
}
 
Example #6
Source File: Evidence.java    From evidenceSample with Apache License 2.0 6 votes vote down vote up
public RemoteCall<Tuple7<String, String, String, List<BigInteger>, List<byte[]>, List<byte[]>, List<String>>> getEvidence() {
    final Function function = new Function(FUNC_GETEVIDENCE, 
            Arrays.<Type>asList(), 
            Arrays.<TypeReference<?>>asList(new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}, new TypeReference<DynamicArray<Uint8>>() {}, new TypeReference<DynamicArray<Bytes32>>() {}, new TypeReference<DynamicArray<Bytes32>>() {}, new TypeReference<DynamicArray<Address>>() {}));
    return new RemoteCall<Tuple7<String, String, String, List<BigInteger>, List<byte[]>, List<byte[]>, List<String>>>(
            new Callable<Tuple7<String, String, String, List<BigInteger>, List<byte[]>, List<byte[]>, List<String>>>() {
                @Override
                public Tuple7<String, String, String, List<BigInteger>, List<byte[]>, List<byte[]>, List<String>> call() throws Exception {
                    List<Type> results = executeCallMultipleValueReturn(function);
                    return new Tuple7<String, String, String, List<BigInteger>, List<byte[]>, List<byte[]>, List<String>>(
                            (String) results.get(0).getValue(), 
                            (String) results.get(1).getValue(), 
                            (String) results.get(2).getValue(), 
                            convertToNative((List<Uint8>) results.get(3).getValue()), 
                            convertToNative((List<Bytes32>) results.get(4).getValue()), 
                            convertToNative((List<Bytes32>) results.get(5).getValue()), 
                            convertToNative((List<Address>) results.get(6).getValue()));
                }
            });
}
 
Example #7
Source File: EvidenceVerify.java    From web3sdk with Apache License 2.0 6 votes vote down vote up
public String insertEvidenceSeq(
        String evi,
        String info,
        String id,
        String signAddr,
        byte[] message,
        BigInteger v,
        byte[] r,
        byte[] s) {
    final Function function =
            new Function(
                    FUNC_INSERTEVIDENCE,
                    Arrays.<Type>asList(
                            new org.fisco.bcos.web3j.abi.datatypes.Utf8String(evi),
                            new org.fisco.bcos.web3j.abi.datatypes.Utf8String(info),
                            new org.fisco.bcos.web3j.abi.datatypes.Utf8String(id),
                            new org.fisco.bcos.web3j.abi.datatypes.Address(signAddr),
                            new org.fisco.bcos.web3j.abi.datatypes.generated.Bytes32(message),
                            new org.fisco.bcos.web3j.abi.datatypes.generated.Uint8(v),
                            new org.fisco.bcos.web3j.abi.datatypes.generated.Bytes32(r),
                            new org.fisco.bcos.web3j.abi.datatypes.generated.Bytes32(s)),
                    Collections.<TypeReference<?>>emptyList());
    return createTransactionSeq(function);
}
 
Example #8
Source File: Evidence.java    From WeBASE-Front with Apache License 2.0 6 votes vote down vote up
public RemoteCall<Tuple7<String, String, String, List<BigInteger>, List<byte[]>, List<byte[]>, List<String>>> getEvidence() {
    final Function function = new Function(FUNC_GETEVIDENCE, 
            Arrays.<Type>asList(), 
            Arrays.<TypeReference<?>>asList(new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}, new TypeReference<DynamicArray<Uint8>>() {}, new TypeReference<DynamicArray<Bytes32>>() {}, new TypeReference<DynamicArray<Bytes32>>() {}, new TypeReference<DynamicArray<Address>>() {}));
    return new RemoteCall<Tuple7<String, String, String, List<BigInteger>, List<byte[]>, List<byte[]>, List<String>>>(
            new Callable<Tuple7<String, String, String, List<BigInteger>, List<byte[]>, List<byte[]>, List<String>>>() {
                @Override
                public Tuple7<String, String, String, List<BigInteger>, List<byte[]>, List<byte[]>, List<String>> call() throws Exception {
                    List<Type> results = executeCallMultipleValueReturn(function);
                    return new Tuple7<String, String, String, List<BigInteger>, List<byte[]>, List<byte[]>, List<String>>(
                            (String) results.get(0).getValue(), 
                            (String) results.get(1).getValue(), 
                            (String) results.get(2).getValue(), 
                            convertToNative((List<Uint8>) results.get(3).getValue()), 
                            convertToNative((List<Bytes32>) results.get(4).getValue()), 
                            convertToNative((List<Bytes32>) results.get(5).getValue()), 
                            convertToNative((List<Address>) results.get(6).getValue()));
                }
            });
}
 
Example #9
Source File: TableTest.java    From web3sdk with Apache License 2.0 6 votes vote down vote up
public RemoteCall<Tuple3<List<byte[]>, List<BigInteger>, List<byte[]>>> select(String name) {
    final Function function =
            new Function(
                    FUNC_SELECT,
                    Arrays.<Type>asList(
                            new org.fisco.bcos.web3j.abi.datatypes.Utf8String(name)),
                    Arrays.<TypeReference<?>>asList(
                            new TypeReference<DynamicArray<Bytes32>>() {},
                            new TypeReference<DynamicArray<Int256>>() {},
                            new TypeReference<DynamicArray<Bytes32>>() {}));
    return new RemoteCall<Tuple3<List<byte[]>, List<BigInteger>, List<byte[]>>>(
            new Callable<Tuple3<List<byte[]>, List<BigInteger>, List<byte[]>>>() {
                @Override
                public Tuple3<List<byte[]>, List<BigInteger>, List<byte[]>> call()
                        throws Exception {
                    List<Type> results = executeCallMultipleValueReturn(function);
                    return new Tuple3<List<byte[]>, List<BigInteger>, List<byte[]>>(
                            convertToNative((List<Bytes32>) results.get(0).getValue()),
                            convertToNative((List<Int256>) results.get(1).getValue()),
                            convertToNative((List<Bytes32>) results.get(2).getValue()));
                }
            });
}
 
Example #10
Source File: ResultEntityTest.java    From web3sdk with Apache License 2.0 6 votes vote down vote up
@Test
public void typeToObjectTest0() {

    assertThat(ResultEntity.typeToObject(new Uint256(2)), is(new BigInteger("2")));
    assertThat(ResultEntity.typeToObject(new Int256(-1)), is(new BigInteger("-1")));
    assertThat(ResultEntity.typeToObject(new Utf8String("adsfjkl")), is("adsfjkl"));
    assertThat(ResultEntity.typeToObject(new Bool(true)), is(true));
    assertThat(ResultEntity.typeToObject(new DynamicBytes("0x111".getBytes())), is("0x111"));
    assertThat(
            ResultEntity.typeToObject(new Address("0x111")),
            is("0x0000000000000000000000000000000000000111"));
    assertThat(
            ResultEntity.typeToObject(
                    new Bytes32("01234567890123456789012345678912".getBytes())),
            is("01234567890123456789012345678912"));
}
 
Example #11
Source File: FunctionReturnDecoderTest.java    From web3sdk with Apache License 2.0 5 votes vote down vote up
@Test
public void testDecodeIndexedDynamicBytesValue() {
    DynamicBytes bytes = new DynamicBytes(new byte[] {1, 2, 3, 4, 5});
    String encoded = TypeEncoder.encodeDynamicBytes(bytes);
    String hash = Hash.sha3(encoded);

    assertThat(
            FunctionReturnDecoder.decodeIndexedValue(
                    hash, new TypeReference<DynamicBytes>() {}),
            equalTo(new Bytes32(Numeric.hexStringToByteArray(hash))));
}
 
Example #12
Source File: EvidenceVerify.java    From web3sdk with Apache License 2.0 5 votes vote down vote up
public Tuple8<String, String, String, String, byte[], BigInteger, byte[], byte[]>
        getInsertEvidenceInput(TransactionReceipt transactionReceipt) {
    String data = transactionReceipt.getInput().substring(10);
    final Function function =
            new Function(
                    FUNC_INSERTEVIDENCE,
                    Arrays.<Type>asList(),
                    Arrays.<TypeReference<?>>asList(
                            new TypeReference<Utf8String>() {},
                            new TypeReference<Utf8String>() {},
                            new TypeReference<Utf8String>() {},
                            new TypeReference<Address>() {},
                            new TypeReference<Bytes32>() {},
                            new TypeReference<Uint8>() {},
                            new TypeReference<Bytes32>() {},
                            new TypeReference<Bytes32>() {}));
    List<Type> results = FunctionReturnDecoder.decode(data, function.getOutputParameters());
    ;
    return new Tuple8<String, String, String, String, byte[], BigInteger, byte[], byte[]>(
            (String) results.get(0).getValue(),
            (String) results.get(1).getValue(),
            (String) results.get(2).getValue(),
            (String) results.get(3).getValue(),
            (byte[]) results.get(4).getValue(),
            (BigInteger) results.get(5).getValue(),
            (byte[]) results.get(6).getValue(),
            (byte[]) results.get(7).getValue());
}
 
Example #13
Source File: ContractTypeUtilTest.java    From web3sdk with Apache License 2.0 5 votes vote down vote up
@Test
public void getTypeTest() throws BaseException {
    assertThat(ContractTypeUtil.getType("bytes").getName(), is(DynamicBytes.class.getName()));
    assertThat(ContractTypeUtil.getType("address").getName(), is(Address.class.getName()));
    assertThat(ContractTypeUtil.getType("string").getName(), is(Utf8String.class.getName()));
    assertThat(ContractTypeUtil.getType("int").getName(), is(Int256.class.getName()));
    assertThat(ContractTypeUtil.getType("uint").getName(), is(Uint256.class.getName()));
    assertThat(ContractTypeUtil.getType("int256").getName(), is(Int256.class.getName()));
    assertThat(ContractTypeUtil.getType("uint256").getName(), is(Uint256.class.getName()));
    assertThat(ContractTypeUtil.getType("int8").getName(), is(Int8.class.getName()));
    assertThat(ContractTypeUtil.getType("uint8").getName(), is(Uint8.class.getName()));
    assertThat(ContractTypeUtil.getType("bool").getName(), is(Bool.class.getName()));
    assertThat(ContractTypeUtil.getType("bytes1").getName(), is(Bytes1.class.getName()));
    assertThat(ContractTypeUtil.getType("bytes32").getName(), is(Bytes32.class.getName()));
}
 
Example #14
Source File: FunctionReturnDecoderTest.java    From web3sdk with Apache License 2.0 5 votes vote down vote up
@Test
public void testDecodeIndexedStringValue() {
    Utf8String string = new Utf8String("some text");
    String encoded = TypeEncoder.encodeString(string);
    String hash = Hash.sha3(encoded);

    assertThat(
            FunctionReturnDecoder.decodeIndexedValue(hash, new TypeReference<Utf8String>() {}),
            equalTo(new Bytes32(Numeric.hexStringToByteArray(hash))));
}
 
Example #15
Source File: FunctionReturnDecoderTest.java    From web3sdk with Apache License 2.0 5 votes vote down vote up
@Test
public void testDecodeIndexedBytes32Value() {
    String rawInput = "0x1234567890123456789012345678901234567890123456789012345678901234";
    byte[] rawInputBytes = Numeric.hexStringToByteArray(rawInput);

    assertThat(
            FunctionReturnDecoder.decodeIndexedValue(rawInput, new TypeReference<Bytes32>() {}),
            equalTo(new Bytes32(rawInputBytes)));
}
 
Example #16
Source File: Evidence.java    From evidenceSample with Apache License 2.0 5 votes vote down vote up
@Deprecated
public static RemoteCall<Evidence> deploy(Web3j web3j, TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit, String evi, String info, String id, BigInteger v, byte[] r, byte[] s, String addr, String sender) {
    String encodedConstructor = FunctionEncoder.encodeConstructor(Arrays.<Type>asList(new org.fisco.bcos.web3j.abi.datatypes.Utf8String(evi), 
            new org.fisco.bcos.web3j.abi.datatypes.Utf8String(info), 
            new org.fisco.bcos.web3j.abi.datatypes.Utf8String(id), 
            new org.fisco.bcos.web3j.abi.datatypes.generated.Uint8(v), 
            new org.fisco.bcos.web3j.abi.datatypes.generated.Bytes32(r), 
            new org.fisco.bcos.web3j.abi.datatypes.generated.Bytes32(s), 
            new org.fisco.bcos.web3j.abi.datatypes.Address(addr), 
            new org.fisco.bcos.web3j.abi.datatypes.Address(sender)));
    return deployRemoteCall(Evidence.class, web3j, transactionManager, gasPrice, gasLimit, BINARY, encodedConstructor);
}
 
Example #17
Source File: FunctionReturnDecoderTest.java    From web3sdk with Apache License 2.0 5 votes vote down vote up
@Test
public void testDecodeIndexedDynamicArrayValue() {
    DynamicArray<Uint256> array = new DynamicArray<>(new Uint256(BigInteger.TEN));
    String encoded = TypeEncoder.encodeDynamicArray(array);
    String hash = Hash.sha3(encoded);

    assertThat(
            FunctionReturnDecoder.decodeIndexedValue(
                    hash, new TypeReference<DynamicArray>() {}),
            equalTo(new Bytes32(Numeric.hexStringToByteArray(hash))));
}
 
Example #18
Source File: Evidence.java    From evidenceSample with Apache License 2.0 5 votes vote down vote up
public RemoteCall<TransactionReceipt> addSignatures(BigInteger v, byte[] r, byte[] s) {
    final Function function = new Function(
            FUNC_ADDSIGNATURES, 
            Arrays.<Type>asList(new org.fisco.bcos.web3j.abi.datatypes.generated.Uint8(v), 
            new org.fisco.bcos.web3j.abi.datatypes.generated.Bytes32(r), 
            new org.fisco.bcos.web3j.abi.datatypes.generated.Bytes32(s)), 
            Collections.<TypeReference<?>>emptyList());
    return executeRemoteCallTransaction(function);
}
 
Example #19
Source File: Evidence.java    From evidenceSample with Apache License 2.0 5 votes vote down vote up
public void addSignatures(BigInteger v, byte[] r, byte[] s, TransactionSucCallback callback) {
    final Function function = new Function(
            FUNC_ADDSIGNATURES, 
            Arrays.<Type>asList(new org.fisco.bcos.web3j.abi.datatypes.generated.Uint8(v), 
            new org.fisco.bcos.web3j.abi.datatypes.generated.Bytes32(r), 
            new org.fisco.bcos.web3j.abi.datatypes.generated.Bytes32(s)), 
            Collections.<TypeReference<?>>emptyList());
    asyncExecuteTransaction(function, callback);
}
 
Example #20
Source File: Evidence.java    From evidenceSample with Apache License 2.0 5 votes vote down vote up
public static RemoteCall<Evidence> deploy(Web3j web3j, Credentials credentials, ContractGasProvider contractGasProvider, String evi, String info, String id, BigInteger v, byte[] r, byte[] s, String addr, String sender) {
    String encodedConstructor = FunctionEncoder.encodeConstructor(Arrays.<Type>asList(new org.fisco.bcos.web3j.abi.datatypes.Utf8String(evi), 
            new org.fisco.bcos.web3j.abi.datatypes.Utf8String(info), 
            new org.fisco.bcos.web3j.abi.datatypes.Utf8String(id), 
            new org.fisco.bcos.web3j.abi.datatypes.generated.Uint8(v), 
            new org.fisco.bcos.web3j.abi.datatypes.generated.Bytes32(r), 
            new org.fisco.bcos.web3j.abi.datatypes.generated.Bytes32(s), 
            new org.fisco.bcos.web3j.abi.datatypes.Address(addr), 
            new org.fisco.bcos.web3j.abi.datatypes.Address(sender)));
    return deployRemoteCall(Evidence.class, web3j, credentials, contractGasProvider, BINARY, encodedConstructor);
}
 
Example #21
Source File: Evidence.java    From evidenceSample with Apache License 2.0 5 votes vote down vote up
public static RemoteCall<Evidence> deploy(Web3j web3j, TransactionManager transactionManager, ContractGasProvider contractGasProvider, String evi, String info, String id, BigInteger v, byte[] r, byte[] s, String addr, String sender) {
    String encodedConstructor = FunctionEncoder.encodeConstructor(Arrays.<Type>asList(new org.fisco.bcos.web3j.abi.datatypes.Utf8String(evi), 
            new org.fisco.bcos.web3j.abi.datatypes.Utf8String(info), 
            new org.fisco.bcos.web3j.abi.datatypes.Utf8String(id), 
            new org.fisco.bcos.web3j.abi.datatypes.generated.Uint8(v), 
            new org.fisco.bcos.web3j.abi.datatypes.generated.Bytes32(r), 
            new org.fisco.bcos.web3j.abi.datatypes.generated.Bytes32(s), 
            new org.fisco.bcos.web3j.abi.datatypes.Address(addr), 
            new org.fisco.bcos.web3j.abi.datatypes.Address(sender)));
    return deployRemoteCall(Evidence.class, web3j, transactionManager, contractGasProvider, BINARY, encodedConstructor);
}
 
Example #22
Source File: Evidence.java    From evidenceSample with Apache License 2.0 5 votes vote down vote up
@Deprecated
public static RemoteCall<Evidence> deploy(Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit, String evi, String info, String id, BigInteger v, byte[] r, byte[] s, String addr, String sender) {
    String encodedConstructor = FunctionEncoder.encodeConstructor(Arrays.<Type>asList(new org.fisco.bcos.web3j.abi.datatypes.Utf8String(evi), 
            new org.fisco.bcos.web3j.abi.datatypes.Utf8String(info), 
            new org.fisco.bcos.web3j.abi.datatypes.Utf8String(id), 
            new org.fisco.bcos.web3j.abi.datatypes.generated.Uint8(v), 
            new org.fisco.bcos.web3j.abi.datatypes.generated.Bytes32(r), 
            new org.fisco.bcos.web3j.abi.datatypes.generated.Bytes32(s), 
            new org.fisco.bcos.web3j.abi.datatypes.Address(addr), 
            new org.fisco.bcos.web3j.abi.datatypes.Address(sender)));
    return deployRemoteCall(Evidence.class, web3j, credentials, gasPrice, gasLimit, BINARY, encodedConstructor);
}
 
Example #23
Source File: EvidenceSignersData.java    From WeBASE-Front with Apache License 2.0 5 votes vote down vote up
public RemoteCall<TransactionReceipt> newEvidence(String evi, String info, String id, BigInteger v, byte[] r, byte[] s) {
    final Function function = new Function(
            FUNC_NEWEVIDENCE, 
            Arrays.<Type>asList(new org.fisco.bcos.web3j.abi.datatypes.Utf8String(evi), 
            new org.fisco.bcos.web3j.abi.datatypes.Utf8String(info), 
            new org.fisco.bcos.web3j.abi.datatypes.Utf8String(id), 
            new org.fisco.bcos.web3j.abi.datatypes.generated.Uint8(v), 
            new org.fisco.bcos.web3j.abi.datatypes.generated.Bytes32(r), 
            new org.fisco.bcos.web3j.abi.datatypes.generated.Bytes32(s)), 
            Collections.<TypeReference<?>>emptyList());
    return executeRemoteCallTransaction(function);
}
 
Example #24
Source File: EvidenceSignersData.java    From WeBASE-Front with Apache License 2.0 5 votes vote down vote up
public void newEvidence(String evi, String info, String id, BigInteger v, byte[] r, byte[] s, TransactionSucCallback callback) {
    final Function function = new Function(
            FUNC_NEWEVIDENCE, 
            Arrays.<Type>asList(new org.fisco.bcos.web3j.abi.datatypes.Utf8String(evi), 
            new org.fisco.bcos.web3j.abi.datatypes.Utf8String(info), 
            new org.fisco.bcos.web3j.abi.datatypes.Utf8String(id), 
            new org.fisco.bcos.web3j.abi.datatypes.generated.Uint8(v), 
            new org.fisco.bcos.web3j.abi.datatypes.generated.Bytes32(r), 
            new org.fisco.bcos.web3j.abi.datatypes.generated.Bytes32(s)), 
            Collections.<TypeReference<?>>emptyList());
    asyncExecuteTransaction(function, callback);
}
 
Example #25
Source File: EvidenceSignersData.java    From WeBASE-Front with Apache License 2.0 5 votes vote down vote up
public String newEvidenceSeq(String evi, String info, String id, BigInteger v, byte[] r, byte[] s) {
    final Function function = new Function(
            FUNC_NEWEVIDENCE, 
            Arrays.<Type>asList(new org.fisco.bcos.web3j.abi.datatypes.Utf8String(evi), 
            new org.fisco.bcos.web3j.abi.datatypes.Utf8String(info), 
            new org.fisco.bcos.web3j.abi.datatypes.Utf8String(id), 
            new org.fisco.bcos.web3j.abi.datatypes.generated.Uint8(v), 
            new org.fisco.bcos.web3j.abi.datatypes.generated.Bytes32(r), 
            new org.fisco.bcos.web3j.abi.datatypes.generated.Bytes32(s)), 
            Collections.<TypeReference<?>>emptyList());
    return createTransactionSeq(function);
}
 
Example #26
Source File: Evidence.java    From WeBASE-Front with Apache License 2.0 5 votes vote down vote up
public RemoteCall<TransactionReceipt> addSignatures(BigInteger v, byte[] r, byte[] s) {
    final Function function = new Function(
            FUNC_ADDSIGNATURES, 
            Arrays.<Type>asList(new org.fisco.bcos.web3j.abi.datatypes.generated.Uint8(v), 
            new org.fisco.bcos.web3j.abi.datatypes.generated.Bytes32(r), 
            new org.fisco.bcos.web3j.abi.datatypes.generated.Bytes32(s)), 
            Collections.<TypeReference<?>>emptyList());
    return executeRemoteCallTransaction(function);
}
 
Example #27
Source File: Evidence.java    From WeBASE-Front with Apache License 2.0 5 votes vote down vote up
public void addSignatures(BigInteger v, byte[] r, byte[] s, TransactionSucCallback callback) {
    final Function function = new Function(
            FUNC_ADDSIGNATURES, 
            Arrays.<Type>asList(new org.fisco.bcos.web3j.abi.datatypes.generated.Uint8(v), 
            new org.fisco.bcos.web3j.abi.datatypes.generated.Bytes32(r), 
            new org.fisco.bcos.web3j.abi.datatypes.generated.Bytes32(s)), 
            Collections.<TypeReference<?>>emptyList());
    asyncExecuteTransaction(function, callback);
}
 
Example #28
Source File: BytesUtils.java    From WeBASE-Collect-Bee with Apache License 2.0 5 votes vote down vote up
public static List<String> bytes32DynamicArrayToList(List<Bytes32> bytes32List) {
    List<String> stringList = new ArrayList<>();
    for (int i = 0; i < bytes32List.size(); i++) {
        stringList.add(bytesTypeToString(bytes32List.get(i)).trim());
    }
    return stringList;
}
 
Example #29
Source File: Evidence.java    From WeBASE-Front with Apache License 2.0 5 votes vote down vote up
public String addSignaturesSeq(BigInteger v, byte[] r, byte[] s) {
    final Function function = new Function(
            FUNC_ADDSIGNATURES, 
            Arrays.<Type>asList(new org.fisco.bcos.web3j.abi.datatypes.generated.Uint8(v), 
            new org.fisco.bcos.web3j.abi.datatypes.generated.Bytes32(r), 
            new org.fisco.bcos.web3j.abi.datatypes.generated.Bytes32(s)), 
            Collections.<TypeReference<?>>emptyList());
    return createTransactionSeq(function);
}
 
Example #30
Source File: Evidence.java    From WeBASE-Front with Apache License 2.0 5 votes vote down vote up
public Tuple3<BigInteger, byte[], byte[]> getAddSignaturesInput(TransactionReceipt transactionReceipt) {
    String data = transactionReceipt.getInput().substring(10);
    final Function function = new Function(FUNC_ADDSIGNATURES, 
            Arrays.<Type>asList(), 
            Arrays.<TypeReference<?>>asList(new TypeReference<Uint8>() {}, new TypeReference<Bytes32>() {}, new TypeReference<Bytes32>() {}));
    List<Type> results = FunctionReturnDecoder.decode(data, function.getOutputParameters());;
    return new Tuple3<BigInteger, byte[], byte[]>(

            (BigInteger) results.get(0).getValue(), 
            (byte[]) results.get(1).getValue(), 
            (byte[]) results.get(2).getValue()
            );
}