Skip to content

Commit 4ac6b91

Browse files
authored
Minor. (#17630)
1 parent 0538438 commit 4ac6b91

10 files changed

+153
-255
lines changed

core/chains/evm/txmgr/broadcaster_test.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -775,9 +775,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_ResumingFromCrash(t *testing.T) {
775775
t.Run("cannot be more than one transaction per address in an unfinished state", func(t *testing.T) {
776776
db := testutils.NewSqlxDB(t)
777777
txStore := cltest.NewTestTxStore(t, db)
778-
779-
ethKeyStore := cltest.NewKeyStore(t, db).Eth()
780-
_, fromAddress := cltest.RandomKey{Nonce: nextNonce.Int64()}.MustInsertWithState(t, ethKeyStore)
778+
fromAddress := testutils.NewAddress()
781779

782780
firstInProgress := txmgr.Tx{
783781
FromAddress: fromAddress,

core/chains/evm/txmgr/confirmer_test.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -719,8 +719,7 @@ func TestEthConfirmer_RebroadcastWhereNecessary_WithConnectivityCheck(t *testing
719719

720720
ctx := t.Context()
721721
txStore := cltest.NewTestTxStore(t, db)
722-
ethKeyStore := cltest.NewKeyStore(t, db).Eth()
723-
_, fromAddress := cltest.MustInsertRandomKeyReturningState(t, ethKeyStore)
722+
fromAddress := testutils.NewAddress()
724723

725724
estimator := gasmocks.NewEvmEstimator(t)
726725
newEst := func(logger.Logger) gas.EvmEstimator { return estimator }
@@ -766,8 +765,7 @@ func TestEthConfirmer_RebroadcastWhereNecessary_WithConnectivityCheck(t *testing
766765

767766
ctx := t.Context()
768767
txStore := cltest.NewTestTxStore(t, db)
769-
ethKeyStore := cltest.NewKeyStore(t, db).Eth()
770-
_, fromAddress := cltest.MustInsertRandomKeyReturningState(t, ethKeyStore)
768+
fromAddress := testutils.NewAddress()
771769

772770
estimator := gasmocks.NewEvmEstimator(t)
773771
estimator.On("BumpDynamicFee", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(gas.DynamicFee{}, pkgerrors.Wrapf(fees.ErrConnectivity, "transaction..."))
@@ -813,14 +811,12 @@ func TestEthConfirmer_RebroadcastWhereNecessary_MaxFeeScenario(t *testing.T) {
813811
ctx := t.Context()
814812

815813
ethClient := clienttest.NewClientWithDefaultChainID(t)
816-
ethKeyStore := cltest.NewKeyStore(t, db).Eth()
817814

818815
evmcfg := configtest.NewChainScopedConfig(t, func(c *toml.EVMConfig) {
819816
c.GasEstimator.PriceMax = assets.GWei(500)
820817
})
821818

822-
_, _ = cltest.MustInsertRandomKeyReturningState(t, ethKeyStore)
823-
_, fromAddress := cltest.MustInsertRandomKeyReturningState(t, ethKeyStore)
819+
fromAddress := testutils.NewAddress()
824820

825821
kst := &keystest.FakeChainStore{Addresses: keystest.Addresses{fromAddress}}
826822
// Use a mock keystore for this test

core/chains/evm/txmgr/evm_tx_store_benchmark_test.go

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ func BenchmarkTxStoreCreateTransaction(b *testing.B) {
3939
b.Run(bs.name, func(b *testing.B) {
4040
db := testutils.NewSqlxDB(b)
4141
txStore := newTxStore(b, db)
42-
kst := cltest.NewKeyStore(b, db)
43-
_, fromAddress := cltest.MustInsertRandomKey(b, kst.Eth())
42+
fromAddress := testutils.NewAddress()
4443
gasLimit := uint64(1000)
4544
payload := []byte{1, 2, 3}
4645
ethClient := clienttest.NewClientWithDefaultChainID(b)
@@ -87,8 +86,7 @@ func BenchmarkTxStoreFindAttemptsRequiringReceiptFetch(b *testing.B) {
8786
txStore := NewTestTxStore(b, db)
8887
ctx := tests.Context(b)
8988
blockNum := int64(100)
90-
kst := cltest.NewKeyStore(b, db)
91-
_, fromAddress := cltest.MustInsertRandomKey(b, kst.Eth())
89+
fromAddress := testutils.NewAddress()
9290

9391
var nonce = evmtypes.Nonce(0)
9492
for i := 0; i < bs.size; i++ {
@@ -132,8 +130,7 @@ func BenchmarkFindTxesByIDs(b *testing.B) {
132130
db := testutils.NewSqlxDB(b)
133131
txStore := NewTestTxStore(b, db)
134132
ctx := tests.Context(b)
135-
ethKeyStore := cltest.NewKeyStore(b, db).Eth()
136-
_, fromAddress := cltest.MustInsertRandomKeyReturningState(b, ethKeyStore)
133+
fromAddress := testutils.NewAddress()
137134

138135
var etxIDs []int64
139136
for i := 0; i < bs.size; i++ {
@@ -159,8 +156,7 @@ func BenchmarkFindConfirmedTxesReceipts(b *testing.B) {
159156
db := testutils.NewSqlxDB(b)
160157
txStore := NewTestTxStore(b, db)
161158
finalizedBlockNum := int64(100)
162-
kst := cltest.NewKeyStore(b, db)
163-
_, fromAddress := cltest.MustInsertRandomKey(b, kst.Eth())
159+
fromAddress := testutils.NewAddress()
164160

165161
for i := 0; i < bs.size; i++ {
166162
mustInsertConfirmedEthTxWithReceipt(b, txStore, fromAddress, int64(i), finalizedBlockNum)

0 commit comments

Comments
 (0)