github.com/0xPolygon/supernets2-node@v0.0.0-20230711153321-2fe574524eaa/sequencer/mock_worker.go (about)

     1  // Code generated by mockery v2.22.1. DO NOT EDIT.
     2  
     3  package sequencer
     4  
     5  import (
     6  	context "context"
     7  	big "math/big"
     8  
     9  	common "github.com/ethereum/go-ethereum/common"
    10  
    11  	mock "github.com/stretchr/testify/mock"
    12  
    13  	state "github.com/0xPolygon/supernets2-node/state"
    14  
    15  	types "github.com/ethereum/go-ethereum/core/types"
    16  )
    17  
    18  // WorkerMock is an autogenerated mock type for the workerInterface type
    19  type WorkerMock struct {
    20  	mock.Mock
    21  }
    22  
    23  // AddTxTracker provides a mock function with given fields: ctx, txTracker
    24  func (_m *WorkerMock) AddTxTracker(ctx context.Context, txTracker *TxTracker) (error, bool) {
    25  	ret := _m.Called(ctx, txTracker)
    26  
    27  	var r0 error
    28  	var r1 bool
    29  	if rf, ok := ret.Get(0).(func(context.Context, *TxTracker) (error, bool)); ok {
    30  		return rf(ctx, txTracker)
    31  	}
    32  	if rf, ok := ret.Get(0).(func(context.Context, *TxTracker) error); ok {
    33  		r0 = rf(ctx, txTracker)
    34  	} else {
    35  		r0 = ret.Error(0)
    36  	}
    37  
    38  	if rf, ok := ret.Get(1).(func(context.Context, *TxTracker) bool); ok {
    39  		r1 = rf(ctx, txTracker)
    40  	} else {
    41  		r1 = ret.Get(1).(bool)
    42  	}
    43  
    44  	return r0, r1
    45  }
    46  
    47  // DeleteTx provides a mock function with given fields: txHash, from
    48  func (_m *WorkerMock) DeleteTx(txHash common.Hash, from common.Address) {
    49  	_m.Called(txHash, from)
    50  }
    51  
    52  // GetBestFittingTx provides a mock function with given fields: resources
    53  func (_m *WorkerMock) GetBestFittingTx(resources state.BatchResources) *TxTracker {
    54  	ret := _m.Called(resources)
    55  
    56  	var r0 *TxTracker
    57  	if rf, ok := ret.Get(0).(func(state.BatchResources) *TxTracker); ok {
    58  		r0 = rf(resources)
    59  	} else {
    60  		if ret.Get(0) != nil {
    61  			r0 = ret.Get(0).(*TxTracker)
    62  		}
    63  	}
    64  
    65  	return r0
    66  }
    67  
    68  // HandleL2Reorg provides a mock function with given fields: txHashes
    69  func (_m *WorkerMock) HandleL2Reorg(txHashes []common.Hash) {
    70  	_m.Called(txHashes)
    71  }
    72  
    73  // MoveTxToNotReady provides a mock function with given fields: txHash, from, actualNonce, actualBalance
    74  func (_m *WorkerMock) MoveTxToNotReady(txHash common.Hash, from common.Address, actualNonce *uint64, actualBalance *big.Int) []*TxTracker {
    75  	ret := _m.Called(txHash, from, actualNonce, actualBalance)
    76  
    77  	var r0 []*TxTracker
    78  	if rf, ok := ret.Get(0).(func(common.Hash, common.Address, *uint64, *big.Int) []*TxTracker); ok {
    79  		r0 = rf(txHash, from, actualNonce, actualBalance)
    80  	} else {
    81  		if ret.Get(0) != nil {
    82  			r0 = ret.Get(0).([]*TxTracker)
    83  		}
    84  	}
    85  
    86  	return r0
    87  }
    88  
    89  // NewTxTracker provides a mock function with given fields: tx, counters, ip
    90  func (_m *WorkerMock) NewTxTracker(tx types.Transaction, counters state.ZKCounters, ip string) (*TxTracker, error) {
    91  	ret := _m.Called(tx, counters, ip)
    92  
    93  	var r0 *TxTracker
    94  	var r1 error
    95  	if rf, ok := ret.Get(0).(func(types.Transaction, state.ZKCounters, string) (*TxTracker, error)); ok {
    96  		return rf(tx, counters, ip)
    97  	}
    98  	if rf, ok := ret.Get(0).(func(types.Transaction, state.ZKCounters, string) *TxTracker); ok {
    99  		r0 = rf(tx, counters, ip)
   100  	} else {
   101  		if ret.Get(0) != nil {
   102  			r0 = ret.Get(0).(*TxTracker)
   103  		}
   104  	}
   105  
   106  	if rf, ok := ret.Get(1).(func(types.Transaction, state.ZKCounters, string) error); ok {
   107  		r1 = rf(tx, counters, ip)
   108  	} else {
   109  		r1 = ret.Error(1)
   110  	}
   111  
   112  	return r0, r1
   113  }
   114  
   115  // UpdateAfterSingleSuccessfulTxExecution provides a mock function with given fields: from, touchedAddresses
   116  func (_m *WorkerMock) UpdateAfterSingleSuccessfulTxExecution(from common.Address, touchedAddresses map[common.Address]*state.InfoReadWrite) []*TxTracker {
   117  	ret := _m.Called(from, touchedAddresses)
   118  
   119  	var r0 []*TxTracker
   120  	if rf, ok := ret.Get(0).(func(common.Address, map[common.Address]*state.InfoReadWrite) []*TxTracker); ok {
   121  		r0 = rf(from, touchedAddresses)
   122  	} else {
   123  		if ret.Get(0) != nil {
   124  			r0 = ret.Get(0).([]*TxTracker)
   125  		}
   126  	}
   127  
   128  	return r0
   129  }
   130  
   131  // UpdateTx provides a mock function with given fields: txHash, from, ZKCounters
   132  func (_m *WorkerMock) UpdateTx(txHash common.Hash, from common.Address, ZKCounters state.ZKCounters) {
   133  	_m.Called(txHash, from, ZKCounters)
   134  }
   135  
   136  type mockConstructorTestingTNewWorkerMock interface {
   137  	mock.TestingT
   138  	Cleanup(func())
   139  }
   140  
   141  // NewWorkerMock creates a new instance of WorkerMock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
   142  func NewWorkerMock(t mockConstructorTestingTNewWorkerMock) *WorkerMock {
   143  	mock := &WorkerMock{}
   144  	mock.Mock.Test(t)
   145  
   146  	t.Cleanup(func() { mock.AssertExpectations(t) })
   147  
   148  	return mock
   149  }