github.com/pvitto98/fabric@v2.1.1+incompatible/common/deliver/mock/filtered_response_sender.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package mock 3 4 import ( 5 "sync" 6 7 "github.com/hyperledger/fabric-protos-go/common" 8 "github.com/hyperledger/fabric/common/deliver" 9 "github.com/hyperledger/fabric/protoutil" 10 ) 11 12 type FilteredResponseSender struct { 13 DataTypeStub func() string 14 dataTypeMutex sync.RWMutex 15 dataTypeArgsForCall []struct { 16 } 17 dataTypeReturns struct { 18 result1 string 19 } 20 dataTypeReturnsOnCall map[int]struct { 21 result1 string 22 } 23 IsFilteredStub func() bool 24 isFilteredMutex sync.RWMutex 25 isFilteredArgsForCall []struct { 26 } 27 isFilteredReturns struct { 28 result1 bool 29 } 30 isFilteredReturnsOnCall map[int]struct { 31 result1 bool 32 } 33 SendBlockResponseStub func(*common.Block, string, deliver.Chain, *protoutil.SignedData) error 34 sendBlockResponseMutex sync.RWMutex 35 sendBlockResponseArgsForCall []struct { 36 arg1 *common.Block 37 arg2 string 38 arg3 deliver.Chain 39 arg4 *protoutil.SignedData 40 } 41 sendBlockResponseReturns struct { 42 result1 error 43 } 44 sendBlockResponseReturnsOnCall map[int]struct { 45 result1 error 46 } 47 SendStatusResponseStub func(common.Status) error 48 sendStatusResponseMutex sync.RWMutex 49 sendStatusResponseArgsForCall []struct { 50 arg1 common.Status 51 } 52 sendStatusResponseReturns struct { 53 result1 error 54 } 55 sendStatusResponseReturnsOnCall map[int]struct { 56 result1 error 57 } 58 invocations map[string][][]interface{} 59 invocationsMutex sync.RWMutex 60 } 61 62 func (fake *FilteredResponseSender) DataType() string { 63 fake.dataTypeMutex.Lock() 64 ret, specificReturn := fake.dataTypeReturnsOnCall[len(fake.dataTypeArgsForCall)] 65 fake.dataTypeArgsForCall = append(fake.dataTypeArgsForCall, struct { 66 }{}) 67 fake.recordInvocation("DataType", []interface{}{}) 68 fake.dataTypeMutex.Unlock() 69 if fake.DataTypeStub != nil { 70 return fake.DataTypeStub() 71 } 72 if specificReturn { 73 return ret.result1 74 } 75 fakeReturns := fake.dataTypeReturns 76 return fakeReturns.result1 77 } 78 79 func (fake *FilteredResponseSender) DataTypeCallCount() int { 80 fake.dataTypeMutex.RLock() 81 defer fake.dataTypeMutex.RUnlock() 82 return len(fake.dataTypeArgsForCall) 83 } 84 85 func (fake *FilteredResponseSender) DataTypeCalls(stub func() string) { 86 fake.dataTypeMutex.Lock() 87 defer fake.dataTypeMutex.Unlock() 88 fake.DataTypeStub = stub 89 } 90 91 func (fake *FilteredResponseSender) DataTypeReturns(result1 string) { 92 fake.dataTypeMutex.Lock() 93 defer fake.dataTypeMutex.Unlock() 94 fake.DataTypeStub = nil 95 fake.dataTypeReturns = struct { 96 result1 string 97 }{result1} 98 } 99 100 func (fake *FilteredResponseSender) DataTypeReturnsOnCall(i int, result1 string) { 101 fake.dataTypeMutex.Lock() 102 defer fake.dataTypeMutex.Unlock() 103 fake.DataTypeStub = nil 104 if fake.dataTypeReturnsOnCall == nil { 105 fake.dataTypeReturnsOnCall = make(map[int]struct { 106 result1 string 107 }) 108 } 109 fake.dataTypeReturnsOnCall[i] = struct { 110 result1 string 111 }{result1} 112 } 113 114 func (fake *FilteredResponseSender) IsFiltered() bool { 115 fake.isFilteredMutex.Lock() 116 ret, specificReturn := fake.isFilteredReturnsOnCall[len(fake.isFilteredArgsForCall)] 117 fake.isFilteredArgsForCall = append(fake.isFilteredArgsForCall, struct { 118 }{}) 119 fake.recordInvocation("IsFiltered", []interface{}{}) 120 fake.isFilteredMutex.Unlock() 121 if fake.IsFilteredStub != nil { 122 return fake.IsFilteredStub() 123 } 124 if specificReturn { 125 return ret.result1 126 } 127 fakeReturns := fake.isFilteredReturns 128 return fakeReturns.result1 129 } 130 131 func (fake *FilteredResponseSender) IsFilteredCallCount() int { 132 fake.isFilteredMutex.RLock() 133 defer fake.isFilteredMutex.RUnlock() 134 return len(fake.isFilteredArgsForCall) 135 } 136 137 func (fake *FilteredResponseSender) IsFilteredCalls(stub func() bool) { 138 fake.isFilteredMutex.Lock() 139 defer fake.isFilteredMutex.Unlock() 140 fake.IsFilteredStub = stub 141 } 142 143 func (fake *FilteredResponseSender) IsFilteredReturns(result1 bool) { 144 fake.isFilteredMutex.Lock() 145 defer fake.isFilteredMutex.Unlock() 146 fake.IsFilteredStub = nil 147 fake.isFilteredReturns = struct { 148 result1 bool 149 }{result1} 150 } 151 152 func (fake *FilteredResponseSender) IsFilteredReturnsOnCall(i int, result1 bool) { 153 fake.isFilteredMutex.Lock() 154 defer fake.isFilteredMutex.Unlock() 155 fake.IsFilteredStub = nil 156 if fake.isFilteredReturnsOnCall == nil { 157 fake.isFilteredReturnsOnCall = make(map[int]struct { 158 result1 bool 159 }) 160 } 161 fake.isFilteredReturnsOnCall[i] = struct { 162 result1 bool 163 }{result1} 164 } 165 166 func (fake *FilteredResponseSender) SendBlockResponse(arg1 *common.Block, arg2 string, arg3 deliver.Chain, arg4 *protoutil.SignedData) error { 167 fake.sendBlockResponseMutex.Lock() 168 ret, specificReturn := fake.sendBlockResponseReturnsOnCall[len(fake.sendBlockResponseArgsForCall)] 169 fake.sendBlockResponseArgsForCall = append(fake.sendBlockResponseArgsForCall, struct { 170 arg1 *common.Block 171 arg2 string 172 arg3 deliver.Chain 173 arg4 *protoutil.SignedData 174 }{arg1, arg2, arg3, arg4}) 175 fake.recordInvocation("SendBlockResponse", []interface{}{arg1, arg2, arg3, arg4}) 176 fake.sendBlockResponseMutex.Unlock() 177 if fake.SendBlockResponseStub != nil { 178 return fake.SendBlockResponseStub(arg1, arg2, arg3, arg4) 179 } 180 if specificReturn { 181 return ret.result1 182 } 183 fakeReturns := fake.sendBlockResponseReturns 184 return fakeReturns.result1 185 } 186 187 func (fake *FilteredResponseSender) SendBlockResponseCallCount() int { 188 fake.sendBlockResponseMutex.RLock() 189 defer fake.sendBlockResponseMutex.RUnlock() 190 return len(fake.sendBlockResponseArgsForCall) 191 } 192 193 func (fake *FilteredResponseSender) SendBlockResponseCalls(stub func(*common.Block, string, deliver.Chain, *protoutil.SignedData) error) { 194 fake.sendBlockResponseMutex.Lock() 195 defer fake.sendBlockResponseMutex.Unlock() 196 fake.SendBlockResponseStub = stub 197 } 198 199 func (fake *FilteredResponseSender) SendBlockResponseArgsForCall(i int) (*common.Block, string, deliver.Chain, *protoutil.SignedData) { 200 fake.sendBlockResponseMutex.RLock() 201 defer fake.sendBlockResponseMutex.RUnlock() 202 argsForCall := fake.sendBlockResponseArgsForCall[i] 203 return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4 204 } 205 206 func (fake *FilteredResponseSender) SendBlockResponseReturns(result1 error) { 207 fake.sendBlockResponseMutex.Lock() 208 defer fake.sendBlockResponseMutex.Unlock() 209 fake.SendBlockResponseStub = nil 210 fake.sendBlockResponseReturns = struct { 211 result1 error 212 }{result1} 213 } 214 215 func (fake *FilteredResponseSender) SendBlockResponseReturnsOnCall(i int, result1 error) { 216 fake.sendBlockResponseMutex.Lock() 217 defer fake.sendBlockResponseMutex.Unlock() 218 fake.SendBlockResponseStub = nil 219 if fake.sendBlockResponseReturnsOnCall == nil { 220 fake.sendBlockResponseReturnsOnCall = make(map[int]struct { 221 result1 error 222 }) 223 } 224 fake.sendBlockResponseReturnsOnCall[i] = struct { 225 result1 error 226 }{result1} 227 } 228 229 func (fake *FilteredResponseSender) SendStatusResponse(arg1 common.Status) error { 230 fake.sendStatusResponseMutex.Lock() 231 ret, specificReturn := fake.sendStatusResponseReturnsOnCall[len(fake.sendStatusResponseArgsForCall)] 232 fake.sendStatusResponseArgsForCall = append(fake.sendStatusResponseArgsForCall, struct { 233 arg1 common.Status 234 }{arg1}) 235 fake.recordInvocation("SendStatusResponse", []interface{}{arg1}) 236 fake.sendStatusResponseMutex.Unlock() 237 if fake.SendStatusResponseStub != nil { 238 return fake.SendStatusResponseStub(arg1) 239 } 240 if specificReturn { 241 return ret.result1 242 } 243 fakeReturns := fake.sendStatusResponseReturns 244 return fakeReturns.result1 245 } 246 247 func (fake *FilteredResponseSender) SendStatusResponseCallCount() int { 248 fake.sendStatusResponseMutex.RLock() 249 defer fake.sendStatusResponseMutex.RUnlock() 250 return len(fake.sendStatusResponseArgsForCall) 251 } 252 253 func (fake *FilteredResponseSender) SendStatusResponseCalls(stub func(common.Status) error) { 254 fake.sendStatusResponseMutex.Lock() 255 defer fake.sendStatusResponseMutex.Unlock() 256 fake.SendStatusResponseStub = stub 257 } 258 259 func (fake *FilteredResponseSender) SendStatusResponseArgsForCall(i int) common.Status { 260 fake.sendStatusResponseMutex.RLock() 261 defer fake.sendStatusResponseMutex.RUnlock() 262 argsForCall := fake.sendStatusResponseArgsForCall[i] 263 return argsForCall.arg1 264 } 265 266 func (fake *FilteredResponseSender) SendStatusResponseReturns(result1 error) { 267 fake.sendStatusResponseMutex.Lock() 268 defer fake.sendStatusResponseMutex.Unlock() 269 fake.SendStatusResponseStub = nil 270 fake.sendStatusResponseReturns = struct { 271 result1 error 272 }{result1} 273 } 274 275 func (fake *FilteredResponseSender) SendStatusResponseReturnsOnCall(i int, result1 error) { 276 fake.sendStatusResponseMutex.Lock() 277 defer fake.sendStatusResponseMutex.Unlock() 278 fake.SendStatusResponseStub = nil 279 if fake.sendStatusResponseReturnsOnCall == nil { 280 fake.sendStatusResponseReturnsOnCall = make(map[int]struct { 281 result1 error 282 }) 283 } 284 fake.sendStatusResponseReturnsOnCall[i] = struct { 285 result1 error 286 }{result1} 287 } 288 289 func (fake *FilteredResponseSender) Invocations() map[string][][]interface{} { 290 fake.invocationsMutex.RLock() 291 defer fake.invocationsMutex.RUnlock() 292 fake.dataTypeMutex.RLock() 293 defer fake.dataTypeMutex.RUnlock() 294 fake.isFilteredMutex.RLock() 295 defer fake.isFilteredMutex.RUnlock() 296 fake.sendBlockResponseMutex.RLock() 297 defer fake.sendBlockResponseMutex.RUnlock() 298 fake.sendStatusResponseMutex.RLock() 299 defer fake.sendStatusResponseMutex.RUnlock() 300 copiedInvocations := map[string][][]interface{}{} 301 for key, value := range fake.invocations { 302 copiedInvocations[key] = value 303 } 304 return copiedInvocations 305 } 306 307 func (fake *FilteredResponseSender) recordInvocation(key string, args []interface{}) { 308 fake.invocationsMutex.Lock() 309 defer fake.invocationsMutex.Unlock() 310 if fake.invocations == nil { 311 fake.invocations = map[string][][]interface{}{} 312 } 313 if fake.invocations[key] == nil { 314 fake.invocations[key] = [][]interface{}{} 315 } 316 fake.invocations[key] = append(fake.invocations[key], args) 317 }