Skip to content

Commit

Permalink
Add PendingSequenceAt to fix txm test case (#11416)
Browse files Browse the repository at this point in the history
* Add PendingSequenceAt nonce

* Fix return values
  • Loading branch information
dimriou authored Nov 29, 2023
1 parent 8005416 commit b8199c5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions core/chains/evm/txmgr/txmgr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -519,8 +519,8 @@ func TestTxm_Reset(t *testing.T) {
cfg := evmtest.NewChainScopedConfig(t, gcfg)
kst := cltest.NewKeyStore(t, db, cfg.Database())

_, addr := cltest.RandomKey{Nonce: 5}.MustInsert(t, kst.Eth())
_, addr2 := cltest.RandomKey{Nonce: 3}.MustInsert(t, kst.Eth())
_, addr := cltest.RandomKey{}.MustInsert(t, kst.Eth())
_, addr2 := cltest.RandomKey{}.MustInsert(t, kst.Eth())
txStore := cltest.NewTestTxStore(t, db, cfg.Database())
// 4 confirmed tx from addr1
for i := int64(0); i < 4; i++ {
Expand All @@ -534,6 +534,8 @@ func TestTxm_Reset(t *testing.T) {
ethClient := evmtest.NewEthClientMockWithDefaultChain(t)
ethClient.On("HeadByNumber", mock.Anything, (*big.Int)(nil)).Return(nil, nil)
ethClient.On("BatchCallContextAll", mock.Anything, mock.Anything).Return(nil).Maybe()
ethClient.On("PendingSequenceAt", mock.Anything, addr).Return(128, nil).Maybe()
ethClient.On("PendingSequenceAt", mock.Anything, addr2).Return(44, nil).Maybe()

estimator := gas.NewEstimator(logger.Test(t), ethClient, cfg.EVM(), cfg.EVM().GasEstimator())
txm, err := makeTestEvmTxm(t, db, ethClient, estimator, cfg.EVM(), cfg.EVM().GasEstimator(), cfg.EVM().Transactions(), cfg.Database(), cfg.Database().Listener(), kst.Eth())
Expand Down

0 comments on commit b8199c5

Please sign in to comment.