From a5ab279ff4b853ef37f43e32f1d3f0e22dbc53e6 Mon Sep 17 00:00:00 2001 From: joanestebanr <129153821+joanestebanr@users.noreply.github.com> Date: Mon, 6 May 2024 11:19:20 +0200 Subject: [PATCH] fix uniitest --- actions/processor_manager/processor_manager.go | 6 ++++-- synchronizer/synchronizer_block_range_process_test.go | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/actions/processor_manager/processor_manager.go b/actions/processor_manager/processor_manager.go index bd51800..b567e31 100644 --- a/actions/processor_manager/processor_manager.go +++ b/actions/processor_manager/processor_manager.go @@ -6,10 +6,12 @@ import ( "fmt" "github.com/0xPolygonHermez/zkevm-synchronizer-l1/etherman" + "github.com/0xPolygonHermez/zkevm-synchronizer-l1/state/entities" "github.com/0xPolygonHermez/zkevm-synchronizer-l1/synchronizer/actions" - "github.com/jackc/pgx/v4" ) +type dbTxType = entities.Tx + var ( // ErrCantProcessThisEvent is used when the object is not found ErrCantProcessThisEvent = errors.New("not a processor for this event/forkid") @@ -52,7 +54,7 @@ func (p *L1EventProcessors) Get(forkId actions.ForkIdType, event etherman.EventO } // Process execute the event for the forkId and event -func (p *L1EventProcessors) Process(ctx context.Context, forkId actions.ForkIdType, order etherman.Order, block *etherman.Block, dbTx pgx.Tx) error { +func (p *L1EventProcessors) Process(ctx context.Context, forkId actions.ForkIdType, order etherman.Order, block *etherman.Block, dbTx dbTxType) error { processor := p.Get(forkId, order.Name) if processor == nil { var strBlockNumber string diff --git a/synchronizer/synchronizer_block_range_process_test.go b/synchronizer/synchronizer_block_range_process_test.go index 368facd..34e5b70 100644 --- a/synchronizer/synchronizer_block_range_process_test.go +++ b/synchronizer/synchronizer_block_range_process_test.go @@ -17,7 +17,7 @@ import ( type testProcessBlockRangeData struct { mockState *mock_synchronizer.StorageInterface - mockTransactions *mock_synchronizer.StateInterface + mockTransactions *mock_synchronizer.StateTxProvider mockForkId *mock_synchronizer.StateForkIdQuerier mockL1EventProcessor *mock_synchronizer.L1EventProcessorManager DbTx *mock_entities.Tx @@ -29,7 +29,7 @@ func newTestProcessBlockRangeData(t *testing.T) *testProcessBlockRangeData { mockState := mock_synchronizer.NewStorageInterface(t) mockForkId := mock_synchronizer.NewStateForkIdQuerier(t) mockL1EventProcessor := mock_synchronizer.NewL1EventProcessorManager(t) - mockTransactions := mock_synchronizer.NewStateInterface(t) + mockTransactions := mock_synchronizer.NewStateTxProvider(t) DbTx := mock_entities.NewTx(t) sut := synchronizer.NewBlockRangeProcessLegacy(mockState, mockForkId, mockTransactions, mockL1EventProcessor) ctx := context.TODO()