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

Add support to Aurora network #1535

Merged
merged 3 commits into from
Jul 30, 2022
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
- Add `From<H160>` and From<Vec<H160>> traits to `ValueOrArray<H160>` [#1199](https://github.com/gakonst/ethers-rs/pull/1200)
- Fix handling of Websocket connection errors [#1287](https://github.com/gakonst/ethers-rs/pull/1287)
- Add Arithmetic Shift Right operation for I256 [#1323](https://github.com/gakonst/ethers-rs/issues/1323)
- [#1535](https://github.com/gakonst/ethers-rs/pull/1535) Add support to Aurora and Aurora testnet networks.

## ethers-contract-abigen

Expand Down
8 changes: 8 additions & 0 deletions ethers-core/src/types/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ pub enum Chain {
EmeraldTestnet = 42261,
Evmos = 9001,
EvmosTestnet = 9000,
Aurora = 1313161554,
AuroraTestnet = 1313161555,
}

impl fmt::Display for Chain {
Expand Down Expand Up @@ -97,6 +99,8 @@ impl fmt::Display for Chain {
Chain::AnvilHardhat => "anvil-hardhat",
Chain::Evmos => "evmos",
Chain::EvmosTestnet => "evmos-testnet",
Chain::Aurora => "aurora",
Chain::AuroraTestnet => "aurora-testnet",
};

write!(formatter, "{}", chain)
Expand Down Expand Up @@ -162,6 +166,8 @@ impl TryFrom<u64> for Chain {
42261 => Chain::EmeraldTestnet,
9001 => Chain::Evmos,
9000 => Chain::EvmosTestnet,
1313161554 => Chain::Aurora,
1313161555 => Chain::AuroraTestnet,
_ => return Err(ParseChainError(chain.to_string())),
})
}
Expand Down Expand Up @@ -215,6 +221,8 @@ impl FromStr for Chain {
"oasis" => Chain::Oasis,
"emerald" => Chain::Emerald,
"emerald-testnet" => Chain::EmeraldTestnet,
"aurora" => Chain::Aurora,
"aurora-testnet" => Chain::AuroraTestnet,
_ => return Err(ParseChainError(chain.to_owned())),
})
}
Expand Down
4 changes: 3 additions & 1 deletion ethers-etherscan/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ impl Client {
Chain::Arbitrum |
Chain::ArbitrumTestnet |
Chain::Cronos |
Chain::CronosTestnet => std::env::var("ETHERSCAN_API_KEY")?,
Chain::CronosTestnet |
Chain::Aurora |
Chain::AuroraTestnet => std::env::var("ETHERSCAN_API_KEY")?,
Chain::Fantom | Chain::FantomTestnet => {
std::env::var("FTMSCAN_API_KEY").or_else(|_| std::env::var("FANTOMSCAN_API_KEY"))?
}
Expand Down