Skip to content

Commit

Permalink
feat(etherscan): added Cronos testnet (gakonst#1276)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomtau authored May 17, 2022
1 parent 082f2c8 commit 991d538
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Unreleased

- Added Cronos testnet to etherscan options [1276](https://github.com/gakonst/ethers-rs/pull/1276)
- Fix parsing of a pending block
[1272](https://github.com/gakonst/ethers-rs/pull/1272)
- Removed Cronos mainnet beta from `is_legacy` [1246](https://github.com/gakonst/ethers-rs/pull/1246)
Expand Down
8 changes: 6 additions & 2 deletions ethers-etherscan/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,13 @@ impl Client {
Chain::BinanceSmartChainTestnet |
Chain::Arbitrum |
Chain::ArbitrumTestnet |
Chain::Cronos => std::env::var("ETHERSCAN_API_KEY")?,
Chain::Cronos |
Chain::CronosTestnet => std::env::var("ETHERSCAN_API_KEY")?,
Chain::Fantom | Chain::FantomTestnet => {
std::env::var("FTMSCAN_API_KEY").or_else(|_| std::env::var("FANTOMSCAN_API_KEY"))?
}

Chain::XDai | Chain::Sepolia | Chain::CronosTestnet => String::default(),
Chain::XDai | Chain::Sepolia => String::default(),
Chain::Moonbeam | Chain::MoonbeamDev | Chain::Moonriver => {
std::env::var("MOONSCAN_API_KEY")?
}
Expand Down Expand Up @@ -258,6 +259,9 @@ impl ClientBuilder {
urls("https://api-testnet.arbiscan.io/api", "https://testnet.arbiscan.io")
}
Chain::Cronos => urls("https://api.cronoscan.com/api", "https://cronoscan.com"),
Chain::CronosTestnet => {
urls("https://api-testnet.cronoscan.com/api", "https://testnet.cronoscan.com")
}
Chain::Moonbeam => {
urls("https://api-moonbeam.moonscan.io/api", "https://moonbeam.moonscan.io/")
}
Expand Down

0 comments on commit 991d538

Please sign in to comment.