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