forked from hyperledger/fabric
-
Notifications
You must be signed in to change notification settings - Fork 11
/
mock_consenter_support.go
834 lines (768 loc) · 25.7 KB
/
mock_consenter_support.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
// Code generated by counterfeiter. DO NOT EDIT.
package mocks
import (
"sync"
"github.com/hyperledger/fabric/common/channelconfig"
"github.com/hyperledger/fabric/orderer/common/blockcutter"
"github.com/hyperledger/fabric/orderer/common/msgprocessor"
"github.com/hyperledger/fabric/orderer/consensus"
cb "github.com/hyperledger/fabric/protos/common"
)
type FakeConsenterSupport struct {
NewSignatureHeaderStub func() (*cb.SignatureHeader, error)
newSignatureHeaderMutex sync.RWMutex
newSignatureHeaderArgsForCall []struct{}
newSignatureHeaderReturns struct {
result1 *cb.SignatureHeader
result2 error
}
newSignatureHeaderReturnsOnCall map[int]struct {
result1 *cb.SignatureHeader
result2 error
}
SignStub func(message []byte) ([]byte, error)
signMutex sync.RWMutex
signArgsForCall []struct {
message []byte
}
signReturns struct {
result1 []byte
result2 error
}
signReturnsOnCall map[int]struct {
result1 []byte
result2 error
}
ClassifyMsgStub func(chdr *cb.ChannelHeader) msgprocessor.Classification
classifyMsgMutex sync.RWMutex
classifyMsgArgsForCall []struct {
chdr *cb.ChannelHeader
}
classifyMsgReturns struct {
result1 msgprocessor.Classification
}
classifyMsgReturnsOnCall map[int]struct {
result1 msgprocessor.Classification
}
ProcessNormalMsgStub func(env *cb.Envelope) (configSeq uint64, err error)
processNormalMsgMutex sync.RWMutex
processNormalMsgArgsForCall []struct {
env *cb.Envelope
}
processNormalMsgReturns struct {
result1 uint64
result2 error
}
processNormalMsgReturnsOnCall map[int]struct {
result1 uint64
result2 error
}
ProcessConfigUpdateMsgStub func(env *cb.Envelope) (config *cb.Envelope, configSeq uint64, err error)
processConfigUpdateMsgMutex sync.RWMutex
processConfigUpdateMsgArgsForCall []struct {
env *cb.Envelope
}
processConfigUpdateMsgReturns struct {
result1 *cb.Envelope
result2 uint64
result3 error
}
processConfigUpdateMsgReturnsOnCall map[int]struct {
result1 *cb.Envelope
result2 uint64
result3 error
}
ProcessConfigMsgStub func(env *cb.Envelope) (*cb.Envelope, uint64, error)
processConfigMsgMutex sync.RWMutex
processConfigMsgArgsForCall []struct {
env *cb.Envelope
}
processConfigMsgReturns struct {
result1 *cb.Envelope
result2 uint64
result3 error
}
processConfigMsgReturnsOnCall map[int]struct {
result1 *cb.Envelope
result2 uint64
result3 error
}
BlockCutterStub func() blockcutter.Receiver
blockCutterMutex sync.RWMutex
blockCutterArgsForCall []struct{}
blockCutterReturns struct {
result1 blockcutter.Receiver
}
blockCutterReturnsOnCall map[int]struct {
result1 blockcutter.Receiver
}
SharedConfigStub func() channelconfig.Orderer
sharedConfigMutex sync.RWMutex
sharedConfigArgsForCall []struct{}
sharedConfigReturns struct {
result1 channelconfig.Orderer
}
sharedConfigReturnsOnCall map[int]struct {
result1 channelconfig.Orderer
}
CreateNextBlockStub func(messages []*cb.Envelope) *cb.Block
createNextBlockMutex sync.RWMutex
createNextBlockArgsForCall []struct {
messages []*cb.Envelope
}
createNextBlockReturns struct {
result1 *cb.Block
}
createNextBlockReturnsOnCall map[int]struct {
result1 *cb.Block
}
WriteBlockStub func(block *cb.Block, encodedMetadataValue []byte)
writeBlockMutex sync.RWMutex
writeBlockArgsForCall []struct {
block *cb.Block
encodedMetadataValue []byte
}
WriteConfigBlockStub func(block *cb.Block, encodedMetadataValue []byte)
writeConfigBlockMutex sync.RWMutex
writeConfigBlockArgsForCall []struct {
block *cb.Block
encodedMetadataValue []byte
}
SequenceStub func() uint64
sequenceMutex sync.RWMutex
sequenceArgsForCall []struct{}
sequenceReturns struct {
result1 uint64
}
sequenceReturnsOnCall map[int]struct {
result1 uint64
}
ChainIDStub func() string
chainIDMutex sync.RWMutex
chainIDArgsForCall []struct{}
chainIDReturns struct {
result1 string
}
chainIDReturnsOnCall map[int]struct {
result1 string
}
HeightStub func() uint64
heightMutex sync.RWMutex
heightArgsForCall []struct{}
heightReturns struct {
result1 uint64
}
heightReturnsOnCall map[int]struct {
result1 uint64
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *FakeConsenterSupport) NewSignatureHeader() (*cb.SignatureHeader, error) {
fake.newSignatureHeaderMutex.Lock()
ret, specificReturn := fake.newSignatureHeaderReturnsOnCall[len(fake.newSignatureHeaderArgsForCall)]
fake.newSignatureHeaderArgsForCall = append(fake.newSignatureHeaderArgsForCall, struct{}{})
fake.recordInvocation("NewSignatureHeader", []interface{}{})
fake.newSignatureHeaderMutex.Unlock()
if fake.NewSignatureHeaderStub != nil {
return fake.NewSignatureHeaderStub()
}
if specificReturn {
return ret.result1, ret.result2
}
return fake.newSignatureHeaderReturns.result1, fake.newSignatureHeaderReturns.result2
}
func (fake *FakeConsenterSupport) NewSignatureHeaderCallCount() int {
fake.newSignatureHeaderMutex.RLock()
defer fake.newSignatureHeaderMutex.RUnlock()
return len(fake.newSignatureHeaderArgsForCall)
}
func (fake *FakeConsenterSupport) NewSignatureHeaderReturns(result1 *cb.SignatureHeader, result2 error) {
fake.NewSignatureHeaderStub = nil
fake.newSignatureHeaderReturns = struct {
result1 *cb.SignatureHeader
result2 error
}{result1, result2}
}
func (fake *FakeConsenterSupport) NewSignatureHeaderReturnsOnCall(i int, result1 *cb.SignatureHeader, result2 error) {
fake.NewSignatureHeaderStub = nil
if fake.newSignatureHeaderReturnsOnCall == nil {
fake.newSignatureHeaderReturnsOnCall = make(map[int]struct {
result1 *cb.SignatureHeader
result2 error
})
}
fake.newSignatureHeaderReturnsOnCall[i] = struct {
result1 *cb.SignatureHeader
result2 error
}{result1, result2}
}
func (fake *FakeConsenterSupport) Sign(message []byte) ([]byte, error) {
var messageCopy []byte
if message != nil {
messageCopy = make([]byte, len(message))
copy(messageCopy, message)
}
fake.signMutex.Lock()
ret, specificReturn := fake.signReturnsOnCall[len(fake.signArgsForCall)]
fake.signArgsForCall = append(fake.signArgsForCall, struct {
message []byte
}{messageCopy})
fake.recordInvocation("Sign", []interface{}{messageCopy})
fake.signMutex.Unlock()
if fake.SignStub != nil {
return fake.SignStub(message)
}
if specificReturn {
return ret.result1, ret.result2
}
return fake.signReturns.result1, fake.signReturns.result2
}
func (fake *FakeConsenterSupport) SignCallCount() int {
fake.signMutex.RLock()
defer fake.signMutex.RUnlock()
return len(fake.signArgsForCall)
}
func (fake *FakeConsenterSupport) SignArgsForCall(i int) []byte {
fake.signMutex.RLock()
defer fake.signMutex.RUnlock()
return fake.signArgsForCall[i].message
}
func (fake *FakeConsenterSupport) SignReturns(result1 []byte, result2 error) {
fake.SignStub = nil
fake.signReturns = struct {
result1 []byte
result2 error
}{result1, result2}
}
func (fake *FakeConsenterSupport) SignReturnsOnCall(i int, result1 []byte, result2 error) {
fake.SignStub = nil
if fake.signReturnsOnCall == nil {
fake.signReturnsOnCall = make(map[int]struct {
result1 []byte
result2 error
})
}
fake.signReturnsOnCall[i] = struct {
result1 []byte
result2 error
}{result1, result2}
}
func (fake *FakeConsenterSupport) ClassifyMsg(chdr *cb.ChannelHeader) msgprocessor.Classification {
fake.classifyMsgMutex.Lock()
ret, specificReturn := fake.classifyMsgReturnsOnCall[len(fake.classifyMsgArgsForCall)]
fake.classifyMsgArgsForCall = append(fake.classifyMsgArgsForCall, struct {
chdr *cb.ChannelHeader
}{chdr})
fake.recordInvocation("ClassifyMsg", []interface{}{chdr})
fake.classifyMsgMutex.Unlock()
if fake.ClassifyMsgStub != nil {
return fake.ClassifyMsgStub(chdr)
}
if specificReturn {
return ret.result1
}
return fake.classifyMsgReturns.result1
}
func (fake *FakeConsenterSupport) ClassifyMsgCallCount() int {
fake.classifyMsgMutex.RLock()
defer fake.classifyMsgMutex.RUnlock()
return len(fake.classifyMsgArgsForCall)
}
func (fake *FakeConsenterSupport) ClassifyMsgArgsForCall(i int) *cb.ChannelHeader {
fake.classifyMsgMutex.RLock()
defer fake.classifyMsgMutex.RUnlock()
return fake.classifyMsgArgsForCall[i].chdr
}
func (fake *FakeConsenterSupport) ClassifyMsgReturns(result1 msgprocessor.Classification) {
fake.ClassifyMsgStub = nil
fake.classifyMsgReturns = struct {
result1 msgprocessor.Classification
}{result1}
}
func (fake *FakeConsenterSupport) ClassifyMsgReturnsOnCall(i int, result1 msgprocessor.Classification) {
fake.ClassifyMsgStub = nil
if fake.classifyMsgReturnsOnCall == nil {
fake.classifyMsgReturnsOnCall = make(map[int]struct {
result1 msgprocessor.Classification
})
}
fake.classifyMsgReturnsOnCall[i] = struct {
result1 msgprocessor.Classification
}{result1}
}
func (fake *FakeConsenterSupport) ProcessNormalMsg(env *cb.Envelope) (configSeq uint64, err error) {
fake.processNormalMsgMutex.Lock()
ret, specificReturn := fake.processNormalMsgReturnsOnCall[len(fake.processNormalMsgArgsForCall)]
fake.processNormalMsgArgsForCall = append(fake.processNormalMsgArgsForCall, struct {
env *cb.Envelope
}{env})
fake.recordInvocation("ProcessNormalMsg", []interface{}{env})
fake.processNormalMsgMutex.Unlock()
if fake.ProcessNormalMsgStub != nil {
return fake.ProcessNormalMsgStub(env)
}
if specificReturn {
return ret.result1, ret.result2
}
return fake.processNormalMsgReturns.result1, fake.processNormalMsgReturns.result2
}
func (fake *FakeConsenterSupport) ProcessNormalMsgCallCount() int {
fake.processNormalMsgMutex.RLock()
defer fake.processNormalMsgMutex.RUnlock()
return len(fake.processNormalMsgArgsForCall)
}
func (fake *FakeConsenterSupport) ProcessNormalMsgArgsForCall(i int) *cb.Envelope {
fake.processNormalMsgMutex.RLock()
defer fake.processNormalMsgMutex.RUnlock()
return fake.processNormalMsgArgsForCall[i].env
}
func (fake *FakeConsenterSupport) ProcessNormalMsgReturns(result1 uint64, result2 error) {
fake.ProcessNormalMsgStub = nil
fake.processNormalMsgReturns = struct {
result1 uint64
result2 error
}{result1, result2}
}
func (fake *FakeConsenterSupport) ProcessNormalMsgReturnsOnCall(i int, result1 uint64, result2 error) {
fake.ProcessNormalMsgStub = nil
if fake.processNormalMsgReturnsOnCall == nil {
fake.processNormalMsgReturnsOnCall = make(map[int]struct {
result1 uint64
result2 error
})
}
fake.processNormalMsgReturnsOnCall[i] = struct {
result1 uint64
result2 error
}{result1, result2}
}
func (fake *FakeConsenterSupport) ProcessConfigUpdateMsg(env *cb.Envelope) (config *cb.Envelope, configSeq uint64, err error) {
fake.processConfigUpdateMsgMutex.Lock()
ret, specificReturn := fake.processConfigUpdateMsgReturnsOnCall[len(fake.processConfigUpdateMsgArgsForCall)]
fake.processConfigUpdateMsgArgsForCall = append(fake.processConfigUpdateMsgArgsForCall, struct {
env *cb.Envelope
}{env})
fake.recordInvocation("ProcessConfigUpdateMsg", []interface{}{env})
fake.processConfigUpdateMsgMutex.Unlock()
if fake.ProcessConfigUpdateMsgStub != nil {
return fake.ProcessConfigUpdateMsgStub(env)
}
if specificReturn {
return ret.result1, ret.result2, ret.result3
}
return fake.processConfigUpdateMsgReturns.result1, fake.processConfigUpdateMsgReturns.result2, fake.processConfigUpdateMsgReturns.result3
}
func (fake *FakeConsenterSupport) ProcessConfigUpdateMsgCallCount() int {
fake.processConfigUpdateMsgMutex.RLock()
defer fake.processConfigUpdateMsgMutex.RUnlock()
return len(fake.processConfigUpdateMsgArgsForCall)
}
func (fake *FakeConsenterSupport) ProcessConfigUpdateMsgArgsForCall(i int) *cb.Envelope {
fake.processConfigUpdateMsgMutex.RLock()
defer fake.processConfigUpdateMsgMutex.RUnlock()
return fake.processConfigUpdateMsgArgsForCall[i].env
}
func (fake *FakeConsenterSupport) ProcessConfigUpdateMsgReturns(result1 *cb.Envelope, result2 uint64, result3 error) {
fake.ProcessConfigUpdateMsgStub = nil
fake.processConfigUpdateMsgReturns = struct {
result1 *cb.Envelope
result2 uint64
result3 error
}{result1, result2, result3}
}
func (fake *FakeConsenterSupport) ProcessConfigUpdateMsgReturnsOnCall(i int, result1 *cb.Envelope, result2 uint64, result3 error) {
fake.ProcessConfigUpdateMsgStub = nil
if fake.processConfigUpdateMsgReturnsOnCall == nil {
fake.processConfigUpdateMsgReturnsOnCall = make(map[int]struct {
result1 *cb.Envelope
result2 uint64
result3 error
})
}
fake.processConfigUpdateMsgReturnsOnCall[i] = struct {
result1 *cb.Envelope
result2 uint64
result3 error
}{result1, result2, result3}
}
func (fake *FakeConsenterSupport) ProcessConfigMsg(env *cb.Envelope) (*cb.Envelope, uint64, error) {
fake.processConfigMsgMutex.Lock()
ret, specificReturn := fake.processConfigMsgReturnsOnCall[len(fake.processConfigMsgArgsForCall)]
fake.processConfigMsgArgsForCall = append(fake.processConfigMsgArgsForCall, struct {
env *cb.Envelope
}{env})
fake.recordInvocation("ProcessConfigMsg", []interface{}{env})
fake.processConfigMsgMutex.Unlock()
if fake.ProcessConfigMsgStub != nil {
return fake.ProcessConfigMsgStub(env)
}
if specificReturn {
return ret.result1, ret.result2, ret.result3
}
return fake.processConfigMsgReturns.result1, fake.processConfigMsgReturns.result2, fake.processConfigMsgReturns.result3
}
func (fake *FakeConsenterSupport) ProcessConfigMsgCallCount() int {
fake.processConfigMsgMutex.RLock()
defer fake.processConfigMsgMutex.RUnlock()
return len(fake.processConfigMsgArgsForCall)
}
func (fake *FakeConsenterSupport) ProcessConfigMsgArgsForCall(i int) *cb.Envelope {
fake.processConfigMsgMutex.RLock()
defer fake.processConfigMsgMutex.RUnlock()
return fake.processConfigMsgArgsForCall[i].env
}
func (fake *FakeConsenterSupport) ProcessConfigMsgReturns(result1 *cb.Envelope, result2 uint64, result3 error) {
fake.ProcessConfigMsgStub = nil
fake.processConfigMsgReturns = struct {
result1 *cb.Envelope
result2 uint64
result3 error
}{result1, result2, result3}
}
func (fake *FakeConsenterSupport) ProcessConfigMsgReturnsOnCall(i int, result1 *cb.Envelope, result2 uint64, result3 error) {
fake.ProcessConfigMsgStub = nil
if fake.processConfigMsgReturnsOnCall == nil {
fake.processConfigMsgReturnsOnCall = make(map[int]struct {
result1 *cb.Envelope
result2 uint64
result3 error
})
}
fake.processConfigMsgReturnsOnCall[i] = struct {
result1 *cb.Envelope
result2 uint64
result3 error
}{result1, result2, result3}
}
func (fake *FakeConsenterSupport) BlockCutter() blockcutter.Receiver {
fake.blockCutterMutex.Lock()
ret, specificReturn := fake.blockCutterReturnsOnCall[len(fake.blockCutterArgsForCall)]
fake.blockCutterArgsForCall = append(fake.blockCutterArgsForCall, struct{}{})
fake.recordInvocation("BlockCutter", []interface{}{})
fake.blockCutterMutex.Unlock()
if fake.BlockCutterStub != nil {
return fake.BlockCutterStub()
}
if specificReturn {
return ret.result1
}
return fake.blockCutterReturns.result1
}
func (fake *FakeConsenterSupport) BlockCutterCallCount() int {
fake.blockCutterMutex.RLock()
defer fake.blockCutterMutex.RUnlock()
return len(fake.blockCutterArgsForCall)
}
func (fake *FakeConsenterSupport) BlockCutterReturns(result1 blockcutter.Receiver) {
fake.BlockCutterStub = nil
fake.blockCutterReturns = struct {
result1 blockcutter.Receiver
}{result1}
}
func (fake *FakeConsenterSupport) BlockCutterReturnsOnCall(i int, result1 blockcutter.Receiver) {
fake.BlockCutterStub = nil
if fake.blockCutterReturnsOnCall == nil {
fake.blockCutterReturnsOnCall = make(map[int]struct {
result1 blockcutter.Receiver
})
}
fake.blockCutterReturnsOnCall[i] = struct {
result1 blockcutter.Receiver
}{result1}
}
func (fake *FakeConsenterSupport) SharedConfig() channelconfig.Orderer {
fake.sharedConfigMutex.Lock()
ret, specificReturn := fake.sharedConfigReturnsOnCall[len(fake.sharedConfigArgsForCall)]
fake.sharedConfigArgsForCall = append(fake.sharedConfigArgsForCall, struct{}{})
fake.recordInvocation("SharedConfig", []interface{}{})
fake.sharedConfigMutex.Unlock()
if fake.SharedConfigStub != nil {
return fake.SharedConfigStub()
}
if specificReturn {
return ret.result1
}
return fake.sharedConfigReturns.result1
}
func (fake *FakeConsenterSupport) SharedConfigCallCount() int {
fake.sharedConfigMutex.RLock()
defer fake.sharedConfigMutex.RUnlock()
return len(fake.sharedConfigArgsForCall)
}
func (fake *FakeConsenterSupport) SharedConfigReturns(result1 channelconfig.Orderer) {
fake.SharedConfigStub = nil
fake.sharedConfigReturns = struct {
result1 channelconfig.Orderer
}{result1}
}
func (fake *FakeConsenterSupport) SharedConfigReturnsOnCall(i int, result1 channelconfig.Orderer) {
fake.SharedConfigStub = nil
if fake.sharedConfigReturnsOnCall == nil {
fake.sharedConfigReturnsOnCall = make(map[int]struct {
result1 channelconfig.Orderer
})
}
fake.sharedConfigReturnsOnCall[i] = struct {
result1 channelconfig.Orderer
}{result1}
}
func (fake *FakeConsenterSupport) CreateNextBlock(messages []*cb.Envelope) *cb.Block {
var messagesCopy []*cb.Envelope
if messages != nil {
messagesCopy = make([]*cb.Envelope, len(messages))
copy(messagesCopy, messages)
}
fake.createNextBlockMutex.Lock()
ret, specificReturn := fake.createNextBlockReturnsOnCall[len(fake.createNextBlockArgsForCall)]
fake.createNextBlockArgsForCall = append(fake.createNextBlockArgsForCall, struct {
messages []*cb.Envelope
}{messagesCopy})
fake.recordInvocation("CreateNextBlock", []interface{}{messagesCopy})
fake.createNextBlockMutex.Unlock()
if fake.CreateNextBlockStub != nil {
return fake.CreateNextBlockStub(messages)
}
if specificReturn {
return ret.result1
}
return fake.createNextBlockReturns.result1
}
func (fake *FakeConsenterSupport) CreateNextBlockCallCount() int {
fake.createNextBlockMutex.RLock()
defer fake.createNextBlockMutex.RUnlock()
return len(fake.createNextBlockArgsForCall)
}
func (fake *FakeConsenterSupport) CreateNextBlockArgsForCall(i int) []*cb.Envelope {
fake.createNextBlockMutex.RLock()
defer fake.createNextBlockMutex.RUnlock()
return fake.createNextBlockArgsForCall[i].messages
}
func (fake *FakeConsenterSupport) CreateNextBlockReturns(result1 *cb.Block) {
fake.CreateNextBlockStub = nil
fake.createNextBlockReturns = struct {
result1 *cb.Block
}{result1}
}
func (fake *FakeConsenterSupport) CreateNextBlockReturnsOnCall(i int, result1 *cb.Block) {
fake.CreateNextBlockStub = nil
if fake.createNextBlockReturnsOnCall == nil {
fake.createNextBlockReturnsOnCall = make(map[int]struct {
result1 *cb.Block
})
}
fake.createNextBlockReturnsOnCall[i] = struct {
result1 *cb.Block
}{result1}
}
func (fake *FakeConsenterSupport) WriteBlock(block *cb.Block, encodedMetadataValue []byte) {
var encodedMetadataValueCopy []byte
if encodedMetadataValue != nil {
encodedMetadataValueCopy = make([]byte, len(encodedMetadataValue))
copy(encodedMetadataValueCopy, encodedMetadataValue)
}
fake.writeBlockMutex.Lock()
fake.writeBlockArgsForCall = append(fake.writeBlockArgsForCall, struct {
block *cb.Block
encodedMetadataValue []byte
}{block, encodedMetadataValueCopy})
fake.recordInvocation("WriteBlock", []interface{}{block, encodedMetadataValueCopy})
fake.writeBlockMutex.Unlock()
if fake.WriteBlockStub != nil {
fake.WriteBlockStub(block, encodedMetadataValue)
}
}
func (fake *FakeConsenterSupport) WriteBlockCallCount() int {
fake.writeBlockMutex.RLock()
defer fake.writeBlockMutex.RUnlock()
return len(fake.writeBlockArgsForCall)
}
func (fake *FakeConsenterSupport) WriteBlockArgsForCall(i int) (*cb.Block, []byte) {
fake.writeBlockMutex.RLock()
defer fake.writeBlockMutex.RUnlock()
return fake.writeBlockArgsForCall[i].block, fake.writeBlockArgsForCall[i].encodedMetadataValue
}
func (fake *FakeConsenterSupport) WriteConfigBlock(block *cb.Block, encodedMetadataValue []byte) {
var encodedMetadataValueCopy []byte
if encodedMetadataValue != nil {
encodedMetadataValueCopy = make([]byte, len(encodedMetadataValue))
copy(encodedMetadataValueCopy, encodedMetadataValue)
}
fake.writeConfigBlockMutex.Lock()
fake.writeConfigBlockArgsForCall = append(fake.writeConfigBlockArgsForCall, struct {
block *cb.Block
encodedMetadataValue []byte
}{block, encodedMetadataValueCopy})
fake.recordInvocation("WriteConfigBlock", []interface{}{block, encodedMetadataValueCopy})
fake.writeConfigBlockMutex.Unlock()
if fake.WriteConfigBlockStub != nil {
fake.WriteConfigBlockStub(block, encodedMetadataValue)
}
}
func (fake *FakeConsenterSupport) WriteConfigBlockCallCount() int {
fake.writeConfigBlockMutex.RLock()
defer fake.writeConfigBlockMutex.RUnlock()
return len(fake.writeConfigBlockArgsForCall)
}
func (fake *FakeConsenterSupport) WriteConfigBlockArgsForCall(i int) (*cb.Block, []byte) {
fake.writeConfigBlockMutex.RLock()
defer fake.writeConfigBlockMutex.RUnlock()
return fake.writeConfigBlockArgsForCall[i].block, fake.writeConfigBlockArgsForCall[i].encodedMetadataValue
}
func (fake *FakeConsenterSupport) Sequence() uint64 {
fake.sequenceMutex.Lock()
ret, specificReturn := fake.sequenceReturnsOnCall[len(fake.sequenceArgsForCall)]
fake.sequenceArgsForCall = append(fake.sequenceArgsForCall, struct{}{})
fake.recordInvocation("Sequence", []interface{}{})
fake.sequenceMutex.Unlock()
if fake.SequenceStub != nil {
return fake.SequenceStub()
}
if specificReturn {
return ret.result1
}
return fake.sequenceReturns.result1
}
func (fake *FakeConsenterSupport) SequenceCallCount() int {
fake.sequenceMutex.RLock()
defer fake.sequenceMutex.RUnlock()
return len(fake.sequenceArgsForCall)
}
func (fake *FakeConsenterSupport) SequenceReturns(result1 uint64) {
fake.SequenceStub = nil
fake.sequenceReturns = struct {
result1 uint64
}{result1}
}
func (fake *FakeConsenterSupport) SequenceReturnsOnCall(i int, result1 uint64) {
fake.SequenceStub = nil
if fake.sequenceReturnsOnCall == nil {
fake.sequenceReturnsOnCall = make(map[int]struct {
result1 uint64
})
}
fake.sequenceReturnsOnCall[i] = struct {
result1 uint64
}{result1}
}
func (fake *FakeConsenterSupport) ChainID() string {
fake.chainIDMutex.Lock()
ret, specificReturn := fake.chainIDReturnsOnCall[len(fake.chainIDArgsForCall)]
fake.chainIDArgsForCall = append(fake.chainIDArgsForCall, struct{}{})
fake.recordInvocation("ChainID", []interface{}{})
fake.chainIDMutex.Unlock()
if fake.ChainIDStub != nil {
return fake.ChainIDStub()
}
if specificReturn {
return ret.result1
}
return fake.chainIDReturns.result1
}
func (fake *FakeConsenterSupport) ChainIDCallCount() int {
fake.chainIDMutex.RLock()
defer fake.chainIDMutex.RUnlock()
return len(fake.chainIDArgsForCall)
}
func (fake *FakeConsenterSupport) ChainIDReturns(result1 string) {
fake.ChainIDStub = nil
fake.chainIDReturns = struct {
result1 string
}{result1}
}
func (fake *FakeConsenterSupport) ChainIDReturnsOnCall(i int, result1 string) {
fake.ChainIDStub = nil
if fake.chainIDReturnsOnCall == nil {
fake.chainIDReturnsOnCall = make(map[int]struct {
result1 string
})
}
fake.chainIDReturnsOnCall[i] = struct {
result1 string
}{result1}
}
func (fake *FakeConsenterSupport) Height() uint64 {
fake.heightMutex.Lock()
ret, specificReturn := fake.heightReturnsOnCall[len(fake.heightArgsForCall)]
fake.heightArgsForCall = append(fake.heightArgsForCall, struct{}{})
fake.recordInvocation("Height", []interface{}{})
fake.heightMutex.Unlock()
if fake.HeightStub != nil {
return fake.HeightStub()
}
if specificReturn {
return ret.result1
}
return fake.heightReturns.result1
}
func (fake *FakeConsenterSupport) HeightCallCount() int {
fake.heightMutex.RLock()
defer fake.heightMutex.RUnlock()
return len(fake.heightArgsForCall)
}
func (fake *FakeConsenterSupport) HeightReturns(result1 uint64) {
fake.HeightStub = nil
fake.heightReturns = struct {
result1 uint64
}{result1}
}
func (fake *FakeConsenterSupport) HeightReturnsOnCall(i int, result1 uint64) {
fake.HeightStub = nil
if fake.heightReturnsOnCall == nil {
fake.heightReturnsOnCall = make(map[int]struct {
result1 uint64
})
}
fake.heightReturnsOnCall[i] = struct {
result1 uint64
}{result1}
}
func (fake *FakeConsenterSupport) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.newSignatureHeaderMutex.RLock()
defer fake.newSignatureHeaderMutex.RUnlock()
fake.signMutex.RLock()
defer fake.signMutex.RUnlock()
fake.classifyMsgMutex.RLock()
defer fake.classifyMsgMutex.RUnlock()
fake.processNormalMsgMutex.RLock()
defer fake.processNormalMsgMutex.RUnlock()
fake.processConfigUpdateMsgMutex.RLock()
defer fake.processConfigUpdateMsgMutex.RUnlock()
fake.processConfigMsgMutex.RLock()
defer fake.processConfigMsgMutex.RUnlock()
fake.blockCutterMutex.RLock()
defer fake.blockCutterMutex.RUnlock()
fake.sharedConfigMutex.RLock()
defer fake.sharedConfigMutex.RUnlock()
fake.createNextBlockMutex.RLock()
defer fake.createNextBlockMutex.RUnlock()
fake.writeBlockMutex.RLock()
defer fake.writeBlockMutex.RUnlock()
fake.writeConfigBlockMutex.RLock()
defer fake.writeConfigBlockMutex.RUnlock()
fake.sequenceMutex.RLock()
defer fake.sequenceMutex.RUnlock()
fake.chainIDMutex.RLock()
defer fake.chainIDMutex.RUnlock()
fake.heightMutex.RLock()
defer fake.heightMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
}
return copiedInvocations
}
func (fake *FakeConsenterSupport) recordInvocation(key string, args []interface{}) {
fake.invocationsMutex.Lock()
defer fake.invocationsMutex.Unlock()
if fake.invocations == nil {
fake.invocations = map[string][][]interface{}{}
}
if fake.invocations[key] == nil {
fake.invocations[key] = [][]interface{}{}
}
fake.invocations[key] = append(fake.invocations[key], args)
}
var _ consensus.ConsenterSupport = new(FakeConsenterSupport)