diff --git a/ethers-etherscan/src/errors.rs b/ethers-etherscan/src/errors.rs index e9934c87db..59db88740f 100644 --- a/ethers-etherscan/src/errors.rs +++ b/ethers-etherscan/src/errors.rs @@ -3,8 +3,8 @@ use std::env::VarError; #[derive(Debug, thiserror::Error)] pub enum EtherscanError { - #[error("unknown chain {0}")] - UnknownChain(Chain), + #[error("chain {0} not supported")] + ChainNotSupported(Chain), #[error("contract execution call failed: {0}")] ExecutionFailed(String), #[error("tx receipt failed")] diff --git a/ethers-etherscan/src/lib.rs b/ethers-etherscan/src/lib.rs index 0b4fc0ec87..1256ae5b74 100644 --- a/ethers-etherscan/src/lib.rs +++ b/ethers-etherscan/src/lib.rs @@ -42,7 +42,7 @@ impl Client { Url::parse(&format!("https://{}.etherscan.io", chain_name)), ) } - chain => return Err(EtherscanError::UnknownChain(chain)), + chain => return Err(EtherscanError::ChainNotSupported(chain)), }; Ok(Self { @@ -155,10 +155,10 @@ mod tests { use ethers_core::types::Chain; #[test] - fn unknown_chain() { + fn chain_not_supported() { let err = Client::new_from_env(Chain::XDai).unwrap_err(); - assert!(matches!(err, EtherscanError::UnknownChain(_))); + assert!(matches!(err, EtherscanError::ChainNotSupported(_))); assert_eq!(err.to_string(), "unknown chain XDai"); } }