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

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