Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Added linea testnet #2407

Merged
merged 2 commits into from
May 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion ethers-core/src/types/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ pub enum Chain {

BaseGoerli = 84531,

LineaTestnet = 59140,

#[strum(to_string = "zksync")]
#[serde(alias = "zksync")]
ZkSync = 324,
Expand Down Expand Up @@ -292,7 +294,7 @@ impl Chain {
Morden | Ropsten | Rinkeby | Goerli | Kovan | XDai | Chiado | Sepolia | Moonbase |
MoonbeamDev | Optimism | OptimismGoerli | OptimismKovan | Poa | Sokol | Rsk |
EmeraldTestnet | Boba | BaseGoerli | ZkSync | ZkSyncTestnet | PolygonZkEvm |
PolygonZkEvmTestnet | Metis => return None,
PolygonZkEvmTestnet | Metis | LineaTestnet => return None,
};

Some(Duration::from_millis(ms))
Expand Down Expand Up @@ -347,6 +349,7 @@ impl Chain {
Avalanche |
AvalancheFuji |
FilecoinMainnet |
LineaTestnet |
FilecoinHyperspaceTestnet => false,

// Unknown / not applicable, default to false for backwards compatibility
Expand Down Expand Up @@ -511,6 +514,9 @@ impl Chain {
"https://zksync2-testnet-explorer.zksync.dev/",
"https://goerli.explorer.zksync.io/",
),
LineaTestnet => {
("https://explorer.goerli.linea.build/api", "https://explorer.goerli.linea.build/")
}

AnvilHardhat | Dev | Morden | MoonbeamDev | FilecoinMainnet => {
// this is explicitly exhaustive so we don't forget to add new urls when adding a
Expand Down Expand Up @@ -591,6 +597,7 @@ impl Chain {
ZkSync |
ZkSyncTestnet |
FilecoinMainnet |
LineaTestnet |
FilecoinHyperspaceTestnet => return None,
};

Expand Down