use of org.fisco.bcos.web3j.tuples.generated.Tuple2 in project web3sdk by FISCO-BCOS.
the class ChannelConnections method heartbeat.
public void heartbeat() {
List<Tuple2<String, ChannelHandlerContext>> tuple2List = new ArrayList<>();
for (Map.Entry<String, ChannelHandlerContext> entry : networkConnections.entrySet()) {
String peer = entry.getKey();
ChannelHandlerContext ctx = entry.getValue();
if (Objects.nonNull(ctx) && ctx.channel().isActive() && ChannelHandlerContextHelper.isChannelAvailable(ctx)) {
tuple2List.add(new Tuple2<>(peer, ctx));
}
}
for (Tuple2<String, ChannelHandlerContext> tuple2 : tuple2List) {
logger.trace(" send heart beat to {}", tuple2.getValue1());
callback.sendHeartbeat(tuple2.getValue2());
}
}
use of org.fisco.bcos.web3j.tuples.generated.Tuple2 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());
}
use of org.fisco.bcos.web3j.tuples.generated.Tuple2 in project web3sdk by FISCO-BCOS.
the class Permission method getRemoveInput.
public Tuple2<String, String> getRemoveInput(TransactionReceipt transactionReceipt) {
String data = transactionReceipt.getInput().substring(10);
final Function function = new Function(FUNC_REMOVE, Arrays.<Type>asList(), Arrays.<TypeReference<?>>asList(new TypeReference<Utf8String>() {
}, new TypeReference<Utf8String>() {
}));
List<Type> results = FunctionReturnDecoder.decode(data, function.getOutputParameters());
;
return new Tuple2<String, String>((String) results.get(0).getValue(), (String) results.get(1).getValue());
}
use of org.fisco.bcos.web3j.tuples.generated.Tuple2 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());
}
use of org.fisco.bcos.web3j.tuples.generated.Tuple2 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());
}
Aggregations