Search in sources :

Example 1 with TransactionFilterChain

use of org.bcos.contract.source.TransactionFilterChain in project web3sdk by FISCO-BCOS.

the class SystemProxyTools method processSystemProxy.

static void processSystemProxy(SystemProxy systemProxy, Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) {
    try {
        System.out.println("-----------------系统路由表----------------------");
        Uint256 routelength = systemProxy.getRouteSize().get();
        for (int i = 0; i < routelength.getValue().intValue(); i++) {
            Utf8String key = systemProxy.getRouteNameByIndex(new Uint256(i)).get();
            List<Type> route = systemProxy.getRoute(key).get();
            System.out.println(" " + i + ")" + key + "=>" + (route.get(0)) + "," + route.get(1).getValue() + "," + ((BigInteger) (route.get(2).getValue())).intValue());
            if (key.getValue().equals("TransactionFilterChain")) {
                TransactionFilterChain transactionFilterChain1 = TransactionFilterChain.load(route.get(0).toString(), web3j, credentials, gasPrice, gasLimit);
                Uint256 filterlength = transactionFilterChain1.getFiltersLength().get();
                for (int j = 0; j < filterlength.getValue().intValue(); j++) {
                    Address filter = transactionFilterChain1.getFilter(new Uint256(j)).get();
                    TransactionFilterBase transactionFilterBase = TransactionFilterBase.load(filter.toString(), web3j, credentials, gasPrice, gasLimit);
                    Utf8String name = transactionFilterBase._name().get();
                    Utf8String version = transactionFilterBase._version().get();
                    System.out.println("       " + name + "=>" + version + "," + filter);
                }
            }
        }
    } catch (Exception e) {
        System.out.println(e);
    }
}
Also used : Utf8String(org.bcos.web3j.abi.datatypes.Utf8String) Type(org.bcos.web3j.abi.datatypes.Type) Address(org.bcos.web3j.abi.datatypes.Address) TransactionFilterChain(org.bcos.contract.source.TransactionFilterChain) BigInteger(java.math.BigInteger) TransactionFilterBase(org.bcos.contract.source.TransactionFilterBase) Uint256(org.bcos.web3j.abi.datatypes.generated.Uint256)

Aggregations

BigInteger (java.math.BigInteger)1 TransactionFilterBase (org.bcos.contract.source.TransactionFilterBase)1 TransactionFilterChain (org.bcos.contract.source.TransactionFilterChain)1 Address (org.bcos.web3j.abi.datatypes.Address)1 Type (org.bcos.web3j.abi.datatypes.Type)1 Utf8String (org.bcos.web3j.abi.datatypes.Utf8String)1 Uint256 (org.bcos.web3j.abi.datatypes.generated.Uint256)1