From 1ce23108747058d9ce8d2cba7407778f33d10bc7 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Wed, 22 Jun 2022 19:09:05 +0200 Subject: [PATCH] feat: add evmos support (#1398) --- ethers-core/src/types/chain.rs | 4 ++++ ethers-etherscan/src/lib.rs | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ethers-core/src/types/chain.rs b/ethers-core/src/types/chain.rs index 103eacc0..b80bb502 100644 --- a/ethers-core/src/types/chain.rs +++ b/ethers-core/src/types/chain.rs @@ -53,6 +53,8 @@ pub enum Chain { Oasis = 26863, Emerald = 42262, EmeraldTestnet = 42261, + Evmos = 9001, + EvmosTestnet = 9000, } impl fmt::Display for Chain { @@ -91,6 +93,8 @@ impl fmt::Display for Chain { Chain::Emerald => "emerald", Chain::EmeraldTestnet => "emerald-testnet", Chain::AnvilHardhat => "anvil-hardhat", + Chain::Evmos => "evmos", + Chain::EvmosTestnet => "evmos-testnet", }; write!(formatter, "{}", chain) diff --git a/ethers-etherscan/src/lib.rs b/ethers-etherscan/src/lib.rs index c6005c64..472b1e91 100644 --- a/ethers-etherscan/src/lib.rs +++ b/ethers-etherscan/src/lib.rs @@ -101,7 +101,9 @@ impl Client { Chain::Poa | Chain::Oasis | Chain::Emerald | - Chain::EmeraldTestnet => String::default(), + Chain::EmeraldTestnet | + Chain::Evmos | + Chain::EvmosTestnet => String::default(), Chain::Moonbeam | Chain::Moonbase | Chain::MoonbeamDev | Chain::Moonriver => { std::env::var("MOONSCAN_API_KEY")? } @@ -302,6 +304,8 @@ impl ClientBuilder { Chain::AnvilHardhat | Chain::Dev => { return Err(EtherscanError::LocalNetworksNotSupported) } + Chain::Evmos => urls("https://evm.evmos.org/api", "https://evm.evmos.org/"), + Chain::EvmosTestnet => urls("https://evm.evmos.dev/api", "https://evm.evmos.dev/"), chain => return Err(EtherscanError::ChainNotSupported(chain)), }; self.with_api_url(etherscan_api_url?)?.with_url(etherscan_url?)