diff --git a/pkg/solana/txm/pendingtx.go b/pkg/solana/txm/pendingtx.go index b39b6b0dc..33fd54677 100644 --- a/pkg/solana/txm/pendingtx.go +++ b/pkg/solana/txm/pendingtx.go @@ -605,11 +605,13 @@ func (c *pendingTxContext) OnReorg(sig solana.Signature) (pendingTx, error) { if !exists { return "", ErrSigDoesNotExist } - var broadcastedProcessedExists, confirmedExists bool - if tx, broadcastedProcessedExists := c.broadcastedProcessedTxs[info.id]; broadcastedProcessedExists { + + tx, broadcastedProcessedExists := c.broadcastedProcessedTxs[info.id] + if broadcastedProcessedExists { pTx = tx } - if tx, confirmedExists := c.confirmedTxs[info.id]; confirmedExists { + tx, confirmedExists := c.confirmedTxs[info.id] + if confirmedExists { pTx = tx } diff --git a/pkg/solana/txm/pendingtx_test.go b/pkg/solana/txm/pendingtx_test.go index 9fa3457e7..b10fe0b7b 100644 --- a/pkg/solana/txm/pendingtx_test.go +++ b/pkg/solana/txm/pendingtx_test.go @@ -41,9 +41,9 @@ func TestPendingTxContext_add_remove_multiple(t *testing.T) { sig, cancel := newProcess() msg := pendingTx{id: uuid.NewString()} err := txs.New(msg) - require.NoError(t, err) + assert.NoError(t, err) err = txs.AddSignature(cancel, msg.id, sig) - require.NoError(t, err) + assert.NoError(t, err) ids[sig] = msg.id } @@ -1024,6 +1024,7 @@ func TestPendingTxContext_expired(t *testing.T) { err := txs.New(msg) assert.NoError(t, err) err = txs.AddSignature(cancel, msg.id, sig) + assert.NoError(t, err) msg, exists := txs.broadcastedProcessedTxs[msg.id] require.True(t, exists)