Skip to content

Commit f4b4100

Browse files
committed
watcher: pick up the other testnet chains.
1 parent 1a4b55f commit f4b4100

File tree

4 files changed

+27
-4
lines changed

4 files changed

+27
-4
lines changed

watcher/src/consts.ts

+4
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ export const RPCS_BY_CHAIN: { [key in Environment]: { [key in ChainName]?: strin
8080
base: process.env.BASE_RPC,
8181
sei: process.env.SEI_RPC,
8282
wormchain: process.env.WORMCHAIN_RPC,
83+
arbitrum_sepolia: process.env.ARBITRUM_SEPOLIA_RPC,
84+
base_sepolia: process.env.BASE_SEPOLIA_RPC,
85+
optimism_sepolia: process.env.OPTIMISM_SEPOLIA_RPC,
86+
holesky: process.env.HOLESKY_RPC,
8387
sepolia: process.env.SEPOLIA_RPC,
8488
},
8589
['devnet']: {},

watcher/src/index.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const supportedChains: ChainName[] =
1818
// NOTE: The commented out chains are left in there to easily
1919
// identify which chains are not supported on testnet.
2020
'solana',
21-
'ethereum',
21+
// 'ethereum',
2222
// 'terra',
2323
'bsc',
2424
'polygon',
@@ -43,6 +43,10 @@ const supportedChains: ChainName[] =
4343
'sei',
4444
// 'wormchain',
4545
'sepolia',
46+
'arbitrum_sepolia',
47+
'base_sepolia',
48+
'optimism_sepolia',
49+
'holesky',
4650
]
4751
: [
4852
// This is the list of chains supported in MAINNET.

watcher/src/watchers/ArbitrumWatcher.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ export class ArbitrumWatcher extends EVMWatcher {
1111
lastEthTime: number;
1212

1313
constructor(network: Environment) {
14-
super(network, 'arbitrum');
14+
if (network === 'mainnet') {
15+
super(network, 'arbitrum');
16+
} else {
17+
super(network, 'arbitrum_sepolia');
18+
}
1519

1620
this.rpc = RPCS_BY_CHAIN[this.network][this.chain];
1721
if (!this.rpc) {

watcher/src/watchers/utils.ts

+13-2
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,19 @@ export function makeFinalizedWatcher(network: Environment, chainName: ChainName)
5656
return new SuiWatcher(network);
5757
} else if (chainName === 'wormchain') {
5858
return new WormchainWatcher(network);
59-
} else if (chainName === 'sepolia' && network === 'testnet') {
60-
return new EVMWatcher(network, chainName, 'finalized');
59+
} else if (network === 'testnet') {
60+
// These are testnet only chains
61+
if (chainName === 'sepolia' || chainName === 'holesky') {
62+
return new EVMWatcher(network, chainName, 'finalized');
63+
} else if (chainName === 'arbitrum_sepolia') {
64+
return new ArbitrumWatcher(network);
65+
} else if (chainName === 'optimism_sepolia' || chainName === 'base_sepolia') {
66+
return new EVMWatcher(network, chainName);
67+
} else {
68+
throw new Error(
69+
`Attempted to create finalized watcher for unsupported testnet chain ${chainName}`
70+
);
71+
}
6172
} else {
6273
throw new Error(`Attempted to create finalized watcher for unsupported chain ${chainName}`);
6374
}

0 commit comments

Comments
 (0)