Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit f4537bb

Browse files
ice-coldbellgregnazario
authored andcommittedMar 17, 2025·
Simplify PollForTransaction error handling and user transaction extraction
1 parent 4d4937d commit f4537bb

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed
 

‎nodeClient.go

+1-4
Original file line numberDiff line numberDiff line change
@@ -330,10 +330,7 @@ func getTransactionPollOptions(defaultPeriod, defaultTimeout time.Duration, opti
330330
func (rc *NodeClient) PollForTransaction(hash string, options ...any) (*api.UserTransaction, error) {
331331
// Wait for the transaction to be done
332332
txn, err := rc.WaitTransactionByHash(hash)
333-
if err != nil {
334-
return nil, err
335-
}
336-
if txn.Type == api.TransactionVariantUser {
333+
if err == nil && txn.Type == api.TransactionVariantUser {
337334
return txn.UserTransaction()
338335
}
339336

0 commit comments

Comments
 (0)
Please sign in to comment.