github.com/aakash4dev/cometbft@v0.38.2/mempool/mocks/mempool.go (about) 1 // Code generated by mockery. DO NOT EDIT. 2 3 package mocks 4 5 import ( 6 abcicli "github.com/aakash4dev/cometbft/abci/client" 7 abcitypes "github.com/aakash4dev/cometbft/abci/types" 8 9 mempool "github.com/aakash4dev/cometbft/mempool" 10 11 mock "github.com/stretchr/testify/mock" 12 13 types "github.com/aakash4dev/cometbft/types" 14 ) 15 16 // Mempool is an autogenerated mock type for the Mempool type 17 type Mempool struct { 18 mock.Mock 19 } 20 21 // CheckTx provides a mock function with given fields: tx 22 func (_m *Mempool) CheckTx(tx types.Tx) (*abcicli.ReqRes, error) { 23 ret := _m.Called(tx) 24 25 var r0 *abcicli.ReqRes 26 var r1 error 27 if rf, ok := ret.Get(0).(func(types.Tx) (*abcicli.ReqRes, error)); ok { 28 return rf(tx) 29 } 30 if rf, ok := ret.Get(0).(func(types.Tx) *abcicli.ReqRes); ok { 31 r0 = rf(tx) 32 } else { 33 if ret.Get(0) != nil { 34 r0 = ret.Get(0).(*abcicli.ReqRes) 35 } 36 } 37 38 if rf, ok := ret.Get(1).(func(types.Tx) error); ok { 39 r1 = rf(tx) 40 } else { 41 r1 = ret.Error(1) 42 } 43 44 return r0, r1 45 } 46 47 // EnableTxsAvailable provides a mock function with given fields: 48 func (_m *Mempool) EnableTxsAvailable() { 49 _m.Called() 50 } 51 52 // Flush provides a mock function with given fields: 53 func (_m *Mempool) Flush() { 54 _m.Called() 55 } 56 57 // FlushAppConn provides a mock function with given fields: 58 func (_m *Mempool) FlushAppConn() error { 59 ret := _m.Called() 60 61 var r0 error 62 if rf, ok := ret.Get(0).(func() error); ok { 63 r0 = rf() 64 } else { 65 r0 = ret.Error(0) 66 } 67 68 return r0 69 } 70 71 // Lock provides a mock function with given fields: 72 func (_m *Mempool) Lock() { 73 _m.Called() 74 } 75 76 // ReapMaxBytesMaxGas provides a mock function with given fields: maxBytes, maxGas 77 func (_m *Mempool) ReapMaxBytesMaxGas(maxBytes int64, maxGas int64) types.Txs { 78 ret := _m.Called(maxBytes, maxGas) 79 80 var r0 types.Txs 81 if rf, ok := ret.Get(0).(func(int64, int64) types.Txs); ok { 82 r0 = rf(maxBytes, maxGas) 83 } else { 84 if ret.Get(0) != nil { 85 r0 = ret.Get(0).(types.Txs) 86 } 87 } 88 89 return r0 90 } 91 92 // ReapMaxTxs provides a mock function with given fields: max 93 func (_m *Mempool) ReapMaxTxs(max int) types.Txs { 94 ret := _m.Called(max) 95 96 var r0 types.Txs 97 if rf, ok := ret.Get(0).(func(int) types.Txs); ok { 98 r0 = rf(max) 99 } else { 100 if ret.Get(0) != nil { 101 r0 = ret.Get(0).(types.Txs) 102 } 103 } 104 105 return r0 106 } 107 108 // RemoveTxByKey provides a mock function with given fields: txKey 109 func (_m *Mempool) RemoveTxByKey(txKey types.TxKey) error { 110 ret := _m.Called(txKey) 111 112 var r0 error 113 if rf, ok := ret.Get(0).(func(types.TxKey) error); ok { 114 r0 = rf(txKey) 115 } else { 116 r0 = ret.Error(0) 117 } 118 119 return r0 120 } 121 122 // SetTxRemovedCallback provides a mock function with given fields: cb 123 func (_m *Mempool) SetTxRemovedCallback(cb func(types.TxKey)) { 124 _m.Called(cb) 125 } 126 127 // Size provides a mock function with given fields: 128 func (_m *Mempool) Size() int { 129 ret := _m.Called() 130 131 var r0 int 132 if rf, ok := ret.Get(0).(func() int); ok { 133 r0 = rf() 134 } else { 135 r0 = ret.Get(0).(int) 136 } 137 138 return r0 139 } 140 141 // SizeBytes provides a mock function with given fields: 142 func (_m *Mempool) SizeBytes() int64 { 143 ret := _m.Called() 144 145 var r0 int64 146 if rf, ok := ret.Get(0).(func() int64); ok { 147 r0 = rf() 148 } else { 149 r0 = ret.Get(0).(int64) 150 } 151 152 return r0 153 } 154 155 // TxsAvailable provides a mock function with given fields: 156 func (_m *Mempool) TxsAvailable() <-chan struct{} { 157 ret := _m.Called() 158 159 var r0 <-chan struct{} 160 if rf, ok := ret.Get(0).(func() <-chan struct{}); ok { 161 r0 = rf() 162 } else { 163 if ret.Get(0) != nil { 164 r0 = ret.Get(0).(<-chan struct{}) 165 } 166 } 167 168 return r0 169 } 170 171 // Unlock provides a mock function with given fields: 172 func (_m *Mempool) Unlock() { 173 _m.Called() 174 } 175 176 // Update provides a mock function with given fields: blockHeight, blockTxs, deliverTxResponses, newPreFn, newPostFn 177 func (_m *Mempool) Update(blockHeight int64, blockTxs types.Txs, deliverTxResponses []*abcitypes.ExecTxResult, newPreFn mempool.PreCheckFunc, newPostFn mempool.PostCheckFunc) error { 178 ret := _m.Called(blockHeight, blockTxs, deliverTxResponses, newPreFn, newPostFn) 179 180 var r0 error 181 if rf, ok := ret.Get(0).(func(int64, types.Txs, []*abcitypes.ExecTxResult, mempool.PreCheckFunc, mempool.PostCheckFunc) error); ok { 182 r0 = rf(blockHeight, blockTxs, deliverTxResponses, newPreFn, newPostFn) 183 } else { 184 r0 = ret.Error(0) 185 } 186 187 return r0 188 } 189 190 // NewMempool creates a new instance of Mempool. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 191 // The first argument is typically a *testing.T value. 192 func NewMempool(t interface { 193 mock.TestingT 194 Cleanup(func()) 195 }) *Mempool { 196 mock := &Mempool{} 197 mock.Mock.Test(t) 198 199 t.Cleanup(func() { mock.AssertExpectations(t) }) 200 201 return mock 202 }