Skip to content

Commit 1be9849

Browse files
committed
Simplify PollForTransaction error handling and user transaction extraction
1 parent c1ab47d commit 1be9849

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)