ethers-rs/ethers-etherscan/tests/it/transaction.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

66 lines
1.7 KiB
Rust
Raw Permalink Normal View History

ci/test: improve CI jobs and tests (#2189) * ci: move to scripts directory * nits * ci: improve main CI jobs * fix: install script * fix * fix: use curl for windows installation * fix: wasm typo * tests: move to single binary * chore: clippy * chore: clippy * chore: clippy * fix: test command * fix: quote tests * update script * fix: action exclude * fix: dev deps * fix: only run wasm in own job * ci: add aarch64 targets * test: rm useless test * ci: update security audit * ci: add deny CI * chore: rm unused audit.toml * chore: update geth.rs * ci: remove unusable targets * fix: install script path * fix: wasm * improve script * fix: failing ci * fix: contract tests * ci: improve install script * update middleware tests * move integration etherscan tests to tests/ dir * fix: eip2930 access_list field name * add pendingtransaction must_use * add random anvil comment * ci: add miri job * ci: simplify * fixci * Revert "add pendingtransaction must_use" This reverts commit 770b21b4a3c6ef8900a6aa1cd46aa9638317a60d. * fix: macos script * fix: use curl in script * unused ci * update script * fix wasm * rm_miri * fix: signer test * fix: wasm ci * fix: ipc test * fix: live celo tests * fix: abi online source test * fix: windows paths in test * chore: update serial_test * ci: run live tests separately * fix: provider tests * fix: unused var * fix: feature * fix merge * fix: etherscan key tests * ci: rm duplicate audit * fix: split etherscan test ci * fix: etherscan test * fix: generate multiple unused ports * fix: source test * fix: udeps * rm unused
2023-03-01 00:26:27 +00:00
use crate::*;
use serial_test::serial;
#[tokio::test]
#[serial]
async fn check_contract_execution_status_success() {
run_with_client(Chain::Mainnet, |client| async move {
let status = client
.check_contract_execution_status(
"0x16197e2a0eacc44c1ebdfddcfcfcafb3538de557c759a66e0ba95263b23d9007",
)
.await;
status.unwrap();
})
.await
}
#[tokio::test]
#[serial]
async fn check_contract_execution_status_error() {
run_with_client(Chain::Mainnet, |client| async move {
let err = client
.check_contract_execution_status(
"0x15f8e5ea1079d9a0bb04a4c58ae5fe7654b5b2b4463375ff7ffb490aa0032f3a",
)
.await
.unwrap_err();
assert!(matches!(err, EtherscanError::ExecutionFailed(_)));
assert_eq!(err.to_string(), "Contract execution call failed: Bad jump destination");
})
.await
}
#[tokio::test]
#[serial]
async fn check_transaction_receipt_status_success() {
run_with_client(Chain::Mainnet, |client| async move {
let success = client
.check_transaction_receipt_status(
"0x513c1ba0bebf66436b5fed86ab668452b7805593c05073eb2d51d3a52f480a76",
)
.await;
success.unwrap();
})
.await
}
#[tokio::test]
#[serial]
async fn check_transaction_receipt_status_failed() {
run_with_client(Chain::Mainnet, |client| async move {
let err = client
.check_transaction_receipt_status(
"0x21a29a497cb5d4bf514c0cca8d9235844bd0215c8fab8607217546a892fd0758",
)
.await
.unwrap_err();
assert!(matches!(err, EtherscanError::TransactionReceiptFailed));
})
.await
}