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

Commit b23d00e

Browse files
committed
rename unknown chain error
1 parent dcb20f7 commit b23d00e

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Diff for: ethers-etherscan/src/errors.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ use std::env::VarError;
33

44
#[derive(Debug, thiserror::Error)]
55
pub enum EtherscanError {
6-
#[error("unknown chain {0}")]
7-
UnknownChain(Chain),
6+
#[error("chain {0} not supported")]
7+
ChainNotSupported(Chain),
88
#[error("contract execution call failed: {0}")]
99
ExecutionFailed(String),
1010
#[error("tx receipt failed")]

Diff for: ethers-etherscan/src/lib.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ impl Client {
4242
Url::parse(&format!("https://{}.etherscan.io", chain_name)),
4343
)
4444
}
45-
chain => return Err(EtherscanError::UnknownChain(chain)),
45+
chain => return Err(EtherscanError::ChainNotSupported(chain)),
4646
};
4747

4848
Ok(Self {
@@ -155,10 +155,10 @@ mod tests {
155155
use ethers_core::types::Chain;
156156

157157
#[test]
158-
fn unknown_chain() {
158+
fn chain_not_supported() {
159159
let err = Client::new_from_env(Chain::XDai).unwrap_err();
160160

161-
assert!(matches!(err, EtherscanError::UnknownChain(_)));
162-
assert_eq!(err.to_string(), "unknown chain XDai");
161+
assert!(matches!(err, EtherscanError::ChainNotSupported(_)));
162+
assert_eq!(err.to_string(), "chain XDai not supported");
163163
}
164164
}

0 commit comments

Comments
 (0)