From 321c21abc98531c88d38723a5bf22ba3b2e74fdd Mon Sep 17 00:00:00 2001 From: amit-momin Date: Wed, 14 Aug 2024 16:02:49 -0500 Subject: [PATCH] Addressed feedback and fixed linting --- common/txmgr/confirmer.go | 2 +- core/chains/evm/client/errors_test.go | 4 ++-- core/chains/evm/txmgr/broadcaster_test.go | 4 ++-- core/chains/evm/txmgr/confirmer_test.go | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/common/txmgr/confirmer.go b/common/txmgr/confirmer.go index cf356609e96..e546ed18c33 100644 --- a/common/txmgr/confirmer.go +++ b/common/txmgr/confirmer.go @@ -1001,7 +1001,7 @@ func (ec *Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) han return ec.txStore.DeleteInProgressAttempt(ctx, attempt) case client.TerminallyStuck: // A transaction could broadcast successfully but then be considered terminally stuck on another attempt - // Even though the transaction can succeeed under different circumstances, we want to purge this transaction as soon as we get this error + // Even though the transaction can succeed under different circumstances, we want to purge this transaction as soon as we get this error lggr.Errorw("terminally stuck transaction detected", "err", sendError.Error()) ec.SvcErrBuffer.Append(sendError) // Create a purge attempt for tx diff --git a/core/chains/evm/client/errors_test.go b/core/chains/evm/client/errors_test.go index e4f2db77e91..32a1ba2bf32 100644 --- a/core/chains/evm/client/errors_test.go +++ b/core/chains/evm/client/errors_test.go @@ -290,7 +290,7 @@ func Test_Eth_Errors(t *testing.T) { }) t.Run("Metis gas price errors", func(t *testing.T) { - err := evmclient.NewSendErrorS("primary websocket (wss://ws-mainnet.metis.io) call failed: gas price too low: 18000000000 wei, use at least tx.gasPrice = 19500000000 wei") + err = evmclient.NewSendErrorS("primary websocket (wss://ws-mainnet.metis.io) call failed: gas price too low: 18000000000 wei, use at least tx.gasPrice = 19500000000 wei") assert.True(t, err.L2FeeTooLow(clientErrors)) err = newSendErrorWrapped("primary websocket (wss://ws-mainnet.metis.io) call failed: gas price too low: 18000000000 wei, use at least tx.gasPrice = 19500000000 wei") assert.True(t, err.L2FeeTooLow(clientErrors)) @@ -302,7 +302,7 @@ func Test_Eth_Errors(t *testing.T) { }) t.Run("moonriver errors", func(t *testing.T) { - err := evmclient.NewSendErrorS("primary http (http://***REDACTED***:9933) call failed: submit transaction to pool failed: Pool(Stale)") + err = evmclient.NewSendErrorS("primary http (http://***REDACTED***:9933) call failed: submit transaction to pool failed: Pool(Stale)") assert.True(t, err.IsNonceTooLowError(clientErrors)) assert.False(t, err.IsTransactionAlreadyInMempool(clientErrors)) assert.False(t, err.Fatal(clientErrors)) diff --git a/core/chains/evm/txmgr/broadcaster_test.go b/core/chains/evm/txmgr/broadcaster_test.go index 032751f74e5..c6c342973bb 100644 --- a/core/chains/evm/txmgr/broadcaster_test.go +++ b/core/chains/evm/txmgr/broadcaster_test.go @@ -529,11 +529,11 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_Success(t *testing.T) { return tx.Nonce() == uint64(346) && tx.Value().Cmp(big.NewInt(243)) == 0 }), fromAddress).Return(commonclient.Fatal, errors.New(terminallyStuckError)).Once() - // Do the thing + // Start processing unstarted transactions retryable, err := eb.ProcessUnstartedTxs(tests.Context(t), fromAddress) assert.NoError(t, err) assert.False(t, retryable) - + dbTx, err := txStore.FindTxWithAttempts(ctx, etx.ID) require.NoError(t, err) assert.Equal(t, txmgrcommon.TxFatalError, dbTx.State) diff --git a/core/chains/evm/txmgr/confirmer_test.go b/core/chains/evm/txmgr/confirmer_test.go index 72219fcc4f7..eaf79b6aba7 100644 --- a/core/chains/evm/txmgr/confirmer_test.go +++ b/core/chains/evm/txmgr/confirmer_test.go @@ -2713,7 +2713,7 @@ func TestEthConfirmer_RebroadcastWhereNecessary_TerminallyStuckError(t *testing. return tx.Nonce() == uint64(*etx.Sequence) }), fromAddress).Return(commonclient.Successful, nil).Once() - // Do the thing + // Start processing transactions for rebroadcast require.NoError(t, ec.RebroadcastWhereNecessary(tests.Context(t), currentHead)) var err error etx, err = txStore.FindTxWithAttempts(ctx, etx.ID)