Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -391,14 +391,6 @@ impl Client {
self.create_query("contract", "getsourcecode", HashMap::from([("address", address)]));
let response = self.get(&query).await?;

// Source code is not verified
if response.contains("Contract source code not verified") {
if let Some(ref cache) = self.cache {
cache.set_source(address, None);
}
return Err(EtherscanError::ContractCodeNotVerified(address));
}

let response: Response<ContractMetadata> = self.sanitize_response(response)?;
let result = response.result;

Expand Down
12 changes: 0 additions & 12 deletions tests/it/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,6 @@ async fn can_fetch_contract_source_code() {
.await
}

#[tokio::test]
#[serial]
async fn can_get_error_on_unverified_contract() {
init_tracing();
run_with_client(Chain::mainnet(), |client| async move {
let addr = "0xb5c31a0e22cae98ac08233e512bd627885aa24e5".parse().unwrap();
let err = client.contract_source_code(addr).await.unwrap_err();
assert!(matches!(err, EtherscanError::ContractCodeNotVerified(_)));
})
.await
}

/// Query a contract that has a single string source entry instead of underlying JSON metadata.
#[tokio::test]
#[serial]
Expand Down