Skip to content

Commit

Permalink
Fix beholder transmission (#15777)
Browse files Browse the repository at this point in the history
  • Loading branch information
dimriou authored Dec 19, 2024
1 parent 3370b4d commit 480a3e5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion core/chains/evm/txm/txm.go
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ func (t *Txm) sendTransactionWithError(ctx context.Context, tx *types.Transactio
}

t.metrics.IncrementNumBroadcastedTxs(ctx)
if bErr := t.metrics.EmitTxMessage(ctx, attempt.Hash, address, tx.ToAddress, *tx.Nonce); bErr != nil {
if bErr := t.metrics.EmitTxMessage(ctx, attempt.Hash, address, *attempt.SignedTransaction.To(), *tx.Nonce); bErr != nil {
t.lggr.Errorw("Beholder error emitting tx message", "err", bErr)
}
return t.txStore.UpdateTransactionBroadcast(ctx, attempt.TxID, *tx.Nonce, attempt.Hash, address)
Expand Down
11 changes: 8 additions & 3 deletions core/chains/evm/txm/txm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"time"

"github.com/ethereum/go-ethereum/common"
evmtypes "github.com/ethereum/go-ethereum/core/types"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -191,10 +192,14 @@ func TestBroadcastTransaction(t *testing.T) {
}
tx, err := txm.CreateTransaction(tests.Context(t), txRequest)
require.NoError(t, err)
legacyTx := evmtypes.LegacyTx{
To: &address,
}
attempt := &types.Attempt{
TxID: tx.ID,
Fee: gas.EvmFee{GasPrice: assets.NewWeiI(1)},
GasLimit: 22000,
TxID: tx.ID,
Fee: gas.EvmFee{GasPrice: assets.NewWeiI(1)},
GasLimit: 22000,
SignedTransaction: evmtypes.NewTx(&legacyTx),
}
ab.On("NewAttempt", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(attempt, nil).Once()
client.On("SendTransaction", mock.Anything, mock.Anything, mock.Anything).Return(nil).Once()
Expand Down

0 comments on commit 480a3e5

Please sign in to comment.