Add missing chains into parse method (#941)

* Add missing chains into parse method

* Update changelog
This commit is contained in:
Alexandre Bazeaud 2022-02-21 18:01:19 +01:00 committed by GitHub
parent 3effda2804
commit 901d0c6e00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View File

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

View File

@ -103,6 +103,8 @@ impl TryFrom<u64> for Chain {
42 => Chain::Kovan, 42 => Chain::Kovan,
100 => Chain::XDai, 100 => Chain::XDai,
137 => Chain::Polygon, 137 => Chain::Polygon,
250 => Chain::Fantom,
4002 => Chain::FantomTestnet,
80001 => Chain::PolygonMumbai, 80001 => Chain::PolygonMumbai,
43114 => Chain::Avalanche, 43114 => Chain::Avalanche,
43113 => Chain::AvalancheFuji, 43113 => Chain::AvalancheFuji,
@ -116,6 +118,8 @@ impl TryFrom<u64> for Chain {
97 => Chain::BinanceSmartChainTestnet, 97 => Chain::BinanceSmartChainTestnet,
42161 => Chain::Arbitrum, 42161 => Chain::Arbitrum,
421611 => Chain::ArbitrumTestnet, 421611 => Chain::ArbitrumTestnet,
25 => Chain::Cronos,
338 => Chain::CronosTestnet,
_ => return Err(ParseChainError(chain.to_string())), _ => return Err(ParseChainError(chain.to_string())),
}) })
} }
@ -147,6 +151,8 @@ impl FromStr for Chain {
"bsc-testnet" => Chain::BinanceSmartChainTestnet, "bsc-testnet" => Chain::BinanceSmartChainTestnet,
"arbitrum" => Chain::Arbitrum, "arbitrum" => Chain::Arbitrum,
"arbitrum-testnet" => Chain::ArbitrumTestnet, "arbitrum-testnet" => Chain::ArbitrumTestnet,
"cronos" => Chain::Cronos,
"cronos-testnet" => Chain::CronosTestnet,
_ => return Err(ParseChainError(chain.to_owned())), _ => return Err(ParseChainError(chain.to_owned())),
}) })
} }