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

     1  // Code generated by mockery v2.22.1. DO NOT EDIT.
     2  
     3  package mocks
     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  	time "time"
    15  
    16  	types "github.com/ethereum/go-ethereum/core/types"
    17  )
    18  
    19  // PoolMock is an autogenerated mock type for the PoolInterface type
    20  type PoolMock struct {
    21  	mock.Mock
    22  }
    23  
    24  // AddTx provides a mock function with given fields: ctx, tx, ip
    25  func (_m *PoolMock) AddTx(ctx context.Context, tx types.Transaction, ip string) error {
    26  	ret := _m.Called(ctx, tx, ip)
    27  
    28  	var r0 error
    29  	if rf, ok := ret.Get(0).(func(context.Context, types.Transaction, string) error); ok {
    30  		r0 = rf(ctx, tx, ip)
    31  	} else {
    32  		r0 = ret.Error(0)
    33  	}
    34  
    35  	return r0
    36  }
    37  
    38  // CountPendingTransactions provides a mock function with given fields: ctx
    39  func (_m *PoolMock) CountPendingTransactions(ctx context.Context) (uint64, error) {
    40  	ret := _m.Called(ctx)
    41  
    42  	var r0 uint64
    43  	var r1 error
    44  	if rf, ok := ret.Get(0).(func(context.Context) (uint64, error)); ok {
    45  		return rf(ctx)
    46  	}
    47  	if rf, ok := ret.Get(0).(func(context.Context) uint64); ok {
    48  		r0 = rf(ctx)
    49  	} else {
    50  		r0 = ret.Get(0).(uint64)
    51  	}
    52  
    53  	if rf, ok := ret.Get(1).(func(context.Context) error); ok {
    54  		r1 = rf(ctx)
    55  	} else {
    56  		r1 = ret.Error(1)
    57  	}
    58  
    59  	return r0, r1
    60  }
    61  
    62  // GetGasPrice provides a mock function with given fields: ctx
    63  func (_m *PoolMock) GetGasPrice(ctx context.Context) (uint64, error) {
    64  	ret := _m.Called(ctx)
    65  
    66  	var r0 uint64
    67  	var r1 error
    68  	if rf, ok := ret.Get(0).(func(context.Context) (uint64, error)); ok {
    69  		return rf(ctx)
    70  	}
    71  	if rf, ok := ret.Get(0).(func(context.Context) uint64); ok {
    72  		r0 = rf(ctx)
    73  	} else {
    74  		r0 = ret.Get(0).(uint64)
    75  	}
    76  
    77  	if rf, ok := ret.Get(1).(func(context.Context) error); ok {
    78  		r1 = rf(ctx)
    79  	} else {
    80  		r1 = ret.Error(1)
    81  	}
    82  
    83  	return r0, r1
    84  }
    85  
    86  // GetNonce provides a mock function with given fields: ctx, address
    87  func (_m *PoolMock) GetNonce(ctx context.Context, address common.Address) (uint64, error) {
    88  	ret := _m.Called(ctx, address)
    89  
    90  	var r0 uint64
    91  	var r1 error
    92  	if rf, ok := ret.Get(0).(func(context.Context, common.Address) (uint64, error)); ok {
    93  		return rf(ctx, address)
    94  	}
    95  	if rf, ok := ret.Get(0).(func(context.Context, common.Address) uint64); ok {
    96  		r0 = rf(ctx, address)
    97  	} else {
    98  		r0 = ret.Get(0).(uint64)
    99  	}
   100  
   101  	if rf, ok := ret.Get(1).(func(context.Context, common.Address) error); ok {
   102  		r1 = rf(ctx, address)
   103  	} else {
   104  		r1 = ret.Error(1)
   105  	}
   106  
   107  	return r0, r1
   108  }
   109  
   110  // GetPendingTxHashesSince provides a mock function with given fields: ctx, since
   111  func (_m *PoolMock) GetPendingTxHashesSince(ctx context.Context, since time.Time) ([]common.Hash, error) {
   112  	ret := _m.Called(ctx, since)
   113  
   114  	var r0 []common.Hash
   115  	var r1 error
   116  	if rf, ok := ret.Get(0).(func(context.Context, time.Time) ([]common.Hash, error)); ok {
   117  		return rf(ctx, since)
   118  	}
   119  	if rf, ok := ret.Get(0).(func(context.Context, time.Time) []common.Hash); ok {
   120  		r0 = rf(ctx, since)
   121  	} else {
   122  		if ret.Get(0) != nil {
   123  			r0 = ret.Get(0).([]common.Hash)
   124  		}
   125  	}
   126  
   127  	if rf, ok := ret.Get(1).(func(context.Context, time.Time) error); ok {
   128  		r1 = rf(ctx, since)
   129  	} else {
   130  		r1 = ret.Error(1)
   131  	}
   132  
   133  	return r0, r1
   134  }
   135  
   136  // GetPendingTxs provides a mock function with given fields: ctx, limit
   137  func (_m *PoolMock) GetPendingTxs(ctx context.Context, limit uint64) ([]pool.Transaction, error) {
   138  	ret := _m.Called(ctx, limit)
   139  
   140  	var r0 []pool.Transaction
   141  	var r1 error
   142  	if rf, ok := ret.Get(0).(func(context.Context, uint64) ([]pool.Transaction, error)); ok {
   143  		return rf(ctx, limit)
   144  	}
   145  	if rf, ok := ret.Get(0).(func(context.Context, uint64) []pool.Transaction); ok {
   146  		r0 = rf(ctx, limit)
   147  	} else {
   148  		if ret.Get(0) != nil {
   149  			r0 = ret.Get(0).([]pool.Transaction)
   150  		}
   151  	}
   152  
   153  	if rf, ok := ret.Get(1).(func(context.Context, uint64) error); ok {
   154  		r1 = rf(ctx, limit)
   155  	} else {
   156  		r1 = ret.Error(1)
   157  	}
   158  
   159  	return r0, r1
   160  }
   161  
   162  // GetTxByHash provides a mock function with given fields: ctx, hash
   163  func (_m *PoolMock) GetTxByHash(ctx context.Context, hash common.Hash) (*pool.Transaction, error) {
   164  	ret := _m.Called(ctx, hash)
   165  
   166  	var r0 *pool.Transaction
   167  	var r1 error
   168  	if rf, ok := ret.Get(0).(func(context.Context, common.Hash) (*pool.Transaction, error)); ok {
   169  		return rf(ctx, hash)
   170  	}
   171  	if rf, ok := ret.Get(0).(func(context.Context, common.Hash) *pool.Transaction); ok {
   172  		r0 = rf(ctx, hash)
   173  	} else {
   174  		if ret.Get(0) != nil {
   175  			r0 = ret.Get(0).(*pool.Transaction)
   176  		}
   177  	}
   178  
   179  	if rf, ok := ret.Get(1).(func(context.Context, common.Hash) error); ok {
   180  		r1 = rf(ctx, hash)
   181  	} else {
   182  		r1 = ret.Error(1)
   183  	}
   184  
   185  	return r0, r1
   186  }
   187  
   188  type mockConstructorTestingTNewPoolMock interface {
   189  	mock.TestingT
   190  	Cleanup(func())
   191  }
   192  
   193  // 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.
   194  func NewPoolMock(t mockConstructorTestingTNewPoolMock) *PoolMock {
   195  	mock := &PoolMock{}
   196  	mock.Mock.Test(t)
   197  
   198  	t.Cleanup(func() { mock.AssertExpectations(t) })
   199  
   200  	return mock
   201  }