Skip to content

Commit

Permalink
Add NotReceived case handling in adaptTransactionStatus
Browse files Browse the repository at this point in the history
The NotReceived case in adaptTransactionStatus should return nil, nil instead
of falling through to default case. This allows the error to naturally propagate
from the original ErrTxnHashNotFound in TransactionStatus without logging
unnecessary errors for the common case of transactions not being found.
  • Loading branch information
wojciechos committed Dec 4, 2024
1 parent ec24744 commit 26132a1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rpc/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,8 @@ func adaptTransactionStatus(txStatus *starknet.TransactionStatus) (*TransactionS
status.Finality = TxnStatusAcceptedOnL2
case starknet.Received:
status.Finality = TxnStatusReceived
case starknet.NotReceived:
return nil, nil
default:
return nil, fmt.Errorf("unknown finality status: %v", finalityStatus)
}
Expand Down

0 comments on commit 26132a1

Please sign in to comment.