Skip to content

Commit

Permalink
Remove old optimistic and arbitrum testnets (#2991)
Browse files Browse the repository at this point in the history
  • Loading branch information
justindg authored Dec 6, 2022
1 parent 403c798 commit 81972c6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 42 deletions.
3 changes: 0 additions & 3 deletions app/src/main/java/com/alphawallet/app/C.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,8 @@ public abstract class C {
public static final String POLYGON_NETWORK = "Polygon";
public static final String POLYGON_TEST_NETWORK = "Mumbai (Test)";
public static final String OPTIMISTIC_NETWORK = "Optimistic";
public static final String OPTIMISTIC_TEST_NETWORK = "Optimistic (Test)";
public static final String CRONOS_MAIN_NETWORK = "Cronos";
public static final String CRONOS_TEST_NETWORK = "Cronos (Test)";
public static final String ARBITRUM_TEST_NETWORK = "Arbitrum (Test)";
public static final String ARBITRUM_ONE_NETWORK = "Arbitrum One";
public static final String PALM_NAME = "PALM";
public static final String PALM_TEST_NAME = "PALM (Test)";
Expand Down Expand Up @@ -82,7 +80,6 @@ public abstract class C {
public static final String CRONOS_SYMBOL = "CRO";
public static final String CRONOS_TEST_SYMBOL = "tCRO";
public static final String ARBITRUM_SYMBOL = "AETH";
public static final String ARBITRUM_TEST_SYMBOL = "ARETH";
public static final String PALM_SYMBOL = "PALM";
public static final String KLAYTN_SYMBOL = "KLAY";
public static final String IOTEX_SYMBOL = "IOTX";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import static com.alphawallet.ethereum.EthereumNetworkBase.ARBITRUM_GOERLI_TESTNET_FALLBACK_RPC_URL;
import static com.alphawallet.ethereum.EthereumNetworkBase.ARBITRUM_GOERLI_TEST_ID;
import static com.alphawallet.ethereum.EthereumNetworkBase.ARBITRUM_MAIN_ID;
import static com.alphawallet.ethereum.EthereumNetworkBase.ARBITRUM_TEST_ID;
import static com.alphawallet.ethereum.EthereumNetworkBase.ARTIS_SIGMA1_ID;
import static com.alphawallet.ethereum.EthereumNetworkBase.ARTIS_TAU1_ID;
import static com.alphawallet.ethereum.EthereumNetworkBase.AURORA_MAINNET_ID;
Expand Down Expand Up @@ -50,8 +49,6 @@
import static com.alphawallet.ethereum.EthereumNetworkBase.OPTIMISM_GOERLI_TEST_ID;
import static com.alphawallet.ethereum.EthereumNetworkBase.OPTIMISTIC_MAIN_FALLBACK_URL;
import static com.alphawallet.ethereum.EthereumNetworkBase.OPTIMISTIC_MAIN_ID;
import static com.alphawallet.ethereum.EthereumNetworkBase.OPTIMISTIC_TEST_FALLBACK_URL;
import static com.alphawallet.ethereum.EthereumNetworkBase.OPTIMISTIC_TEST_ID;
import static com.alphawallet.ethereum.EthereumNetworkBase.PALM_ID;
import static com.alphawallet.ethereum.EthereumNetworkBase.PALM_TEST_ID;
import static com.alphawallet.ethereum.EthereumNetworkBase.POA_ID;
Expand Down Expand Up @@ -117,7 +114,6 @@ public abstract class EthereumNetworkBase implements EthereumNetworkRepositoryTy
public static final String FREE_ARBITRUM_RPC_URL = "https://arbitrum.public-rpc.com";
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_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";
Expand Down Expand Up @@ -151,12 +147,6 @@ public abstract class EthereumNetworkBase implements EthereumNetworkRepositoryTy
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 ARBITRUM_TESTNET_RPC = FREE_ARBITRUM_TEST_RPC_URL;

//These Networks are no longer running
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.
Expand Down Expand Up @@ -189,12 +179,11 @@ public abstract class EthereumNetworkBase implements EthereumNetworkRepositoryTy
private static final List<Long> testnetList = new ArrayList<>(Arrays.asList(
GOERLI_ID, BINANCE_TEST_ID, HECO_TEST_ID, CRONOS_TEST_ID, OPTIMISM_GOERLI_TEST_ID, ARBITRUM_GOERLI_TEST_ID, KLAYTN_BAOBAB_ID,
FANTOM_TEST_ID, IOTEX_TESTNET_ID, FUJI_TEST_ID, POLYGON_TEST_ID, MILKOMEDA_C1_TEST_ID, ARTIS_TAU1_ID,
SEPOLIA_TESTNET_ID, AURORA_TESTNET_ID, PALM_TEST_ID,
//Deprecated networks
OPTIMISTIC_TEST_ID, ARBITRUM_TEST_ID));
SEPOLIA_TESTNET_ID, AURORA_TESTNET_ID, PALM_TEST_ID));

private static final List<Long> deprecatedNetworkList = new ArrayList<>(Arrays.asList(
OPTIMISTIC_TEST_ID, ARBITRUM_TEST_ID));
// Add deprecated testnet IDs here
));

