Skip to content

Commit

Permalink
fix: berachain chain information (#133)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpgonzalezra authored Jan 15, 2025
1 parent d55b99e commit 802918d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 30 deletions.
12 changes: 0 additions & 12 deletions assets/chains.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 4 additions & 18 deletions src/named.rs
Original file line number Diff line number Diff line change
Expand Up @@ -416,13 +416,6 @@ pub enum NamedChain {
)]
TreasureTopaz = 978658,

#[strum(to_string = "berachain-cartio", serialize = "berachain-cartio-testnet")]
#[cfg_attr(
feature = "serde",
serde(alias = "berachain-cartio-testnet", alias = "berachain-cartio")
)]
BerachainCartio = 80000,

#[strum(to_string = "berachain-bartio", serialize = "berachain-bartio-testnet")]
#[cfg_attr(
feature = "serde",
Expand Down Expand Up @@ -713,7 +706,7 @@ impl NamedChain {

UnichainSepolia => 1_000,

BerachainBartio | BerachainArtio | BerachainCartio => 2_000,
BerachainBartio | BerachainArtio => 2_000,

Morden | Ropsten | Rinkeby | Goerli | Kovan | Sepolia | Holesky | MantleTestnet
| Moonbase | MoonbeamDev | OptimismKovan | Poa | Sokol | Rsk | EmeraldTestnet
Expand Down Expand Up @@ -852,7 +845,6 @@ impl NamedChain {
| ApeChain
| BerachainBartio
| BerachainArtio
| BerachainCartio
| Curtis => false,

// Unknown / not applicable, default to false for backwards compatibility.
Expand Down Expand Up @@ -1026,8 +1018,7 @@ impl NamedChain {
| TreasureTopaz
| SonicTestnet
| BerachainBartio
| BerachainArtio
| BerachainCartio => true,
| BerachainArtio => true,

// Dev chains.
Dev | AnvilHardhat => true,
Expand Down Expand Up @@ -1101,7 +1092,7 @@ impl NamedChain {

Treasure | TreasureTopaz => "MAGIC",

BerachainBartio | BerachainArtio | BerachainCartio => "BERA",
BerachainBartio | BerachainArtio => "BERA",

_ => return None,
})
Expand Down Expand Up @@ -1465,9 +1456,6 @@ impl NamedChain {
),
BerachainBartio => ("https://bartio.beratrail.io/api", "https://bartio.beratrail.io"),
BerachainArtio => ("https://artio.beratrail.io/api", "https://artio.beratrail.io"),
BerachainCartio => {
("https://80000.testnet.routescan.io/api", "https://80000.testnet.routescan.io")
}
})
}

Expand Down Expand Up @@ -1602,8 +1590,7 @@ impl NamedChain {
| Treasure
| TreasureTopaz
| BerachainBartio
| BerachainArtio
| BerachainCartio => return None,
| BerachainArtio => return None,
};

Some(api_key_name)
Expand Down Expand Up @@ -1793,7 +1780,6 @@ mod tests {
(TreasureTopaz, &["treasure-topaz-testnet", "treasure-topaz"]),
(BerachainArtio, &["berachain-artio-testnet", "berachain-artio"]),
(BerachainBartio, &["berachain-bartio-testnet", "berachain-bartio"]),
(BerachainCartio, &["berachain-cartio-testnet", "berachain-cartio"]),
];

for &(chain, aliases) in ALIASES {
Expand Down

0 comments on commit 802918d

Please sign in to comment.