github.com/anjalikarhana/fabric@v2.1.1+incompatible/orderer/common/broadcast/mock/channel_support.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/orderer/common/broadcast" 9 "github.com/hyperledger/fabric/orderer/common/msgprocessor" 10 ) 11 12 type ChannelSupport struct { 13 ClassifyMsgStub func(*common.ChannelHeader) msgprocessor.Classification 14 classifyMsgMutex sync.RWMutex 15 classifyMsgArgsForCall []struct { 16 arg1 *common.ChannelHeader 17 } 18 classifyMsgReturns struct { 19 result1 msgprocessor.Classification 20 } 21 classifyMsgReturnsOnCall map[int]struct { 22 result1 msgprocessor.Classification 23 } 24 ConfigureStub func(*common.Envelope, uint64) error 25 configureMutex sync.RWMutex 26 configureArgsForCall []struct { 27 arg1 *common.Envelope 28 arg2 uint64 29 } 30 configureReturns struct { 31 result1 error 32 } 33 configureReturnsOnCall map[int]struct { 34 result1 error 35 } 36 OrderStub func(*common.Envelope, uint64) error 37 orderMutex sync.RWMutex 38 orderArgsForCall []struct { 39 arg1 *common.Envelope 40 arg2 uint64 41 } 42 orderReturns struct { 43 result1 error 44 } 45 orderReturnsOnCall map[int]struct { 46 result1 error 47 } 48 ProcessConfigMsgStub func(*common.Envelope) (*common.Envelope, uint64, error) 49 processConfigMsgMutex sync.RWMutex 50 processConfigMsgArgsForCall []struct { 51 arg1 *common.Envelope 52 } 53 processConfigMsgReturns struct { 54 result1 *common.Envelope 55 result2 uint64 56 result3 error 57 } 58 processConfigMsgReturnsOnCall map[int]struct { 59 result1 *common.Envelope 60 result2 uint64 61 result3 error 62 } 63 ProcessConfigUpdateMsgStub func(*common.Envelope) (*common.Envelope, uint64, error) 64 processConfigUpdateMsgMutex sync.RWMutex 65 processConfigUpdateMsgArgsForCall []struct { 66 arg1 *common.Envelope 67 } 68 processConfigUpdateMsgReturns struct { 69 result1 *common.Envelope 70 result2 uint64 71 result3 error 72 } 73 processConfigUpdateMsgReturnsOnCall map[int]struct { 74 result1 *common.Envelope 75 result2 uint64 76 result3 error 77 } 78 ProcessNormalMsgStub func(*common.Envelope) (uint64, error) 79 processNormalMsgMutex sync.RWMutex 80 processNormalMsgArgsForCall []struct { 81 arg1 *common.Envelope 82 } 83 processNormalMsgReturns struct { 84 result1 uint64 85 result2 error 86 } 87 processNormalMsgReturnsOnCall map[int]struct { 88 result1 uint64 89 result2 error 90 } 91 WaitReadyStub func() error 92 waitReadyMutex sync.RWMutex 93 waitReadyArgsForCall []struct { 94 } 95 waitReadyReturns struct { 96 result1 error 97 } 98 waitReadyReturnsOnCall map[int]struct { 99 result1 error 100 } 101 invocations map[string][][]interface{} 102 invocationsMutex sync.RWMutex 103 } 104 105 func (fake *ChannelSupport) ClassifyMsg(arg1 *common.ChannelHeader) msgprocessor.Classification { 106 fake.classifyMsgMutex.Lock() 107 ret, specificReturn := fake.classifyMsgReturnsOnCall[len(fake.classifyMsgArgsForCall)] 108 fake.classifyMsgArgsForCall = append(fake.classifyMsgArgsForCall, struct { 109 arg1 *common.ChannelHeader 110 }{arg1}) 111 fake.recordInvocation("ClassifyMsg", []interface{}{arg1}) 112 fake.classifyMsgMutex.Unlock() 113 if fake.ClassifyMsgStub != nil { 114 return fake.ClassifyMsgStub(arg1) 115 } 116 if specificReturn { 117 return ret.result1 118 } 119 fakeReturns := fake.classifyMsgReturns 120 return fakeReturns.result1 121 } 122 123 func (fake *ChannelSupport) ClassifyMsgCallCount() int { 124 fake.classifyMsgMutex.RLock() 125 defer fake.classifyMsgMutex.RUnlock() 126 return len(fake.classifyMsgArgsForCall) 127 } 128 129 func (fake *ChannelSupport) ClassifyMsgCalls(stub func(*common.ChannelHeader) msgprocessor.Classification) { 130 fake.classifyMsgMutex.Lock() 131 defer fake.classifyMsgMutex.Unlock() 132 fake.ClassifyMsgStub = stub 133 } 134 135 func (fake *ChannelSupport) ClassifyMsgArgsForCall(i int) *common.ChannelHeader { 136 fake.classifyMsgMutex.RLock() 137 defer fake.classifyMsgMutex.RUnlock() 138 argsForCall := fake.classifyMsgArgsForCall[i] 139 return argsForCall.arg1 140 } 141 142 func (fake *ChannelSupport) ClassifyMsgReturns(result1 msgprocessor.Classification) { 143 fake.classifyMsgMutex.Lock() 144 defer fake.classifyMsgMutex.Unlock() 145 fake.ClassifyMsgStub = nil 146 fake.classifyMsgReturns = struct { 147 result1 msgprocessor.Classification 148 }{result1} 149 } 150 151 func (fake *ChannelSupport) ClassifyMsgReturnsOnCall(i int, result1 msgprocessor.Classification) { 152 fake.classifyMsgMutex.Lock() 153 defer fake.classifyMsgMutex.Unlock() 154 fake.ClassifyMsgStub = nil 155 if fake.classifyMsgReturnsOnCall == nil { 156 fake.classifyMsgReturnsOnCall = make(map[int]struct { 157 result1 msgprocessor.Classification 158 }) 159 } 160 fake.classifyMsgReturnsOnCall[i] = struct { 161 result1 msgprocessor.Classification 162 }{result1} 163 } 164 165 func (fake *ChannelSupport) Configure(arg1 *common.Envelope, arg2 uint64) error { 166 fake.configureMutex.Lock() 167 ret, specificReturn := fake.configureReturnsOnCall[len(fake.configureArgsForCall)] 168 fake.configureArgsForCall = append(fake.configureArgsForCall, struct { 169 arg1 *common.Envelope 170 arg2 uint64 171 }{arg1, arg2}) 172 fake.recordInvocation("Configure", []interface{}{arg1, arg2}) 173 fake.configureMutex.Unlock() 174 if fake.ConfigureStub != nil { 175 return fake.ConfigureStub(arg1, arg2) 176 } 177 if specificReturn { 178 return ret.result1 179 } 180 fakeReturns := fake.configureReturns 181 return fakeReturns.result1 182 } 183 184 func (fake *ChannelSupport) ConfigureCallCount() int { 185 fake.configureMutex.RLock() 186 defer fake.configureMutex.RUnlock() 187 return len(fake.configureArgsForCall) 188 } 189 190 func (fake *ChannelSupport) ConfigureCalls(stub func(*common.Envelope, uint64) error) { 191 fake.configureMutex.Lock() 192 defer fake.configureMutex.Unlock() 193 fake.ConfigureStub = stub 194 } 195 196 func (fake *ChannelSupport) ConfigureArgsForCall(i int) (*common.Envelope, uint64) { 197 fake.configureMutex.RLock() 198 defer fake.configureMutex.RUnlock() 199 argsForCall := fake.configureArgsForCall[i] 200 return argsForCall.arg1, argsForCall.arg2 201 } 202 203 func (fake *ChannelSupport) ConfigureReturns(result1 error) { 204 fake.configureMutex.Lock() 205 defer fake.configureMutex.Unlock() 206 fake.ConfigureStub = nil 207 fake.configureReturns = struct { 208 result1 error 209 }{result1} 210 } 211 212 func (fake *ChannelSupport) ConfigureReturnsOnCall(i int, result1 error) { 213 fake.configureMutex.Lock() 214 defer fake.configureMutex.Unlock() 215 fake.ConfigureStub = nil 216 if fake.configureReturnsOnCall == nil { 217 fake.configureReturnsOnCall = make(map[int]struct { 218 result1 error 219 }) 220 } 221 fake.configureReturnsOnCall[i] = struct { 222 result1 error 223 }{result1} 224 } 225 226 func (fake *ChannelSupport) Order(arg1 *common.Envelope, arg2 uint64) error { 227 fake.orderMutex.Lock() 228 ret, specificReturn := fake.orderReturnsOnCall[len(fake.orderArgsForCall)] 229 fake.orderArgsForCall = append(fake.orderArgsForCall, struct { 230 arg1 *common.Envelope 231 arg2 uint64 232 }{arg1, arg2}) 233 fake.recordInvocation("Order", []interface{}{arg1, arg2}) 234 fake.orderMutex.Unlock() 235 if fake.OrderStub != nil { 236 return fake.OrderStub(arg1, arg2) 237 } 238 if specificReturn { 239 return ret.result1 240 } 241 fakeReturns := fake.orderReturns 242 return fakeReturns.result1 243 } 244 245 func (fake *ChannelSupport) OrderCallCount() int { 246 fake.orderMutex.RLock() 247 defer fake.orderMutex.RUnlock() 248 return len(fake.orderArgsForCall) 249 } 250 251 func (fake *ChannelSupport) OrderCalls(stub func(*common.Envelope, uint64) error) { 252 fake.orderMutex.Lock() 253 defer fake.orderMutex.Unlock() 254 fake.OrderStub = stub 255 } 256 257 func (fake *ChannelSupport) OrderArgsForCall(i int) (*common.Envelope, uint64) { 258 fake.orderMutex.RLock() 259 defer fake.orderMutex.RUnlock() 260 argsForCall := fake.orderArgsForCall[i] 261 return argsForCall.arg1, argsForCall.arg2 262 } 263 264 func (fake *ChannelSupport) OrderReturns(result1 error) { 265 fake.orderMutex.Lock() 266 defer fake.orderMutex.Unlock() 267 fake.OrderStub = nil 268 fake.orderReturns = struct { 269 result1 error 270 }{result1} 271 } 272 273 func (fake *ChannelSupport) OrderReturnsOnCall(i int, result1 error) { 274 fake.orderMutex.Lock() 275 defer fake.orderMutex.Unlock() 276 fake.OrderStub = nil 277 if fake.orderReturnsOnCall == nil { 278 fake.orderReturnsOnCall = make(map[int]struct { 279 result1 error 280 }) 281 } 282 fake.orderReturnsOnCall[i] = struct { 283 result1 error 284 }{result1} 285 } 286 287 func (fake *ChannelSupport) ProcessConfigMsg(arg1 *common.Envelope) (*common.Envelope, uint64, error) { 288 fake.processConfigMsgMutex.Lock() 289 ret, specificReturn := fake.processConfigMsgReturnsOnCall[len(fake.processConfigMsgArgsForCall)] 290 fake.processConfigMsgArgsForCall = append(fake.processConfigMsgArgsForCall, struct { 291 arg1 *common.Envelope 292 }{arg1}) 293 fake.recordInvocation("ProcessConfigMsg", []interface{}{arg1}) 294 fake.processConfigMsgMutex.Unlock() 295 if fake.ProcessConfigMsgStub != nil { 296 return fake.ProcessConfigMsgStub(arg1) 297 } 298 if specificReturn { 299 return ret.result1, ret.result2, ret.result3 300 } 301 fakeReturns := fake.processConfigMsgReturns 302 return fakeReturns.result1, fakeReturns.result2, fakeReturns.result3 303 } 304 305 func (fake *ChannelSupport) ProcessConfigMsgCallCount() int { 306 fake.processConfigMsgMutex.RLock() 307 defer fake.processConfigMsgMutex.RUnlock() 308 return len(fake.processConfigMsgArgsForCall) 309 } 310 311 func (fake *ChannelSupport) ProcessConfigMsgCalls(stub func(*common.Envelope) (*common.Envelope, uint64, error)) { 312 fake.processConfigMsgMutex.Lock() 313 defer fake.processConfigMsgMutex.Unlock() 314 fake.ProcessConfigMsgStub = stub 315 } 316 317 func (fake *ChannelSupport) ProcessConfigMsgArgsForCall(i int) *common.Envelope { 318 fake.processConfigMsgMutex.RLock() 319 defer fake.processConfigMsgMutex.RUnlock() 320 argsForCall := fake.processConfigMsgArgsForCall[i] 321 return argsForCall.arg1 322 } 323 324 func (fake *ChannelSupport) ProcessConfigMsgReturns(result1 *common.Envelope, result2 uint64, result3 error) { 325 fake.processConfigMsgMutex.Lock() 326 defer fake.processConfigMsgMutex.Unlock() 327 fake.ProcessConfigMsgStub = nil 328 fake.processConfigMsgReturns = struct { 329 result1 *common.Envelope 330 result2 uint64 331 result3 error 332 }{result1, result2, result3} 333 } 334 335 func (fake *ChannelSupport) ProcessConfigMsgReturnsOnCall(i int, result1 *common.Envelope, result2 uint64, result3 error) { 336 fake.processConfigMsgMutex.Lock() 337 defer fake.processConfigMsgMutex.Unlock() 338 fake.ProcessConfigMsgStub = nil 339 if fake.processConfigMsgReturnsOnCall == nil { 340 fake.processConfigMsgReturnsOnCall = make(map[int]struct { 341 result1 *common.Envelope 342 result2 uint64 343 result3 error 344 }) 345 } 346 fake.processConfigMsgReturnsOnCall[i] = struct { 347 result1 *common.Envelope 348 result2 uint64 349 result3 error 350 }{result1, result2, result3} 351 } 352 353 func (fake *ChannelSupport) ProcessConfigUpdateMsg(arg1 *common.Envelope) (*common.Envelope, uint64, error) { 354 fake.processConfigUpdateMsgMutex.Lock() 355 ret, specificReturn := fake.processConfigUpdateMsgReturnsOnCall[len(fake.processConfigUpdateMsgArgsForCall)] 356 fake.processConfigUpdateMsgArgsForCall = append(fake.processConfigUpdateMsgArgsForCall, struct { 357 arg1 *common.Envelope 358 }{arg1}) 359 fake.recordInvocation("ProcessConfigUpdateMsg", []interface{}{arg1}) 360 fake.processConfigUpdateMsgMutex.Unlock() 361 if fake.ProcessConfigUpdateMsgStub != nil { 362 return fake.ProcessConfigUpdateMsgStub(arg1) 363 } 364 if specificReturn { 365 return ret.result1, ret.result2, ret.result3 366 } 367 fakeReturns := fake.processConfigUpdateMsgReturns 368 return fakeReturns.result1, fakeReturns.result2, fakeReturns.result3 369 } 370 371 func (fake *ChannelSupport) ProcessConfigUpdateMsgCallCount() int { 372 fake.processConfigUpdateMsgMutex.RLock() 373 defer fake.processConfigUpdateMsgMutex.RUnlock() 374 return len(fake.processConfigUpdateMsgArgsForCall) 375 } 376 377 func (fake *ChannelSupport) ProcessConfigUpdateMsgCalls(stub func(*common.Envelope) (*common.Envelope, uint64, error)) { 378 fake.processConfigUpdateMsgMutex.Lock() 379 defer fake.processConfigUpdateMsgMutex.Unlock() 380 fake.ProcessConfigUpdateMsgStub = stub 381 } 382 383 func (fake *ChannelSupport) ProcessConfigUpdateMsgArgsForCall(i int) *common.Envelope { 384 fake.processConfigUpdateMsgMutex.RLock() 385 defer fake.processConfigUpdateMsgMutex.RUnlock() 386 argsForCall := fake.processConfigUpdateMsgArgsForCall[i] 387 return argsForCall.arg1 388 } 389 390 func (fake *ChannelSupport) ProcessConfigUpdateMsgReturns(result1 *common.Envelope, result2 uint64, result3 error) { 391 fake.processConfigUpdateMsgMutex.Lock() 392 defer fake.processConfigUpdateMsgMutex.Unlock() 393 fake.ProcessConfigUpdateMsgStub = nil 394 fake.processConfigUpdateMsgReturns = struct { 395 result1 *common.Envelope 396 result2 uint64 397 result3 error 398 }{result1, result2, result3} 399 } 400 401 func (fake *ChannelSupport) ProcessConfigUpdateMsgReturnsOnCall(i int, result1 *common.Envelope, result2 uint64, result3 error) { 402 fake.processConfigUpdateMsgMutex.Lock() 403 defer fake.processConfigUpdateMsgMutex.Unlock() 404 fake.ProcessConfigUpdateMsgStub = nil 405 if fake.processConfigUpdateMsgReturnsOnCall == nil { 406 fake.processConfigUpdateMsgReturnsOnCall = make(map[int]struct { 407 result1 *common.Envelope 408 result2 uint64 409 result3 error 410 }) 411 } 412 fake.processConfigUpdateMsgReturnsOnCall[i] = struct { 413 result1 *common.Envelope 414 result2 uint64 415 result3 error 416 }{result1, result2, result3} 417 } 418 419 func (fake *ChannelSupport) ProcessNormalMsg(arg1 *common.Envelope) (uint64, error) { 420 fake.processNormalMsgMutex.Lock() 421 ret, specificReturn := fake.processNormalMsgReturnsOnCall[len(fake.processNormalMsgArgsForCall)] 422 fake.processNormalMsgArgsForCall = append(fake.processNormalMsgArgsForCall, struct { 423 arg1 *common.Envelope 424 }{arg1}) 425 fake.recordInvocation("ProcessNormalMsg", []interface{}{arg1}) 426 fake.processNormalMsgMutex.Unlock() 427 if fake.ProcessNormalMsgStub != nil { 428 return fake.ProcessNormalMsgStub(arg1) 429 } 430 if specificReturn { 431 return ret.result1, ret.result2 432 } 433 fakeReturns := fake.processNormalMsgReturns 434 return fakeReturns.result1, fakeReturns.result2 435 } 436 437 func (fake *ChannelSupport) ProcessNormalMsgCallCount() int { 438 fake.processNormalMsgMutex.RLock() 439 defer fake.processNormalMsgMutex.RUnlock() 440 return len(fake.processNormalMsgArgsForCall) 441 } 442 443 func (fake *ChannelSupport) ProcessNormalMsgCalls(stub func(*common.Envelope) (uint64, error)) { 444 fake.processNormalMsgMutex.Lock() 445 defer fake.processNormalMsgMutex.Unlock() 446 fake.ProcessNormalMsgStub = stub 447 } 448 449 func (fake *ChannelSupport) ProcessNormalMsgArgsForCall(i int) *common.Envelope { 450 fake.processNormalMsgMutex.RLock() 451 defer fake.processNormalMsgMutex.RUnlock() 452 argsForCall := fake.processNormalMsgArgsForCall[i] 453 return argsForCall.arg1 454 } 455 456 func (fake *ChannelSupport) ProcessNormalMsgReturns(result1 uint64, result2 error) { 457 fake.processNormalMsgMutex.Lock() 458 defer fake.processNormalMsgMutex.Unlock() 459 fake.ProcessNormalMsgStub = nil 460 fake.processNormalMsgReturns = struct { 461 result1 uint64 462 result2 error 463 }{result1, result2} 464 } 465 466 func (fake *ChannelSupport) ProcessNormalMsgReturnsOnCall(i int, result1 uint64, result2 error) { 467 fake.processNormalMsgMutex.Lock() 468 defer fake.processNormalMsgMutex.Unlock() 469 fake.ProcessNormalMsgStub = nil 470 if fake.processNormalMsgReturnsOnCall == nil { 471 fake.processNormalMsgReturnsOnCall = make(map[int]struct { 472 result1 uint64 473 result2 error 474 }) 475 } 476 fake.processNormalMsgReturnsOnCall[i] = struct { 477 result1 uint64 478 result2 error 479 }{result1, result2} 480 } 481 482 func (fake *ChannelSupport) WaitReady() error { 483 fake.waitReadyMutex.Lock() 484 ret, specificReturn := fake.waitReadyReturnsOnCall[len(fake.waitReadyArgsForCall)] 485 fake.waitReadyArgsForCall = append(fake.waitReadyArgsForCall, struct { 486 }{}) 487 fake.recordInvocation("WaitReady", []interface{}{}) 488 fake.waitReadyMutex.Unlock() 489 if fake.WaitReadyStub != nil { 490 return fake.WaitReadyStub() 491 } 492 if specificReturn { 493 return ret.result1 494 } 495 fakeReturns := fake.waitReadyReturns 496 return fakeReturns.result1 497 } 498 499 func (fake *ChannelSupport) WaitReadyCallCount() int { 500 fake.waitReadyMutex.RLock() 501 defer fake.waitReadyMutex.RUnlock() 502 return len(fake.waitReadyArgsForCall) 503 } 504 505 func (fake *ChannelSupport) WaitReadyCalls(stub func() error) { 506 fake.waitReadyMutex.Lock() 507 defer fake.waitReadyMutex.Unlock() 508 fake.WaitReadyStub = stub 509 } 510 511 func (fake *ChannelSupport) WaitReadyReturns(result1 error) { 512 fake.waitReadyMutex.Lock() 513 defer fake.waitReadyMutex.Unlock() 514 fake.WaitReadyStub = nil 515 fake.waitReadyReturns = struct { 516 result1 error 517 }{result1} 518 } 519 520 func (fake *ChannelSupport) WaitReadyReturnsOnCall(i int, result1 error) { 521 fake.waitReadyMutex.Lock() 522 defer fake.waitReadyMutex.Unlock() 523 fake.WaitReadyStub = nil 524 if fake.waitReadyReturnsOnCall == nil { 525 fake.waitReadyReturnsOnCall = make(map[int]struct { 526 result1 error 527 }) 528 } 529 fake.waitReadyReturnsOnCall[i] = struct { 530 result1 error 531 }{result1} 532 } 533 534 func (fake *ChannelSupport) Invocations() map[string][][]interface{} { 535 fake.invocationsMutex.RLock() 536 defer fake.invocationsMutex.RUnlock() 537 fake.classifyMsgMutex.RLock() 538 defer fake.classifyMsgMutex.RUnlock() 539 fake.configureMutex.RLock() 540 defer fake.configureMutex.RUnlock() 541 fake.orderMutex.RLock() 542 defer fake.orderMutex.RUnlock() 543 fake.processConfigMsgMutex.RLock() 544 defer fake.processConfigMsgMutex.RUnlock() 545 fake.processConfigUpdateMsgMutex.RLock() 546 defer fake.processConfigUpdateMsgMutex.RUnlock() 547 fake.processNormalMsgMutex.RLock() 548 defer fake.processNormalMsgMutex.RUnlock() 549 fake.waitReadyMutex.RLock() 550 defer fake.waitReadyMutex.RUnlock() 551 copiedInvocations := map[string][][]interface{}{} 552 for key, value := range fake.invocations { 553 copiedInvocations[key] = value 554 } 555 return copiedInvocations 556 } 557 558 func (fake *ChannelSupport) recordInvocation(key string, args []interface{}) { 559 fake.invocationsMutex.Lock() 560 defer fake.invocationsMutex.Unlock() 561 if fake.invocations == nil { 562 fake.invocations = map[string][][]interface{}{} 563 } 564 if fake.invocations[key] == nil { 565 fake.invocations[key] = [][]interface{}{} 566 } 567 fake.invocations[key] = append(fake.invocations[key], args) 568 } 569 570 var _ broadcast.ChannelSupport = new(ChannelSupport)