// for reset built-in network
private static final LongSparseArray<NetworkInfo> builtinNetworkMap = new LongSparseArray<NetworkInfo>()
Expand Down Expand Up @@ -334,15 +323,7 @@ public abstract class EthereumNetworkBase implements EthereumNetworkRepositoryTy
"https://goerli-rollup-explorer.arbitrum.io/tx/", ARBITRUM_GOERLI_TEST_ID, ARBITRUM_GOERLI_TESTNET_FALLBACK_RPC_URL,
"https://goerli-rollup-explorer.arbitrum.io/api?"));

// Deprecated Networks
put(OPTIMISTIC_TEST_ID, new NetworkInfo(C.OPTIMISTIC_TEST_NETWORK, C.ETH_SYMBOL,
OPTIMISTIC_TEST_URL,
"https://kovan-optimistic.etherscan.io/tx/", OPTIMISTIC_TEST_ID, OPTIMISTIC_TEST_FALLBACK_URL,
"https://api-kovan-optimistic.etherscan.io/api?"));
put(ARBITRUM_TEST_ID, new NetworkInfo(C.ARBITRUM_TEST_NETWORK, C.ARBITRUM_TEST_SYMBOL,
ARBITRUM_TESTNET_RPC,
"https://testnet.arbiscan.io/tx/", ARBITRUM_TEST_ID, ARBITRUM_FALLBACK_TESTNET_RPC,
"https://testnet.arbiscan.io/api?")); //no transaction API
// Add deprecated networks after this line
}
};

Expand Down Expand Up @@ -371,11 +352,9 @@ public abstract class EthereumNetworkBase implements EthereumNetworkRepositoryTy
put(POLYGON_ID, R.drawable.ic_icons_polygon);
put(POLYGON_TEST_ID, R.drawable.ic_icons_tokens_mumbai);
put(OPTIMISTIC_MAIN_ID, R.drawable.ic_optimism_logo);
put(OPTIMISTIC_TEST_ID, R.drawable.ic_optimism_testnet_logo);
put(CRONOS_MAIN_ID, R.drawable.ic_cronos_mainnet);
put(CRONOS_TEST_ID, R.drawable.ic_cronos);
put(ARBITRUM_MAIN_ID, R.drawable.ic_icons_arbitrum);
put(ARBITRUM_TEST_ID, R.drawable.ic_icons_arbitrum_test);
put(PALM_ID, R.drawable.ic_icons_network_palm);
put(PALM_TEST_ID, R.drawable.palm_logo_test);
put(KLAYTN_ID, R.drawable.ic_klaytn_network_logo);
Expand Down Expand Up @@ -413,11 +392,9 @@ public abstract class EthereumNetworkBase implements EthereumNetworkRepositoryTy
put(POLYGON_ID, R.drawable.ic_icons_network_polygon);
put(POLYGON_TEST_ID, R.drawable.ic_icons_tokens_mumbai);
put(OPTIMISTIC_MAIN_ID, R.drawable.ic_icons_network_optimism);
put(OPTIMISTIC_TEST_ID, R.drawable.ic_optimism_testnet_logo);
put(CRONOS_MAIN_ID, R.drawable.ic_cronos_mainnet);
put(CRONOS_TEST_ID, R.drawable.ic_cronos);
put(ARBITRUM_MAIN_ID, R.drawable.ic_icons_network_arbitrum);
put(ARBITRUM_TEST_ID, R.drawable.ic_icons_arbitrum_test);
put(PALM_ID, R.drawable.ic_icons_network_palm);
put(PALM_TEST_ID, R.drawable.palm_logo_test);
put(KLAYTN_ID, R.drawable.ic_klaytn_network_logo);
Expand Down Expand Up @@ -455,11 +432,9 @@ public abstract class EthereumNetworkBase implements EthereumNetworkRepositoryTy
put(POLYGON_ID, R.color.polygon_main);
put(POLYGON_TEST_ID, R.color.polygon_test);
put(OPTIMISTIC_MAIN_ID, R.color.optimistic_main);
put(OPTIMISTIC_TEST_ID, R.color.optimistic_test);
put(CRONOS_MAIN_ID, R.color.cronos_main);
put(CRONOS_TEST_ID, R.color.cronos_test);
put(ARBITRUM_MAIN_ID, R.color.arbitrum_main);
put(ARBITRUM_TEST_ID, R.color.arbitrum_test);
put(PALM_ID, R.color.palm_main);
put(PALM_TEST_ID, R.color.palm_test);
put(KLAYTN_ID, R.color.klaytn_main);
Expand All @@ -483,7 +458,7 @@ public abstract class EthereumNetworkBase implements EthereumNetworkRepositoryTy
private static final List<Long> hasGasOracleAPI = Arrays.asList(MAINNET_ID, HECO_ID, BINANCE_MAIN_ID, POLYGON_ID);

