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

Commit 901d0c6

Browse files
Add missing chains into parse method (#941)
* Add missing chains into parse method * Update changelog
1 parent 3effda2 commit 901d0c6

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

Diff for: CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
### Unreleased
66

7+
- Add FTM Mainet and testnet to parse method "try_from" from Chain.rs and add cronos mainet and testnet to "from_str"
78
- Add FTM mainnet and testnet Multicall addresses [927](https://github.com/gakonst/ethers-rs/pull/927)
89
- Add Cronos mainnet beta and testnet to the list of known chains
910
[926](https://github.com/gakonst/ethers-rs/pull/926)

Diff for: ethers-core/src/types/chain.rs

+6
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ impl TryFrom<u64> for Chain {
103103
42 => Chain::Kovan,
104104
100 => Chain::XDai,
105105
137 => Chain::Polygon,
106+
250 => Chain::Fantom,
107+
4002 => Chain::FantomTestnet,
106108
80001 => Chain::PolygonMumbai,
107109
43114 => Chain::Avalanche,
108110
43113 => Chain::AvalancheFuji,
@@ -116,6 +118,8 @@ impl TryFrom<u64> for Chain {
116118
97 => Chain::BinanceSmartChainTestnet,
117119
42161 => Chain::Arbitrum,
118120
421611 => Chain::ArbitrumTestnet,
121+
25 => Chain::Cronos,
122+
338 => Chain::CronosTestnet,
119123
_ => return Err(ParseChainError(chain.to_string())),
120124
})
121125
}
@@ -147,6 +151,8 @@ impl FromStr for Chain {
147151
"bsc-testnet" => Chain::BinanceSmartChainTestnet,
148152
"arbitrum" => Chain::Arbitrum,
149153
"arbitrum-testnet" => Chain::ArbitrumTestnet,
154+
"cronos" => Chain::Cronos,
155+
"cronos-testnet" => Chain::CronosTestnet,
150156
_ => return Err(ParseChainError(chain.to_owned())),
151157
})
152158
}

0 commit comments

Comments
 (0)