@@ -39,7 +39,7 @@ func TestLifecycle(t *testing.T) {
3939 txStore := storage .NewInMemoryStoreManager (lggr , testutils .FixtureChainID )
4040 require .NoError (t , txStore .Add (address1 ))
4141 keystore := keystest.Addresses {address1 }
42- txm := NewTxm (lggr , testutils .FixtureChainID , client , nil , txStore , nil , config , keystore )
42+ txm := NewTxm (lggr , testutils .FixtureChainID , client , nil , txStore , nil , config , keystore , nil )
4343 client .On ("PendingNonceAt" , mock .Anything , address1 ).Return (uint64 (0 ), errors .New ("error" )).Once ()
4444 client .On ("PendingNonceAt" , mock .Anything , address1 ).Return (uint64 (100 ), nil ).Once ()
4545 servicetest .Run (t , txm )
@@ -53,7 +53,7 @@ func TestLifecycle(t *testing.T) {
5353 lggr , observedLogs := logger .TestObserved (t , zap .DebugLevel )
5454 txStore := storage .NewInMemoryStoreManager (lggr , testutils .FixtureChainID )
5555 require .NoError (t , txStore .Add (addresses ... ))
56- txm := NewTxm (lggr , testutils .FixtureChainID , client , ab , txStore , nil , config , keystore )
56+ txm := NewTxm (lggr , testutils .FixtureChainID , client , ab , txStore , nil , config , keystore , nil )
5757 var nonce uint64
5858 // Start
5959 client .On ("PendingNonceAt" , mock .Anything , address1 ).Return (nonce , nil ).Once ()
@@ -74,7 +74,7 @@ func TestTrigger(t *testing.T) {
7474
7575 t .Run ("Trigger fails if Txm is unstarted" , func (t * testing.T ) {
7676 lggr , observedLogs := logger .TestObserved (t , zap .ErrorLevel )
77- txm := NewTxm (lggr , nil , nil , nil , nil , nil , Config {}, keystest.Addresses {})
77+ txm := NewTxm (lggr , nil , nil , nil , nil , nil , Config {}, keystest.Addresses {}, nil )
7878 txm .Trigger (address )
7979 tests .AssertLogEventually (t , observedLogs , "Txm unstarted" )
8080 })
@@ -87,7 +87,7 @@ func TestTrigger(t *testing.T) {
8787 ab := newMockAttemptBuilder (t )
8888 config := Config {BlockTime : 1 * time .Minute , RetryBlockThreshold : 10 }
8989 keystore := keystest.Addresses {address }
90- txm := NewTxm (lggr , testutils .FixtureChainID , client , ab , txStore , nil , config , keystore )
90+ txm := NewTxm (lggr , testutils .FixtureChainID , client , ab , txStore , nil , config , keystore , nil )
9191 var nonce uint64
9292 // Start
9393 client .On ("PendingNonceAt" , mock .Anything , address ).Return (nonce , nil ).Maybe ()
@@ -109,7 +109,7 @@ func TestBroadcastTransaction(t *testing.T) {
109109 t .Run ("fails if FetchUnconfirmedTransactionAtNonceWithCount for unconfirmed transactions fails" , func (t * testing.T ) {
110110 mTxStore := newMockTxStore (t )
111111 mTxStore .On ("FetchUnconfirmedTransactionAtNonceWithCount" , mock .Anything , mock .Anything , mock .Anything ).Return (nil , 0 , errors .New ("call failed" )).Once ()
112- txm := NewTxm (logger .Test (t ), testutils .FixtureChainID , client , ab , mTxStore , nil , config , keystore )
112+ txm := NewTxm (logger .Test (t ), testutils .FixtureChainID , client , ab , mTxStore , nil , config , keystore , nil )
113113 bo , err := txm .broadcastTransaction (ctx , address )
114114 require .Error (t , err )
115115 assert .False (t , bo )
@@ -120,7 +120,7 @@ func TestBroadcastTransaction(t *testing.T) {
120120 lggr , observedLogs := logger .TestObserved (t , zap .DebugLevel )
121121 mTxStore := newMockTxStore (t )
122122 mTxStore .On ("FetchUnconfirmedTransactionAtNonceWithCount" , mock .Anything , mock .Anything , mock .Anything ).Return (nil , maxInFlightTransactions + 1 , nil ).Once ()
123- txm := NewTxm (lggr , testutils .FixtureChainID , client , ab , mTxStore , nil , config , keystore )
123+ txm := NewTxm (lggr , testutils .FixtureChainID , client , ab , mTxStore , nil , config , keystore , nil )
124124 bo , err := txm .broadcastTransaction (ctx , address )
125125 assert .True (t , bo )
126126 require .NoError (t , err )
@@ -130,7 +130,7 @@ func TestBroadcastTransaction(t *testing.T) {
130130 t .Run ("checks pending nonce if unconfirmed transactions are equal or more than maxInFlightSubset" , func (t * testing.T ) {
131131 lggr , observedLogs := logger .TestObserved (t , zap .DebugLevel )
132132 mTxStore := newMockTxStore (t )
133- txm := NewTxm (lggr , testutils .FixtureChainID , client , ab , mTxStore , nil , config , keystore )
133+ txm := NewTxm (lggr , testutils .FixtureChainID , client , ab , mTxStore , nil , config , keystore , nil )
134134 txm .setNonce (address , 1 )
135135 mTxStore .On ("FetchUnconfirmedTransactionAtNonceWithCount" , mock .Anything , mock .Anything , mock .Anything ).Return (nil , maxInFlightSubset , nil ).Twice ()
136136
@@ -150,7 +150,7 @@ func TestBroadcastTransaction(t *testing.T) {
150150 t .Run ("fails if UpdateUnstartedTransactionWithNonce fails" , func (t * testing.T ) {
151151 mTxStore := newMockTxStore (t )
152152 mTxStore .On ("FetchUnconfirmedTransactionAtNonceWithCount" , mock .Anything , mock .Anything , mock .Anything ).Return (nil , 0 , nil ).Once ()
153- txm := NewTxm (logger .Test (t ), testutils .FixtureChainID , client , ab , mTxStore , nil , config , keystore )
153+ txm := NewTxm (logger .Test (t ), testutils .FixtureChainID , client , ab , mTxStore , nil , config , keystore , nil )
154154 mTxStore .On ("UpdateUnstartedTransactionWithNonce" , mock .Anything , mock .Anything , mock .Anything ).Return (nil , errors .New ("call failed" )).Once ()
155155 bo , err := txm .broadcastTransaction (ctx , address )
156156 assert .False (t , bo )
@@ -162,7 +162,7 @@ func TestBroadcastTransaction(t *testing.T) {
162162 lggr := logger .Test (t )
163163 txStore := storage .NewInMemoryStoreManager (lggr , testutils .FixtureChainID )
164164 require .NoError (t , txStore .Add (address ))
165- txm := NewTxm (lggr , testutils .FixtureChainID , client , ab , txStore , nil , config , keystore )
165+ txm := NewTxm (lggr , testutils .FixtureChainID , client , ab , txStore , nil , config , keystore , nil )
166166 bo , err := txm .broadcastTransaction (ctx , address )
167167 require .NoError (t , err )
168168 assert .False (t , bo )
@@ -173,7 +173,7 @@ func TestBroadcastTransaction(t *testing.T) {
173173 lggr := logger .Test (t )
174174 txStore := storage .NewInMemoryStoreManager (lggr , testutils .FixtureChainID )
175175 require .NoError (t , txStore .Add (address ))
176- txm := NewTxm (lggr , testutils .FixtureChainID , client , ab , txStore , nil , config , keystore )
176+ txm := NewTxm (lggr , testutils .FixtureChainID , client , ab , txStore , nil , config , keystore , nil )
177177 txm .setNonce (address , 8 )
178178 metrics , err := NewTxmMetrics (testutils .FixtureChainID )
179179 require .NoError (t , err )
@@ -222,7 +222,7 @@ func TestBackfillTransactions(t *testing.T) {
222222
223223 t .Run ("fails if latest nonce fetching fails" , func (t * testing.T ) {
224224 ab := newMockAttemptBuilder (t )
225- txm := NewTxm (logger .Test (t ), testutils .FixtureChainID , client , ab , txStore , nil , config , keystore )
225+ txm := NewTxm (logger .Test (t ), testutils .FixtureChainID , client , ab , txStore , nil , config , keystore , nil )
226226 client .On ("NonceAt" , mock .Anything , address , mock .Anything ).Return (uint64 (0 ), errors .New ("latest nonce fail" )).Once ()
227227 err := txm .backfillTransactions (t .Context (), address )
228228 require .Error (t , err )
@@ -231,7 +231,7 @@ func TestBackfillTransactions(t *testing.T) {
231231
232232 t .Run ("fails if MarkConfirmedAndReorgedTransactions fails" , func (t * testing.T ) {
233233 ab := newMockAttemptBuilder (t )
234- txm := NewTxm (logger .Test (t ), testutils .FixtureChainID , client , ab , txStore , nil , config , keystore )
234+ txm := NewTxm (logger .Test (t ), testutils .FixtureChainID , client , ab , txStore , nil , config , keystore , nil )
235235 client .On ("NonceAt" , mock .Anything , address , mock .Anything ).Return (uint64 (0 ), nil ).Once ()
236236 txStore .On ("MarkConfirmedAndReorgedTransactions" , mock .Anything , mock .Anything , address ).
237237 Return ([]* types.Transaction {}, []uint64 {}, errors .New ("marking transactions confirmed failed" )).Once ()
@@ -246,7 +246,7 @@ func TestBackfillTransactions(t *testing.T) {
246246 require .NoError (t , txStore .Add (address ))
247247 ab := newMockAttemptBuilder (t )
248248 c := Config {EIP1559 : false , BlockTime : 10 * time .Minute , RetryBlockThreshold : 10 , EmptyTxLimitDefault : 22000 }
249- txm := NewTxm (lggr , testutils .FixtureChainID , client , ab , txStore , nil , c , keystore )
249+ txm := NewTxm (lggr , testutils .FixtureChainID , client , ab , txStore , nil , c , keystore , nil )
250250 emptyMetrics , err := NewTxmMetrics (testutils .FixtureChainID )
251251 require .NoError (t , err )
252252 txm .metrics = emptyMetrics
@@ -287,7 +287,7 @@ func TestBackfillTransactions(t *testing.T) {
287287 require .NoError (t , txStore .Add (address ))
288288 ab := newMockAttemptBuilder (t )
289289 c := Config {EIP1559 : false , BlockTime : 1 * time .Second , RetryBlockThreshold : 1 , EmptyTxLimitDefault : 22000 }
290- txm := NewTxm (lggr , testutils .FixtureChainID , client , ab , txStore , nil , c , keystore )
290+ txm := NewTxm (lggr , testutils .FixtureChainID , client , ab , txStore , nil , c , keystore , nil )
291291 emptyMetrics , err := NewTxmMetrics (testutils .FixtureChainID )
292292 require .NoError (t , err )
293293 txm .metrics = emptyMetrics
@@ -326,7 +326,7 @@ func TestBackfillTransactions(t *testing.T) {
326326 txStore := storage .NewInMemoryStoreManager (lggr , testutils .FixtureChainID )
327327 require .NoError (t , txStore .Add (address ))
328328 ab := newMockAttemptBuilder (t )
329- txm := NewTxm (lggr , testutils .FixtureChainID , client , ab , txStore , nil , config , keystore )
329+ txm := NewTxm (lggr , testutils .FixtureChainID , client , ab , txStore , nil , config , keystore , nil )
330330 var nonce uint64 = 8
331331 txm .setNonce (address , nonce )
332332 metrics , err := NewTxmMetrics (testutils .FixtureChainID )
0 commit comments