Search in sources :

Example 16 with Type

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

the class Permission method getGrantWriteInput.

public Tuple2<String, String> getGrantWriteInput(TransactionReceipt transactionReceipt) {
    String data = transactionReceipt.getInput().substring(10);
    final Function function = new Function(FUNC_GRANTWRITE, Arrays.<Type>asList(), Arrays.<TypeReference<?>>asList(new TypeReference<Address>() {
    }, new TypeReference<Address>() {
    }));
    List<Type> results = FunctionReturnDecoder.decode(data, function.getOutputParameters());
    ;
    return new Tuple2<String, String>((String) results.get(0).getValue(), (String) results.get(1).getValue());
}
Also used : Function(org.fisco.bcos.web3j.abi.datatypes.Function) Type(org.fisco.bcos.web3j.abi.datatypes.Type) EncryptType(org.fisco.bcos.web3j.crypto.EncryptType) Tuple2(org.fisco.bcos.web3j.tuples.generated.Tuple2) Utf8String(org.fisco.bcos.web3j.abi.datatypes.Utf8String) TypeReference(org.fisco.bcos.web3j.abi.TypeReference)

Example 17 with Type

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

the class Permission method getInsertOutput.

public Tuple1<BigInteger> getInsertOutput(TransactionReceipt transactionReceipt) {
    String data = transactionReceipt.getOutput();
    final Function function = new Function(FUNC_INSERT, Arrays.<Type>asList(), Arrays.<TypeReference<?>>asList(new TypeReference<Int256>() {
    }));
    List<Type> results = FunctionReturnDecoder.decode(data, function.getOutputParameters());
    ;
    return new Tuple1<BigInteger>((BigInteger) results.get(0).getValue());
}
Also used : Function(org.fisco.bcos.web3j.abi.datatypes.Function) Type(org.fisco.bcos.web3j.abi.datatypes.Type) EncryptType(org.fisco.bcos.web3j.crypto.EncryptType) Tuple1(org.fisco.bcos.web3j.tuples.generated.Tuple1) Utf8String(org.fisco.bcos.web3j.abi.datatypes.Utf8String) TypeReference(org.fisco.bcos.web3j.abi.TypeReference)

Example 18 with Type

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

the class ContractLifeCyclePrecompiled method getFreezeInput.

public Tuple1<String> getFreezeInput(TransactionReceipt transactionReceipt) {
    String data = transactionReceipt.getInput().substring(10);
    final Function function = new Function(FUNC_FREEZE, Arrays.<Type>asList(), Arrays.<TypeReference<?>>asList(new TypeReference<Address>() {
    }));
    List<Type> results = FunctionReturnDecoder.decode(data, function.getOutputParameters());
    ;
    return new Tuple1<String>((String) results.get(0).getValue());
}
Also used : Function(org.fisco.bcos.web3j.abi.datatypes.Function) Type(org.fisco.bcos.web3j.abi.datatypes.Type) Tuple1(org.fisco.bcos.web3j.tuples.generated.Tuple1) Utf8String(org.fisco.bcos.web3j.abi.datatypes.Utf8String) TypeReference(org.fisco.bcos.web3j.abi.TypeReference)

Example 19 with Type

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

the class ContractLifeCyclePrecompiled method getGrantManagerInput.

public Tuple2<String, String> getGrantManagerInput(TransactionReceipt transactionReceipt) {
    String data = transactionReceipt.getInput().substring(10);
    final Function function = new Function(FUNC_GRANTMANAGER, Arrays.<Type>asList(), Arrays.<TypeReference<?>>asList(new TypeReference<Address>() {
    }, new TypeReference<Address>() {
    }));
    List<Type> results = FunctionReturnDecoder.decode(data, function.getOutputParameters());
    ;
    return new Tuple2<String, String>((String) results.get(0).getValue(), (String) results.get(1).getValue());
}
Also used : Function(org.fisco.bcos.web3j.abi.datatypes.Function) Type(org.fisco.bcos.web3j.abi.datatypes.Type) Tuple2(org.fisco.bcos.web3j.tuples.generated.Tuple2) Utf8String(org.fisco.bcos.web3j.abi.datatypes.Utf8String) TypeReference(org.fisco.bcos.web3j.abi.TypeReference)

Example 20 with Type

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

the class ContractLifeCyclePrecompiled method getFreezeOutput.

public Tuple1<BigInteger> getFreezeOutput(TransactionReceipt transactionReceipt) {
    String data = transactionReceipt.getOutput();
    final Function function = new Function(FUNC_FREEZE, Arrays.<Type>asList(), Arrays.<TypeReference<?>>asList(new TypeReference<Int256>() {
    }));
    List<Type> results = FunctionReturnDecoder.decode(data, function.getOutputParameters());
    ;
    return new Tuple1<BigInteger>((BigInteger) results.get(0).getValue());
}
Also used : Function(org.fisco.bcos.web3j.abi.datatypes.Function) Type(org.fisco.bcos.web3j.abi.datatypes.Type) Tuple1(org.fisco.bcos.web3j.tuples.generated.Tuple1) Utf8String(org.fisco.bcos.web3j.abi.datatypes.Utf8String) TypeReference(org.fisco.bcos.web3j.abi.TypeReference)

Aggregations

Type (org.fisco.bcos.web3j.abi.datatypes.Type)59 Utf8String (org.fisco.bcos.web3j.abi.datatypes.Utf8String)52 TypeReference (org.fisco.bcos.web3j.abi.TypeReference)46 Function (org.fisco.bcos.web3j.abi.datatypes.Function)42 Tuple1 (org.fisco.bcos.web3j.tuples.generated.Tuple1)26 DynamicBytes (org.fisco.bcos.web3j.abi.datatypes.DynamicBytes)16 NamedType (org.fisco.bcos.web3j.protocol.core.methods.response.AbiDefinition.NamedType)16 Bool (org.fisco.bcos.web3j.abi.datatypes.Bool)15 ArrayList (java.util.ArrayList)14 Address (org.fisco.bcos.web3j.abi.datatypes.Address)14 EncryptType (org.fisco.bcos.web3j.crypto.EncryptType)14 Int256 (org.fisco.bcos.web3j.abi.datatypes.generated.Int256)13 Bytes32 (org.fisco.bcos.web3j.abi.datatypes.generated.Bytes32)11 Uint256 (org.fisco.bcos.web3j.abi.datatypes.generated.Uint256)11 Test (org.junit.Test)10 AbiDefinition (org.fisco.bcos.web3j.protocol.core.methods.response.AbiDefinition)9 List (java.util.List)8 Tuple2 (org.fisco.bcos.web3j.tuples.generated.Tuple2)7 DynamicArray (org.fisco.bcos.web3j.abi.datatypes.DynamicArray)6 Event (org.fisco.bcos.web3j.abi.datatypes.Event)6