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

Commit

Permalink
Add support to Aurora network (#1535)
Browse files Browse the repository at this point in the history
* Add support to Aurora network

Documentation about aurora chain:
https://doc.aurora.dev/getting-started/network-endpoints

* Update changelog

* Format code using rustfmt.toml
  • Loading branch information
mfornet authored Jul 30, 2022
1 parent e855676 commit c7563a5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
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

0 comments on commit c7563a5

Please sign in to comment.