@Test public void testIsSyncedFullySynced() throws Exception { configureSyncing(false); configureLatestBlock(System.currentTimeMillis() / 1000); assertTrue(ensResolver.isSynced()); }
boolean isSynced() throws Exception { EthSyncing ethSyncing = web3j.ethSyncing().send(); if (ethSyncing.isSyncing()) { return false; } else { EthBlock ethBlock = web3j.ethGetBlockByNumber(DefaultBlockParameterName.LATEST, false).send(); long timestamp = ethBlock.getBlock().getTimestamp().longValueExact() * 1000; return System.currentTimeMillis() - syncThreshold < timestamp; } }
EnsResolver { boolean isSynced() throws Exception { EthSyncing ethSyncing = web3j.ethSyncing().send(); if (ethSyncing.isSyncing()) { return false; } else { EthBlock ethBlock = web3j.ethGetBlockByNumber(DefaultBlockParameterName.LATEST, false).send(); long timestamp = ethBlock.getBlock().getTimestamp().longValueExact() * 1000; return System.currentTimeMillis() - syncThreshold < timestamp; } } }
EnsResolver { boolean isSynced() throws Exception { EthSyncing ethSyncing = web3j.ethSyncing().send(); if (ethSyncing.isSyncing()) { return false; } else { EthBlock ethBlock = web3j.ethGetBlockByNumber(DefaultBlockParameterName.LATEST, false).send(); long timestamp = ethBlock.getBlock().getTimestamp().longValueExact() * 1000; return System.currentTimeMillis() - syncThreshold < timestamp; } } EnsResolver(Web3j web3j, long syncThreshold);  EnsResolver(Web3j web3j); }
EnsResolver { boolean isSynced() throws Exception { EthSyncing ethSyncing = web3j.ethSyncing().send(); if (ethSyncing.isSyncing()) { return false; } else { EthBlock ethBlock = web3j.ethGetBlockByNumber(DefaultBlockParameterName.LATEST, false).send(); long timestamp = ethBlock.getBlock().getTimestamp().longValueExact() * 1000; return System.currentTimeMillis() - syncThreshold < timestamp; } } EnsResolver(Web3j web3j, long syncThreshold);  EnsResolver(Web3j web3j); void setSyncThreshold(long syncThreshold); long getSyncThreshold(); PublicResolver obtainPublicResolver(String ensName); String resolve(String contractId); String reverseResolve(String address); static boolean isValidEnsName(String input); }
EnsResolver { boolean isSynced() throws Exception { EthSyncing ethSyncing = web3j.ethSyncing().send(); if (ethSyncing.isSyncing()) { return false; } else { EthBlock ethBlock = web3j.ethGetBlockByNumber(DefaultBlockParameterName.LATEST, false).send(); long timestamp = ethBlock.getBlock().getTimestamp().longValueExact() * 1000; return System.currentTimeMillis() - syncThreshold < timestamp; } } EnsResolver(Web3j web3j, long syncThreshold);  EnsResolver(Web3j web3j); void setSyncThreshold(long syncThreshold); long getSyncThreshold(); PublicResolver obtainPublicResolver(String ensName); String resolve(String contractId); String reverseResolve(String address); static boolean isValidEnsName(String input);  }