//These chains don't allow custom gas
private static final List<Long> hasLockedGas = Arrays.asList(OPTIMISTIC_MAIN_ID, OPTIMISTIC_TEST_ID, ARBITRUM_MAIN_ID, ARBITRUM_TEST_ID, KLAYTN_ID, KLAYTN_BAOBAB_ID);
private static final List<Long> hasLockedGas = Arrays.asList(OPTIMISTIC_MAIN_ID, ARBITRUM_MAIN_ID, KLAYTN_ID, KLAYTN_BAOBAB_ID);

private static final List<Long> hasOpenSeaAPI = Arrays.asList(MAINNET_ID, POLYGON_ID);

Expand Down Expand Up @@ -579,7 +554,6 @@ public boolean hasLockedGas(long chainId)
{
{
put(OPTIMISTIC_MAIN_ID, "0x4200000000000000000000000000000000000006");
put(OPTIMISTIC_TEST_ID, "0x4200000000000000000000000000000000000006");
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,9 @@ public abstract class EthereumNetworkBase
public static final long POLYGON_ID = 137;
public static final long POLYGON_TEST_ID = 80001;
public static final long OPTIMISTIC_MAIN_ID = 10;
public static final long OPTIMISTIC_TEST_ID = 69;
public static final long CRONOS_MAIN_ID = 25;
public static final long CRONOS_TEST_ID = 338;
public static final long ARBITRUM_MAIN_ID = 42161;
public static final long ARBITRUM_TEST_ID = 421611;
public static final long PALM_ID = 0x2a15c308dL; //11297108109
public static final long PALM_TEST_ID = 0x2a15c3083L; //11297108099
public static final long KLAYTN_ID = 8217;
Expand Down Expand Up @@ -65,11 +63,9 @@ public abstract class EthereumNetworkBase
public static final String MATIC_RPC_URL = "https://matic-mainnet.chainstacklabs.com";
public static final String MUMBAI_TEST_RPC_URL = "https://matic-mumbai.chainstacklabs.com";
public static final String OPTIMISTIC_MAIN_FALLBACK_URL = "https://mainnet.optimism.io";
public static final String OPTIMISTIC_TEST_FALLBACK_URL = "https://kovan.optimism.io";
public static final String CRONOS_MAIN_RPC_URL = "https://evm.cronos.org";
public static final String CRONOS_TEST_URL = "https://evm-t3.cronos.org";
public static final String ARBITRUM_RPC_URL = "https://arbitrum-mainnet.infura.io/v3/da3717f25f824cc1baa32d812386d93f";
public static final String ARBITRUM_TEST_RPC_URL = "https://arbitrum-rinkeby.infura.io/v3/da3717f25f824cc1baa32d812386d93f";
public static final String PALM_RPC_URL = "https://palm-mainnet.infura.io/v3/da3717f25f824cc1baa32d812386d93f";
public static final String PALM_TEST_RPC_URL = "https://palm-testnet.infura.io/v3/da3717f25f824cc1baa32d812386d93f";
public static final String KLAYTN_RPC = "https://public-node-api.klaytnapi.com/v1/cypress";
Expand Down Expand Up @@ -127,14 +123,10 @@ public abstract class EthereumNetworkBase

put(OPTIMISTIC_MAIN_ID, new NetworkInfo("Optimistic", "ETH", OPTIMISTIC_MAIN_FALLBACK_URL, "https://optimistic.etherscan.io/tx/",
OPTIMISTIC_MAIN_ID, false));
put(OPTIMISTIC_TEST_ID, new NetworkInfo("Optimistic (Test)", "ETH", OPTIMISTIC_TEST_FALLBACK_URL, "https://kovan-optimistic.etherscan.io/tx/",
OPTIMISTIC_TEST_ID, false));
put(CRONOS_MAIN_ID, new NetworkInfo("Cronos (Beta)", "CRO", CRONOS_MAIN_RPC_URL, "https://cronoscan.com/tx", CRONOS_MAIN_ID, false));
put(CRONOS_TEST_ID, new NetworkInfo("Cronos (Test)", "tCRO", CRONOS_TEST_URL, "https://testnet.cronoscan.com/tx/", CRONOS_TEST_ID, false));
put(ARBITRUM_MAIN_ID, new NetworkInfo("Arbitrum One", "AETH", ARBITRUM_RPC_URL, "https://arbiscan.io/tx/",
ARBITRUM_MAIN_ID, false));
put(ARBITRUM_TEST_ID, new NetworkInfo("Arbitrum Test", "ARETH", ARBITRUM_TEST_RPC_URL, "https://rinkeby-explorer.arbitrum.io/tx/",
ARBITRUM_TEST_ID, false));

put(PALM_ID, new NetworkInfo("PALM", "PALM", PALM_RPC_URL, "https://explorer.palm.io/tx/",
PALM_ID, false));
Expand Down

0 comments on commit 81972c6

Please sign in to comment.