Skip to content

Commit

Permalink
core/chains/evm/txmgr: nil check errs before wrapping (#11412)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmank88 authored Nov 29, 2023
1 parent f771000 commit c36340c
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions core/chains/evm/txmgr/evm_tx_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,10 @@ func (o *evmTxStore) GetFatalTransactions(ctx context.Context) (txes []*Tx, err
txes = make([]*Tx, len(dbEtxs))
dbEthTxsToEvmEthTxPtrs(dbEtxs, txes)
err = o.LoadTxesAttempts(txes, pg.WithParentCtx(ctx), pg.WithQueryer(tx))
return fmt.Errorf("failed to load evm.tx_attempts: %w", err)
if err != nil {
return fmt.Errorf("failed to load evm.tx_attempts: %w", err)
}
return nil
}, pg.OptReadOnlyTx())

return txes, nil
Expand Down Expand Up @@ -1277,7 +1280,10 @@ func (o *evmTxStore) GetNonFatalTransactions(ctx context.Context, chainID *big.I
txes = make([]*Tx, len(dbEtxs))
dbEthTxsToEvmEthTxPtrs(dbEtxs, txes)
err = o.LoadTxesAttempts(txes, pg.WithParentCtx(ctx), pg.WithQueryer(tx))
return fmt.Errorf("failed to load evm.txes: %w", err)
if err != nil {
return fmt.Errorf("failed to load evm.txes: %w", err)
}
return nil
}, pg.OptReadOnlyTx())

return txes, nil
Expand All @@ -1302,7 +1308,10 @@ func (o *evmTxStore) GetTxByID(ctx context.Context, id int64) (txe *Tx, err erro
}
txe = txes[0]
err = o.LoadTxesAttempts(txes, pg.WithParentCtx(ctx), pg.WithQueryer(tx))
return fmt.Errorf("failed to load evm.tx_attempts: %w", err)
if err != nil {
return fmt.Errorf("failed to load evm.tx_attempts: %w", err)
}
return nil
}, pg.OptReadOnlyTx())

return txe, nil
Expand Down

0 comments on commit c36340c

Please sign in to comment.