github.com/koko1123/flow-go-1@v0.29.6/module/mempool/mock/chunk_requests.go (about) 1 // Code generated by mockery v2.13.1. DO NOT EDIT. 2 3 package mempool 4 5 import ( 6 chunks "github.com/koko1123/flow-go-1/model/chunks" 7 flow "github.com/koko1123/flow-go-1/model/flow" 8 9 mempool "github.com/koko1123/flow-go-1/module/mempool" 10 11 mock "github.com/stretchr/testify/mock" 12 13 time "time" 14 15 verification "github.com/koko1123/flow-go-1/model/verification" 16 ) 17 18 // ChunkRequests is an autogenerated mock type for the ChunkRequests type 19 type ChunkRequests struct { 20 mock.Mock 21 } 22 23 // Add provides a mock function with given fields: request 24 func (_m *ChunkRequests) Add(request *verification.ChunkDataPackRequest) bool { 25 ret := _m.Called(request) 26 27 var r0 bool 28 if rf, ok := ret.Get(0).(func(*verification.ChunkDataPackRequest) bool); ok { 29 r0 = rf(request) 30 } else { 31 r0 = ret.Get(0).(bool) 32 } 33 34 return r0 35 } 36 37 // All provides a mock function with given fields: 38 func (_m *ChunkRequests) All() verification.ChunkDataPackRequestInfoList { 39 ret := _m.Called() 40 41 var r0 verification.ChunkDataPackRequestInfoList 42 if rf, ok := ret.Get(0).(func() verification.ChunkDataPackRequestInfoList); ok { 43 r0 = rf() 44 } else { 45 if ret.Get(0) != nil { 46 r0 = ret.Get(0).(verification.ChunkDataPackRequestInfoList) 47 } 48 } 49 50 return r0 51 } 52 53 // IncrementAttempt provides a mock function with given fields: chunkID 54 func (_m *ChunkRequests) IncrementAttempt(chunkID flow.Identifier) bool { 55 ret := _m.Called(chunkID) 56 57 var r0 bool 58 if rf, ok := ret.Get(0).(func(flow.Identifier) bool); ok { 59 r0 = rf(chunkID) 60 } else { 61 r0 = ret.Get(0).(bool) 62 } 63 64 return r0 65 } 66 67 // PopAll provides a mock function with given fields: chunkID 68 func (_m *ChunkRequests) PopAll(chunkID flow.Identifier) (chunks.LocatorMap, bool) { 69 ret := _m.Called(chunkID) 70 71 var r0 chunks.LocatorMap 72 if rf, ok := ret.Get(0).(func(flow.Identifier) chunks.LocatorMap); ok { 73 r0 = rf(chunkID) 74 } else { 75 if ret.Get(0) != nil { 76 r0 = ret.Get(0).(chunks.LocatorMap) 77 } 78 } 79 80 var r1 bool 81 if rf, ok := ret.Get(1).(func(flow.Identifier) bool); ok { 82 r1 = rf(chunkID) 83 } else { 84 r1 = ret.Get(1).(bool) 85 } 86 87 return r0, r1 88 } 89 90 // Remove provides a mock function with given fields: chunkID 91 func (_m *ChunkRequests) Remove(chunkID flow.Identifier) bool { 92 ret := _m.Called(chunkID) 93 94 var r0 bool 95 if rf, ok := ret.Get(0).(func(flow.Identifier) bool); ok { 96 r0 = rf(chunkID) 97 } else { 98 r0 = ret.Get(0).(bool) 99 } 100 101 return r0 102 } 103 104 // RequestHistory provides a mock function with given fields: chunkID 105 func (_m *ChunkRequests) RequestHistory(chunkID flow.Identifier) (uint64, time.Time, time.Duration, bool) { 106 ret := _m.Called(chunkID) 107 108 var r0 uint64 109 if rf, ok := ret.Get(0).(func(flow.Identifier) uint64); ok { 110 r0 = rf(chunkID) 111 } else { 112 r0 = ret.Get(0).(uint64) 113 } 114 115 var r1 time.Time 116 if rf, ok := ret.Get(1).(func(flow.Identifier) time.Time); ok { 117 r1 = rf(chunkID) 118 } else { 119 r1 = ret.Get(1).(time.Time) 120 } 121 122 var r2 time.Duration 123 if rf, ok := ret.Get(2).(func(flow.Identifier) time.Duration); ok { 124 r2 = rf(chunkID) 125 } else { 126 r2 = ret.Get(2).(time.Duration) 127 } 128 129 var r3 bool 130 if rf, ok := ret.Get(3).(func(flow.Identifier) bool); ok { 131 r3 = rf(chunkID) 132 } else { 133 r3 = ret.Get(3).(bool) 134 } 135 136 return r0, r1, r2, r3 137 } 138 139 // Size provides a mock function with given fields: 140 func (_m *ChunkRequests) Size() uint { 141 ret := _m.Called() 142 143 var r0 uint 144 if rf, ok := ret.Get(0).(func() uint); ok { 145 r0 = rf() 146 } else { 147 r0 = ret.Get(0).(uint) 148 } 149 150 return r0 151 } 152 153 // UpdateRequestHistory provides a mock function with given fields: chunkID, updater 154 func (_m *ChunkRequests) UpdateRequestHistory(chunkID flow.Identifier, updater mempool.ChunkRequestHistoryUpdaterFunc) (uint64, time.Time, time.Duration, bool) { 155 ret := _m.Called(chunkID, updater) 156 157 var r0 uint64 158 if rf, ok := ret.Get(0).(func(flow.Identifier, mempool.ChunkRequestHistoryUpdaterFunc) uint64); ok { 159 r0 = rf(chunkID, updater) 160 } else { 161 r0 = ret.Get(0).(uint64) 162 } 163 164 var r1 time.Time 165 if rf, ok := ret.Get(1).(func(flow.Identifier, mempool.ChunkRequestHistoryUpdaterFunc) time.Time); ok { 166 r1 = rf(chunkID, updater) 167 } else { 168 r1 = ret.Get(1).(time.Time) 169 } 170 171 var r2 time.Duration 172 if rf, ok := ret.Get(2).(func(flow.Identifier, mempool.ChunkRequestHistoryUpdaterFunc) time.Duration); ok { 173 r2 = rf(chunkID, updater) 174 } else { 175 r2 = ret.Get(2).(time.Duration) 176 } 177 178 var r3 bool 179 if rf, ok := ret.Get(3).(func(flow.Identifier, mempool.ChunkRequestHistoryUpdaterFunc) bool); ok { 180 r3 = rf(chunkID, updater) 181 } else { 182 r3 = ret.Get(3).(bool) 183 } 184 185 return r0, r1, r2, r3 186 } 187 188 type mockConstructorTestingTNewChunkRequests interface { 189 mock.TestingT 190 Cleanup(func()) 191 } 192 193 // NewChunkRequests creates a new instance of ChunkRequests. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 194 func NewChunkRequests(t mockConstructorTestingTNewChunkRequests) *ChunkRequests { 195 mock := &ChunkRequests{} 196 mock.Mock.Test(t) 197 198 t.Cleanup(func() { mock.AssertExpectations(t) }) 199 200 return mock 201 }