Search in sources :

Example 11 with NetVersion

use of org.web3j.protocol.core.methods.response.NetVersion in project besu by hyperledger.

the class NetVersionTransaction method execute.

@Override
public String execute(final NodeRequests node) {
    try {
        final NetVersion result = node.net().netVersion().send();
        assertThat(result).isNotNull();
        if (result.hasError()) {
            throw new RuntimeException(result.getError().getMessage());
        }
        return result.getNetVersion();
    } catch (final Exception e) {
        throw new RuntimeException(e);
    }
}
Also used : NetVersion(org.web3j.protocol.core.methods.response.NetVersion)

Example 12 with NetVersion

use of org.web3j.protocol.core.methods.response.NetVersion in project Ethernity-Wallet-Android by kris-krytech.

the class EnsResolver method lookupResolver.

private String lookupResolver(String ensName) throws Exception {
    NetVersion netVersion = web3j.netVersion().send();
    String registryContract = Contracts.resolveRegistryContract(netVersion.getNetVersion());
    byte[] nameHash = NameHash.nameHashAsBytes(ensName);
    Function resolver = getResolver(nameHash);
    return getContractData(MAINNET_ID, registryContract, resolver);
}
Also used : TokenscriptFunction(com.alphawallet.app.entity.tokenscript.TokenscriptFunction) Function(org.web3j.abi.datatypes.Function) Utf8String(org.web3j.abi.datatypes.Utf8String) NetVersion(org.web3j.protocol.core.methods.response.NetVersion)

Aggregations

NetVersion (org.web3j.protocol.core.methods.response.NetVersion)12 Test (org.junit.jupiter.api.Test)6 Utf8String (org.web3j.abi.datatypes.Utf8String)4 Request (org.web3j.protocol.core.Request)3 TokenscriptFunction (com.alphawallet.app.entity.tokenscript.TokenscriptFunction)2 Function (org.web3j.abi.datatypes.Function)2 ENS (org.web3j.ens.contracts.generated.ENS)2 EthCall (org.web3j.protocol.core.methods.response.EthCall)2 Web3ClientVersion (org.web3j.protocol.core.methods.response.Web3ClientVersion)2 DefaultGasProvider (org.web3j.tx.gas.DefaultGasProvider)2 IOException (java.io.IOException)1 Test (org.junit.Test)1 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)1 EVMTest (org.web3j.EVMTest)1 Web3j (org.web3j.protocol.Web3j)1 BatchRequest (org.web3j.protocol.core.BatchRequest)1 BatchResponse (org.web3j.protocol.core.BatchResponse)1 Web3Sha3 (org.web3j.protocol.core.methods.response.Web3Sha3)1 UnixIpcService (org.web3j.protocol.ipc.UnixIpcService)1