From 32f60498b5d3236cb4a7e98a6b2b38d824fa81f8 Mon Sep 17 00:00:00 2001 From: James Brown Date: Sun, 30 Oct 2022 07:40:50 +1100 Subject: [PATCH] Bump gradle for point release resolve deprecated testnet RPCs --- app/build.gradle | 4 +-- .../app/repository/EthereumNetworkBase.java | 31 ++++++++----------- .../app/service/TickerService.java | 4 +-- build.gradle | 2 +- 4 files changed, 18 insertions(+), 23 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index cc1f2ee95f..83394ce917 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -85,8 +85,8 @@ android { } } defaultConfig { - versionCode 204 - versionName "3.60" + versionCode 205 + versionName "3.61" applicationId "io.stormbird.wallet" minSdkVersion 23 diff --git a/app/src/main/java/com/alphawallet/app/repository/EthereumNetworkBase.java b/app/src/main/java/com/alphawallet/app/repository/EthereumNetworkBase.java index 64a0bf64ef..2c386047bc 100644 --- a/app/src/main/java/com/alphawallet/app/repository/EthereumNetworkBase.java +++ b/app/src/main/java/com/alphawallet/app/repository/EthereumNetworkBase.java @@ -122,21 +122,15 @@ public abstract class EthereumNetworkBase implements EthereumNetworkRepositoryTy public static final String FREE_MAINNET_RPC_URL = "https://rpc.ankr.com/eth"; public static final String FREE_POLYGON_RPC_URL = "https://polygon-rpc.com"; public static final String FREE_ARBITRUM_RPC_URL = "https://arbitrum.public-rpc.com"; - public static final String FREE_RINKEBY_RPC_URL = "https://rpc.ankr.com/eth_rinkeby"; public static final String FREE_GOERLI_RPC_URL = "https://rpc.ankr.com/eth_goerli"; public static final String FREE_MUMBAI_RPC_URL = "https://rpc-mumbai.maticvigil.com"; public static final String FREE_ARBITRUM_TEST_RPC_URL = "https://rinkeby.arbitrum.io/rpc"; - public static final String FREE_KOVAN_RPC_URL = "https://kovan.poa.network"; public static final String FREE_PALM_RPC_URL = "https://palm-mainnet.infura.io/v3/3a961d6501e54add9a41aa53f15de99b"; public static final String FREE_PALM_TEST_RPC_URL = "https://palm-testnet.infura.io/v3/3a961d6501e54add9a41aa53f15de99b"; public static final String FREE_CRONOS_MAIN_BETA_RPC_URL = "https://evm.cronos.org"; public static final String MAINNET_RPC_URL = usesProductionKey ? "https://mainnet.infura.io/v3/" + keyProvider.getInfuraKey() : FREE_MAINNET_RPC_URL; - public static final String RINKEBY_RPC_URL = usesProductionKey ? "https://rinkeby.infura.io/v3/" + keyProvider.getInfuraKey() - : FREE_RINKEBY_RPC_URL; - public static final String KOVAN_RPC_URL = usesProductionKey ? "https://kovan.infura.io/v3/" + keyProvider.getInfuraKey() - : FREE_KOVAN_RPC_URL; public static final String GOERLI_RPC_URL = usesProductionKey ? "https://goerli.infura.io/v3/" + keyProvider.getInfuraKey() : FREE_GOERLI_RPC_URL; public static final String POLYGON_RPC_URL = usesProductionKey ? "https://polygon-mainnet.infura.io/v3/" + keyProvider.getInfuraKey() @@ -147,10 +141,6 @@ public abstract class EthereumNetworkBase implements EthereumNetworkRepositoryTy : FREE_MUMBAI_RPC_URL; public static final String OPTIMISTIC_MAIN_URL = usesProductionKey ? "https://optimism-mainnet.infura.io/v3/" + keyProvider.getInfuraKey() : OPTIMISTIC_MAIN_FALLBACK_URL; - public static final String OPTIMISTIC_TEST_URL = usesProductionKey ? "https://optimism-kovan.infura.io/v3/" + keyProvider.getInfuraKey() - : OPTIMISTIC_TEST_FALLBACK_URL; - public static final String ARBITRUM_TESTNET_RPC = usesProductionKey ? "https://arbitrum-rinkeby.infura.io/v3/" + keyProvider.getInfuraKey() - : FREE_ARBITRUM_TEST_RPC_URL; public static final String PALM_RPC_URL = usesProductionKey ? "https://palm-mainnet.infura.io/v3/" + keyProvider.getInfuraKey() : FREE_PALM_RPC_URL; public static final String PALM_TEST_RPC_URL = usesProductionKey ? "https://palm-testnet.infura.io/v3/" + keyProvider.getInfuraKey() @@ -163,22 +153,27 @@ public abstract class EthereumNetworkBase implements EthereumNetworkRepositoryTy // Use the "Free" routes as backup in order to diversify node usage; to avoid single point of failure public static final String MAINNET_FALLBACK_RPC_URL = usesProductionKey ? FREE_MAINNET_RPC_URL : "https://mainnet.infura.io/v3/" + keyProvider.getSecondaryInfuraKey(); - public static final String RINKEBY_FALLBACK_RPC_URL = usesProductionKey ? FREE_RINKEBY_RPC_URL : "https://rinkeby.infura.io/v3/" + keyProvider.getSecondaryInfuraKey(); - public static final String KOVAN_FALLBACK_RPC_URL = usesProductionKey ? FREE_KOVAN_RPC_URL : "https://kovan.infura.io/v3/" + keyProvider.getSecondaryInfuraKey(); public static final String GOERLI_FALLBACK_RPC_URL = usesProductionKey ? FREE_GOERLI_RPC_URL : "https://goerli.infura.io/v3/" + keyProvider.getSecondaryInfuraKey(); public static final String ARBITRUM_FALLBACK_MAINNET_RPC = usesProductionKey ? FREE_ARBITRUM_RPC_URL : "https://arbitrum-mainnet.infura.io/v3/" + keyProvider.getSecondaryInfuraKey(); public static final String PALM_RPC_FALLBACK_URL = usesProductionKey ? FREE_PALM_RPC_URL : "https://palm-mainnet.infura.io/v3/" + keyProvider.getSecondaryInfuraKey(); public static final String PALM_TEST_RPC_FALLBACK_URL = usesProductionKey ? FREE_PALM_RPC_URL : "https://palm-testnet.infura.io/v3/" + keyProvider.getSecondaryInfuraKey(); + //Deprecated: for now these RPCs still work + public static final String ROPSTEN_RPC_URL = "https://rpc.ankr.com/eth_ropsten"; + public static final String RINKEBY_RPC_URL = "https://rpc.ankr.com/eth_rinkeby"; + public static final String ARBITRUM_TESTNET_RPC = FREE_ARBITRUM_TEST_RPC_URL; + public static final String SOKOL_RPC_URL = "https://sokol.poa.network"; + + //These Networks are no longer running + public static final String KOVAN_RPC_URL = "https://kovan.poa.network"; + public static final String OPTIMISTIC_TEST_URL = OPTIMISTIC_TEST_FALLBACK_URL; + //Note that AlphaWallet now uses a double node configuration. See class AWHttpService comment 'try primary node'. //If you supply a main RPC and secondary it will try the secondary if the primary node times out after 10 seconds. //See the declaration of NetworkInfo - it has a member backupNodeUrl. Put your secondary node here. - public static final String ROPSTEN_FALLBACK_RPC_URL = "https://ropsten.infura.io/v3/" + keyProvider.getSecondaryInfuraKey(); public static final String CLASSIC_RPC_URL = "https://www.ethercluster.com/etc"; public static final String POA_RPC_URL = "https://core.poa.network/"; - public static final String ROPSTEN_RPC_URL = "https://ropsten.infura.io/v3/" + keyProvider.getInfuraKey(); - public static final String SOKOL_RPC_URL = "https://sokol.poa.network"; public static final String ARTIS_SIGMA1_RPC_URL = "https://rpc.sigma1.artis.network"; public static final String ARTIS_TAU1_RPC_URL = "https://rpc.tau1.artis.network"; public static final String BINANCE_TEST_RPC_URL = "https://data-seed-prebsc-1-s3.binance.org:8545"; @@ -363,15 +358,15 @@ public abstract class EthereumNetworkBase implements EthereumNetworkRepositoryTy put(ROPSTEN_ID, new NetworkInfo(C.ROPSTEN_NETWORK_NAME, C.ETH_SYMBOL, ROPSTEN_RPC_URL, "https://ropsten.etherscan.io/tx/", ROPSTEN_ID, - ROPSTEN_FALLBACK_RPC_URL, "https://api-ropsten.etherscan.io/api?")); + ROPSTEN_RPC_URL, "https://api-ropsten.etherscan.io/api?")); put(RINKEBY_ID, new NetworkInfo(C.RINKEBY_NETWORK_NAME, C.ETH_SYMBOL, RINKEBY_RPC_URL, "https://rinkeby.etherscan.io/tx/", RINKEBY_ID, - RINKEBY_FALLBACK_RPC_URL, "https://api-rinkeby.etherscan.io/api?")); + RINKEBY_RPC_URL, "https://api-rinkeby.etherscan.io/api?")); put(KOVAN_ID, new NetworkInfo(C.KOVAN_NETWORK_NAME, C.ETH_SYMBOL, KOVAN_RPC_URL, "https://kovan.etherscan.io/tx/", KOVAN_ID, - KOVAN_FALLBACK_RPC_URL, "https://api-kovan.etherscan.io/api?")); + KOVAN_RPC_URL, "https://api-kovan.etherscan.io/api?")); put(SOKOL_ID, new NetworkInfo(C.SOKOL_NETWORK_NAME, C.POA_SYMBOL, SOKOL_RPC_URL, "https://blockscout.com/poa/sokol/tx/", SOKOL_ID, diff --git a/app/src/main/java/com/alphawallet/app/service/TickerService.java b/app/src/main/java/com/alphawallet/app/service/TickerService.java index 098544e7b2..152db1d135 100644 --- a/app/src/main/java/com/alphawallet/app/service/TickerService.java +++ b/app/src/main/java/com/alphawallet/app/service/TickerService.java @@ -78,7 +78,7 @@ public class TickerService { - private static final int UPDATE_TICKER_CYCLE = 1; //5 Minutes + private static final int UPDATE_TICKER_CYCLE = 5; //5 Minutes private static final String MEDIANIZER = "0x729D19f657BD0614b4985Cf1D82531c67569197B"; private static final String MARKET_ORACLE_CONTRACT = "0xdAcAf435f241B1a062B021abEED9CA2F76F22F8D"; private static final String CONTRACT_ADDR = "[CONTRACT_ADDR]"; @@ -229,7 +229,7 @@ private Single updateTickersFromOracle(double conversionRate) return Single.fromCallable(() -> { int tickerSize = 0; final Web3j web3j = TokenRepository.getWeb3jService(POLYGON_TEST_ID); - //fetch current tickerscd + //fetch current tickers Function function = getTickers(); String responseValue = callSmartContractFunction(web3j, function, MARKET_ORACLE_CONTRACT); List responseValues = FunctionReturnDecoder.decode(responseValue, function.getOutputParameters()); diff --git a/build.gradle b/build.gradle index 9b76231eb6..c355f044db 100644 --- a/build.gradle +++ b/build.gradle @@ -25,7 +25,7 @@ buildscript { } allprojects { - apply from: rootProject.file("codestyle.gradle") + //apply from: rootProject.file("codestyle.gradle") repositories { google()