Search in sources :

Example 6 with TypeReference

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

the class ChainGovernance method getGrantOperatorInput.

public Tuple1<String> getGrantOperatorInput(TransactionReceipt transactionReceipt) {
    String data = transactionReceipt.getInput().substring(10);
    final Function function = new Function(FUNC_GRANTOPERATOR, 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 7 with TypeReference

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

the class ChainGovernance method getFreezeAccountOutput.

public Tuple1<BigInteger> getFreezeAccountOutput(TransactionReceipt transactionReceipt) {
    String data = transactionReceipt.getOutput();
    final Function function = new Function(FUNC_FREEZEACCOUNT, 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)

Example 8 with TypeReference

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

the class ChainGovernance method getUpdateThresholdOutput.

public Tuple1<BigInteger> getUpdateThresholdOutput(TransactionReceipt transactionReceipt) {
    String data = transactionReceipt.getOutput();
    final Function function = new Function(FUNC_UPDATETHRESHOLD, 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)

Example 9 with TypeReference

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

the class ChainGovernance method getRevokeCommitteeMemberInput.

public Tuple1<String> getRevokeCommitteeMemberInput(TransactionReceipt transactionReceipt) {
    String data = transactionReceipt.getInput().substring(10);
    final Function function = new Function(FUNC_REVOKECOMMITTEEMEMBER, 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 10 with TypeReference

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

the class ChainGovernance method getUpdateCommitteeMemberWeightInput.

public Tuple2<String, BigInteger> getUpdateCommitteeMemberWeightInput(TransactionReceipt transactionReceipt) {
    String data = transactionReceipt.getInput().substring(10);
    final Function function = new Function(FUNC_UPDATECOMMITTEEMEMBERWEIGHT, Arrays.<Type>asList(), Arrays.<TypeReference<?>>asList(new TypeReference<Address>() {
    }, new TypeReference<Int256>() {
    }));
    List<Type> results = FunctionReturnDecoder.decode(data, function.getOutputParameters());
    ;
    return new Tuple2<String, BigInteger>((String) results.get(0).getValue(), (BigInteger) 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)

Aggregations

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