Skip to content

Commit

Permalink
chore(geometric txmgr): move code around to make it cleaner
Browse files Browse the repository at this point in the history
  • Loading branch information
samlaf committed Aug 7, 2024
1 parent b6040bb commit aaa697a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions chainio/txmgr/geometric/geometric.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,14 +181,14 @@ func (t *GeometricTxManager) processTransaction(ctx context.Context, req *txnReq
t.metrics.IncrementProcessingTxCount()
defer t.metrics.DecrementProcessingTxCount()

var txn *types.Transaction
var txID wallet.TxID
var err error
retryFromFailure := 0
from, err := t.wallet.SenderAddress(ctx)
if err != nil {
return nil, fmt.Errorf("failed to get sender address: %w", err)
}

var txn *types.Transaction
var txID wallet.TxID
retryFromFailure := 0
for retryFromFailure < t.params.MaxSendTransactionRetry {
gasTipCap, err := t.estimateGasTipCap(ctx)
if err != nil {
Expand Down Expand Up @@ -224,6 +224,7 @@ func (t *GeometricTxManager) processTransaction(ctx context.Context, req *txnReq
}
}

// is this case even possible? we return on errors above
if txn == nil || txID == "" {
return nil, fmt.Errorf("failed to send txn %s: %w", req.tx.Hash().Hex(), err)
}
Expand Down

0 comments on commit aaa697a

Please sign in to comment.