Skip to content

Commit

Permalink
fix uniitest
Browse files Browse the repository at this point in the history
  • Loading branch information
joanestebanr committed May 6, 2024
1 parent 7aea354 commit a5ab279
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions actions/processor_manager/processor_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions synchronizer/synchronizer_block_range_process_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (

type testProcessBlockRangeData struct {
mockState *mock_synchronizer.StorageInterface
mockTransactions *mock_synchronizer.StateInterface
mockTransactions *mock_synchronizer.StateTxProvider

Check failure on line 20 in synchronizer/synchronizer_block_range_process_test.go

View workflow job for this annotation

GitHub Actions / lint

undefined: mock_synchronizer.StateTxProvider (typecheck)
mockForkId *mock_synchronizer.StateForkIdQuerier
mockL1EventProcessor *mock_synchronizer.L1EventProcessorManager
DbTx *mock_entities.Tx
Expand All @@ -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)

Check failure on line 32 in synchronizer/synchronizer_block_range_process_test.go

View workflow job for this annotation

GitHub Actions / lint

undefined: mock_synchronizer.NewStateTxProvider (typecheck)
DbTx := mock_entities.NewTx(t)
sut := synchronizer.NewBlockRangeProcessLegacy(mockState, mockForkId, mockTransactions, mockL1EventProcessor)
ctx := context.TODO()
Expand Down

0 comments on commit a5ab279

Please sign in to comment.