We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2a81c19 commit c2782acCopy full SHA for c2782ac
crates/block-explorers/src/lib.rs
@@ -581,4 +581,15 @@ mod tests {
581
let err = Client::new_from_env(Chain::dev()).unwrap_err();
582
assert!(matches!(err, EtherscanError::LocalNetworksNotSupported));
583
}
584
+
585
+ #[test]
586
+ fn can_parse_etherscan_mainnet_invalid_api_key() {
587
+ let err = serde_json::json!({
588
+ "status":"0",
589
+ "message":"NOTOK",
590
+ "result":"Missing/Invalid API Key"
591
+ });
592
+ let resp: ResponseData<Address> = serde_json::from_value(err).unwrap();
593
+ assert!(matches!(resp, ResponseData::Error { .. }));
594
+ }
595
0 commit comments