Skip to content

Commit

Permalink
feat: work around wrong error code from nodes
Browse files Browse the repository at this point in the history
Some nodes still serve error code `25` for non-existent tx hash. This
was previously gracefully handled by `starknet-rs` but not anymore.
This is not a Starkli bug but it might take a while for nodes to fix and
deploy, so adding this workaround in Starkli can be beneficial.
  • Loading branch information
xJonathanLEI committed Nov 1, 2023
1 parent 0b7cba2 commit 79059fb
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ where
})) => {
eprintln!("Transaction not confirmed yet...");
}
// Some nodes are still serving error code `25` for tx hash not found. This is
// technically a bug on the node's side, but we maximize compatibility here by also
// accepting it.
Err(ProviderError::StarknetError(StarknetErrorWithMessage {
code: MaybeUnknownErrorCode::Known(StarknetError::InvalidTransactionHash),
..
})) => {
eprintln!("Transaction not confirmed yet...");
}
Err(err) => return Err(err.into()),
}

Expand Down

0 comments on commit 79059fb

Please sign in to comment.