@@ -18,7 +18,6 @@ import (
1818 "github.com/evstack/ev-node/pkg/config"
1919 datypes "github.com/evstack/ev-node/pkg/da/types"
2020 "github.com/evstack/ev-node/pkg/genesis"
21- "github.com/evstack/ev-node/pkg/sequencers/common"
2221 "github.com/evstack/ev-node/test/mocks"
2322)
2423
@@ -62,7 +61,7 @@ type testData struct {
6261 cancel context.CancelFunc
6362}
6463
65- func createTestSequencer (t * testing.T , mockRetriever * common. MockForcedInclusionRetriever , gen genesis.Genesis ) (* BasedSequencer , testData ) {
64+ func createTestSequencer (t * testing.T , mockRetriever * MockForcedInclusionRetriever , gen genesis.Genesis ) (* BasedSequencer , testData ) {
6665 t .Helper ()
6766
6867 // Create in-memory datastore
@@ -95,7 +94,7 @@ func createTestSequencer(t *testing.T, mockRetriever *common.MockForcedInclusion
9594}
9695
9796func TestBasedSequencer_SubmitBatchTxs (t * testing.T ) {
98- mockRetriever := common . NewMockForcedInclusionRetriever (t )
97+ mockRetriever := NewMockForcedInclusionRetriever (t )
9998 gen := genesis.Genesis {
10099 ChainID : "test-chain" ,
101100 DAEpochForcedInclusion : 10 ,
@@ -122,7 +121,7 @@ func TestBasedSequencer_SubmitBatchTxs(t *testing.T) {
122121func TestBasedSequencer_GetNextBatch_WithForcedTxs (t * testing.T ) {
123122 testBlobs := [][]byte {[]byte ("tx1" ), []byte ("tx2" )}
124123
125- mockRetriever := common . NewMockForcedInclusionRetriever (t )
124+ mockRetriever := NewMockForcedInclusionRetriever (t )
126125 mockRetriever .On ("RetrieveForcedIncludedTxs" , mock .Anything , uint64 (100 )).Return (& block.ForcedInclusionEvent {
127126 Txs : testBlobs ,
128127 StartDaHeight : 100 ,
@@ -158,7 +157,7 @@ func TestBasedSequencer_GetNextBatch_WithForcedTxs(t *testing.T) {
158157}
159158
160159func TestBasedSequencer_GetNextBatch_EmptyDA (t * testing.T ) {
161- mockRetriever := common . NewMockForcedInclusionRetriever (t )
160+ mockRetriever := NewMockForcedInclusionRetriever (t )
162161 mockRetriever .On ("RetrieveForcedIncludedTxs" , mock .Anything , uint64 (100 )).Return (& block.ForcedInclusionEvent {
163162 Txs : [][]byte {},
164163 StartDaHeight : 100 ,
@@ -189,7 +188,7 @@ func TestBasedSequencer_GetNextBatch_EmptyDA(t *testing.T) {
189188}
190189
191190func TestBasedSequencer_GetNextBatch_NotConfigured (t * testing.T ) {
192- mockRetriever := common . NewMockForcedInclusionRetriever (t )
191+ mockRetriever := NewMockForcedInclusionRetriever (t )
193192 mockRetriever .On ("RetrieveForcedIncludedTxs" , mock .Anything , uint64 (100 )).Return (nil , block .ErrForceInclusionNotConfigured )
194193
195194 gen := genesis.Genesis {
@@ -219,7 +218,7 @@ func TestBasedSequencer_GetNextBatch_WithMaxBytes(t *testing.T) {
219218 tx3 := make ([]byte , 200 )
220219 testBlobs := [][]byte {tx1 , tx2 , tx3 }
221220
222- mockRetriever := common . NewMockForcedInclusionRetriever (t )
221+ mockRetriever := NewMockForcedInclusionRetriever (t )
223222 mockRetriever .On ("RetrieveForcedIncludedTxs" , mock .Anything , uint64 (100 )).Return (& block.ForcedInclusionEvent {
224223 Txs : testBlobs ,
225224 StartDaHeight : 100 ,
@@ -274,7 +273,7 @@ func TestBasedSequencer_GetNextBatch_MultipleDABlocks(t *testing.T) {
274273 testBlobs1 := [][]byte {[]byte ("tx1" ), []byte ("tx2" )}
275274 testBlobs2 := [][]byte {[]byte ("tx3" ), []byte ("tx4" )}
276275
277- mockRetriever := common . NewMockForcedInclusionRetriever (t )
276+ mockRetriever := NewMockForcedInclusionRetriever (t )
278277 // First DA block
279278 mockRetriever .On ("RetrieveForcedIncludedTxs" , mock .Anything , uint64 (100 )).Return (& block.ForcedInclusionEvent {
280279 Txs : testBlobs1 ,
@@ -327,7 +326,7 @@ func TestBasedSequencer_GetNextBatch_ForcedInclusionExceedsMaxBytes(t *testing.T
327326 largeTx := make ([]byte , 2000 )
328327 testBlobs := [][]byte {largeTx }
329328
330- mockRetriever := common . NewMockForcedInclusionRetriever (t )
329+ mockRetriever := NewMockForcedInclusionRetriever (t )
331330 mockRetriever .On ("RetrieveForcedIncludedTxs" , mock .Anything , uint64 (100 )).Return (& block.ForcedInclusionEvent {
332331 Txs : testBlobs ,
333332 StartDaHeight : 100 ,
@@ -358,7 +357,7 @@ func TestBasedSequencer_GetNextBatch_ForcedInclusionExceedsMaxBytes(t *testing.T
358357}
359358
360359func TestBasedSequencer_VerifyBatch (t * testing.T ) {
361- mockRetriever := common . NewMockForcedInclusionRetriever (t )
360+ mockRetriever := NewMockForcedInclusionRetriever (t )
362361 gen := genesis.Genesis {
363362 ChainID : "test-chain" ,
364363 DAEpochForcedInclusion : 10 ,
@@ -379,7 +378,7 @@ func TestBasedSequencer_VerifyBatch(t *testing.T) {
379378}
380379
381380func TestBasedSequencer_SetDAHeight (t * testing.T ) {
382- mockRetriever := common . NewMockForcedInclusionRetriever (t )
381+ mockRetriever := NewMockForcedInclusionRetriever (t )
383382 gen := genesis.Genesis {
384383 ChainID : "test-chain" ,
385384 DAStartHeight : 100 ,
@@ -397,7 +396,7 @@ func TestBasedSequencer_SetDAHeight(t *testing.T) {
397396}
398397
399398func TestBasedSequencer_GetNextBatch_ErrorHandling (t * testing.T ) {
400- mockRetriever := common . NewMockForcedInclusionRetriever (t )
399+ mockRetriever := NewMockForcedInclusionRetriever (t )
401400 mockRetriever .On ("RetrieveForcedIncludedTxs" , mock .Anything , uint64 (100 )).Return (nil , block .ErrForceInclusionNotConfigured )
402401
403402 gen := genesis.Genesis {
@@ -421,7 +420,7 @@ func TestBasedSequencer_GetNextBatch_ErrorHandling(t *testing.T) {
421420}
422421
423422func TestBasedSequencer_GetNextBatch_HeightFromFuture (t * testing.T ) {
424- mockRetriever := common . NewMockForcedInclusionRetriever (t )
423+ mockRetriever := NewMockForcedInclusionRetriever (t )
425424 mockRetriever .On ("RetrieveForcedIncludedTxs" , mock .Anything , uint64 (100 )).Return (nil , datypes .ErrHeightFromFuture )
426425
427426 gen := genesis.Genesis {
@@ -450,7 +449,7 @@ func TestBasedSequencer_GetNextBatch_HeightFromFuture(t *testing.T) {
450449func TestBasedSequencer_CheckpointPersistence (t * testing.T ) {
451450 testBlobs := [][]byte {[]byte ("tx1" ), []byte ("tx2" )}
452451
453- mockRetriever := common . NewMockForcedInclusionRetriever (t )
452+ mockRetriever := NewMockForcedInclusionRetriever (t )
454453 mockRetriever .On ("RetrieveForcedIncludedTxs" , mock .Anything , uint64 (100 )).Return (& block.ForcedInclusionEvent {
455454 Txs : testBlobs ,
456455 StartDaHeight : 100 ,
@@ -525,7 +524,7 @@ func TestBasedSequencer_CrashRecoveryMidEpoch(t *testing.T) {
525524
526525 testBlobs := [][]byte {[]byte ("tx0" ), []byte ("tx1" ), []byte ("tx2" ), []byte ("tx3" ), []byte ("tx4" )}
527526
528- mockRetriever := common . NewMockForcedInclusionRetriever (t )
527+ mockRetriever := NewMockForcedInclusionRetriever (t )
529528 // The epoch will be fetched twice: once before crash, once after restart
530529 mockRetriever .On ("RetrieveForcedIncludedTxs" , mock .Anything , uint64 (100 )).Return (& block.ForcedInclusionEvent {
531530 Txs : testBlobs ,
@@ -650,7 +649,7 @@ func TestBasedSequencer_CrashRecoveryMidEpoch(t *testing.T) {
650649}
651650
652651func TestBasedSequencer_GetNextBatch_EmptyDABatch_IncreasesDAHeight (t * testing.T ) {
653- mockRetriever := common . NewMockForcedInclusionRetriever (t )
652+ mockRetriever := NewMockForcedInclusionRetriever (t )
654653
655654 // First DA block returns empty transactions
656655 mockRetriever .On ("RetrieveForcedIncludedTxs" , mock .Anything , uint64 (100 )).Return (& block.ForcedInclusionEvent {
@@ -715,7 +714,7 @@ func TestBasedSequencer_GetNextBatch_TimestampAdjustment(t *testing.T) {
715714 testBlobs := [][]byte {[]byte ("tx1" ), []byte ("tx2" ), []byte ("tx3" )}
716715 daEndTime := time .Date (2024 , 1 , 1 , 12 , 0 , 0 , 0 , time .UTC )
717716
718- mockRetriever := common . NewMockForcedInclusionRetriever (t )
717+ mockRetriever := NewMockForcedInclusionRetriever (t )
719718 mockRetriever .On ("RetrieveForcedIncludedTxs" , mock .Anything , uint64 (100 )).Return (& block.ForcedInclusionEvent {
720719 Txs : testBlobs ,
721720 StartDaHeight : 100 ,
@@ -759,7 +758,7 @@ func TestBasedSequencer_GetNextBatch_TimestampAdjustment_PartialBatch(t *testing
759758 testBlobs := [][]byte {tx1 , tx2 , tx3 }
760759 daEndTime := time .Date (2024 , 1 , 1 , 12 , 0 , 0 , 0 , time .UTC )
761760
762- mockRetriever := common . NewMockForcedInclusionRetriever (t )
761+ mockRetriever := NewMockForcedInclusionRetriever (t )
763762 mockRetriever .On ("RetrieveForcedIncludedTxs" , mock .Anything , uint64 (100 )).Return (& block.ForcedInclusionEvent {
764763 Txs : testBlobs ,
765764 StartDaHeight : 100 ,
@@ -817,7 +816,7 @@ func TestBasedSequencer_GetNextBatch_TimestampAdjustment_EmptyBatch(t *testing.T
817816 // The checkpoint must still advance past the empty epoch.
818817 daEndTime := time .Date (2024 , 1 , 1 , 12 , 0 , 0 , 0 , time .UTC )
819818
820- mockRetriever := common . NewMockForcedInclusionRetriever (t )
819+ mockRetriever := NewMockForcedInclusionRetriever (t )
821820 mockRetriever .On ("RetrieveForcedIncludedTxs" , mock .Anything , uint64 (100 )).Return (& block.ForcedInclusionEvent {
822821 Txs : [][]byte {},
823822 StartDaHeight : 100 ,
@@ -869,7 +868,7 @@ func TestBasedSequencer_GetNextBatch_GasFilteringPreservesUnprocessedTxs(t *test
869868
870869 testBlobs := [][]byte {tx0 , tx1 , tx2 , tx3 , tx4 }
871870
872- mockRetriever := common . NewMockForcedInclusionRetriever (t )
871+ mockRetriever := NewMockForcedInclusionRetriever (t )
873872 // Only expect one call to retrieve - all txs come from one DA epoch
874873 mockRetriever .On ("RetrieveForcedIncludedTxs" , mock .Anything , uint64 (100 )).Return (& block.ForcedInclusionEvent {
875874 Txs : testBlobs ,
@@ -988,7 +987,7 @@ func TestBasedSequencer_GetNextBatch_GasFilteringPreservesUnprocessedTxs(t *test
988987 assert .GreaterOrEqual (t , totalTxsProcessed , 3 , "should process at least 3 valid transactions from the cache" )
989988}
990989
991- func replaceWithMockRetriever (seq * BasedSequencer , mockRetriever * common. MockForcedInclusionRetriever ) {
990+ func replaceWithMockRetriever (seq * BasedSequencer , mockRetriever * MockForcedInclusionRetriever ) {
992991 if seq .fiRetriever != nil {
993992 seq .fiRetriever .Stop ()
994993 }
0 commit comments