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);
}
}
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);
}
Aggregations