Skip to content

Commit

Permalink
Add negative test
Browse files Browse the repository at this point in the history
  • Loading branch information
klkvr committed Jan 1, 2024
1 parent 8f00e40 commit cebf017
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/it/contract.rs
Original file line number Diff line number Diff line change
@@ -148,3 +148,15 @@ async fn can_fetch_contract_creation_data() {
})
.await
}

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

0 comments on commit cebf017

Please sign in to comment.