Skip to content

Commit

Permalink
fix(cli): ensure checkTx passes before waiting for inclusion (#1636)
Browse files Browse the repository at this point in the history
## Summary
Ensuring checkTx passes before waiting for inclusion
## Background
When using `submit_transaction_sync` method, cli should exit on
`checkTx` error code. Currently, cli first waits for inclusion which
will never happen as the transaction failed `checkTx`

## Related Issues
Link any issues that are related, prefer full github links.

closes #1635
  • Loading branch information
quasystaty1 authored Oct 9, 2024
1 parent bb6c435 commit 237d0c2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/astria-cli/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ pub(crate) async fn submit_transaction(
.await
.wrap_err("failed to submit transaction")?;

let tx_response = sequencer_client.wait_for_tx_inclusion(res.hash).await;

ensure!(res.code.is_ok(), "failed to check tx: {}", res.log);

let tx_response = sequencer_client.wait_for_tx_inclusion(res.hash).await;

ensure!(
tx_response.tx_result.code.is_ok(),
"failed to execute tx: {}",
Expand Down

0 comments on commit 237d0c2

Please sign in to comment.