forked from hyperledger/fabric
-
Notifications
You must be signed in to change notification settings - Fork 9
/
msp.go
885 lines (814 loc) · 25.9 KB
/
msp.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
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
// Code generated by counterfeiter. DO NOT EDIT.
package mock
import (
"sync"
mspa "github.com/hyperledger/fabric-protos-go/msp"
"github.com/hyperledger/fabric/msp"
)
type MSP struct {
DeserializeIdentityStub func([]byte) (msp.Identity, error)
deserializeIdentityMutex sync.RWMutex
deserializeIdentityArgsForCall []struct {
arg1 []byte
}
deserializeIdentityReturns struct {
result1 msp.Identity
result2 error
}
deserializeIdentityReturnsOnCall map[int]struct {
result1 msp.Identity
result2 error
}
GetDefaultSigningIdentityStub func() (msp.SigningIdentity, error)
getDefaultSigningIdentityMutex sync.RWMutex
getDefaultSigningIdentityArgsForCall []struct {
}
getDefaultSigningIdentityReturns struct {
result1 msp.SigningIdentity
result2 error
}
getDefaultSigningIdentityReturnsOnCall map[int]struct {
result1 msp.SigningIdentity
result2 error
}
GetIdentifierStub func() (string, error)
getIdentifierMutex sync.RWMutex
getIdentifierArgsForCall []struct {
}
getIdentifierReturns struct {
result1 string
result2 error
}
getIdentifierReturnsOnCall map[int]struct {
result1 string
result2 error
}
GetSigningIdentityStub func(*msp.IdentityIdentifier) (msp.SigningIdentity, error)
getSigningIdentityMutex sync.RWMutex
getSigningIdentityArgsForCall []struct {
arg1 *msp.IdentityIdentifier
}
getSigningIdentityReturns struct {
result1 msp.SigningIdentity
result2 error
}
getSigningIdentityReturnsOnCall map[int]struct {
result1 msp.SigningIdentity
result2 error
}
GetTLSIntermediateCertsStub func() [][]byte
getTLSIntermediateCertsMutex sync.RWMutex
getTLSIntermediateCertsArgsForCall []struct {
}
getTLSIntermediateCertsReturns struct {
result1 [][]byte
}
getTLSIntermediateCertsReturnsOnCall map[int]struct {
result1 [][]byte
}
GetTLSRootCertsStub func() [][]byte
getTLSRootCertsMutex sync.RWMutex
getTLSRootCertsArgsForCall []struct {
}
getTLSRootCertsReturns struct {
result1 [][]byte
}
getTLSRootCertsReturnsOnCall map[int]struct {
result1 [][]byte
}
GetTypeStub func() msp.ProviderType
getTypeMutex sync.RWMutex
getTypeArgsForCall []struct {
}
getTypeReturns struct {
result1 msp.ProviderType
}
getTypeReturnsOnCall map[int]struct {
result1 msp.ProviderType
}
GetVersionStub func() msp.MSPVersion
getVersionMutex sync.RWMutex
getVersionArgsForCall []struct {
}
getVersionReturns struct {
result1 msp.MSPVersion
}
getVersionReturnsOnCall map[int]struct {
result1 msp.MSPVersion
}
IsWellFormedStub func(*mspa.SerializedIdentity) error
isWellFormedMutex sync.RWMutex
isWellFormedArgsForCall []struct {
arg1 *mspa.SerializedIdentity
}
isWellFormedReturns struct {
result1 error
}
isWellFormedReturnsOnCall map[int]struct {
result1 error
}
SatisfiesPrincipalStub func(msp.Identity, *mspa.MSPPrincipal) error
satisfiesPrincipalMutex sync.RWMutex
satisfiesPrincipalArgsForCall []struct {
arg1 msp.Identity
arg2 *mspa.MSPPrincipal
}
satisfiesPrincipalReturns struct {
result1 error
}
satisfiesPrincipalReturnsOnCall map[int]struct {
result1 error
}
SetupStub func(*mspa.MSPConfig) error
setupMutex sync.RWMutex
setupArgsForCall []struct {
arg1 *mspa.MSPConfig
}
setupReturns struct {
result1 error
}
setupReturnsOnCall map[int]struct {
result1 error
}
ValidateStub func(msp.Identity) error
validateMutex sync.RWMutex
validateArgsForCall []struct {
arg1 msp.Identity
}
validateReturns struct {
result1 error
}
validateReturnsOnCall map[int]struct {
result1 error
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *MSP) DeserializeIdentity(arg1 []byte) (msp.Identity, error) {
var arg1Copy []byte
if arg1 != nil {
arg1Copy = make([]byte, len(arg1))
copy(arg1Copy, arg1)
}
fake.deserializeIdentityMutex.Lock()
ret, specificReturn := fake.deserializeIdentityReturnsOnCall[len(fake.deserializeIdentityArgsForCall)]
fake.deserializeIdentityArgsForCall = append(fake.deserializeIdentityArgsForCall, struct {
arg1 []byte
}{arg1Copy})
fake.recordInvocation("DeserializeIdentity", []interface{}{arg1Copy})
fake.deserializeIdentityMutex.Unlock()
if fake.DeserializeIdentityStub != nil {
return fake.DeserializeIdentityStub(arg1)
}
if specificReturn {
return ret.result1, ret.result2
}
fakeReturns := fake.deserializeIdentityReturns
return fakeReturns.result1, fakeReturns.result2
}
func (fake *MSP) DeserializeIdentityCallCount() int {
fake.deserializeIdentityMutex.RLock()
defer fake.deserializeIdentityMutex.RUnlock()
return len(fake.deserializeIdentityArgsForCall)
}
func (fake *MSP) DeserializeIdentityCalls(stub func([]byte) (msp.Identity, error)) {
fake.deserializeIdentityMutex.Lock()
defer fake.deserializeIdentityMutex.Unlock()
fake.DeserializeIdentityStub = stub
}
func (fake *MSP) DeserializeIdentityArgsForCall(i int) []byte {
fake.deserializeIdentityMutex.RLock()
defer fake.deserializeIdentityMutex.RUnlock()
argsForCall := fake.deserializeIdentityArgsForCall[i]
return argsForCall.arg1
}
func (fake *MSP) DeserializeIdentityReturns(result1 msp.Identity, result2 error) {
fake.deserializeIdentityMutex.Lock()
defer fake.deserializeIdentityMutex.Unlock()
fake.DeserializeIdentityStub = nil
fake.deserializeIdentityReturns = struct {
result1 msp.Identity
result2 error
}{result1, result2}
}
func (fake *MSP) DeserializeIdentityReturnsOnCall(i int, result1 msp.Identity, result2 error) {
fake.deserializeIdentityMutex.Lock()
defer fake.deserializeIdentityMutex.Unlock()
fake.DeserializeIdentityStub = nil
if fake.deserializeIdentityReturnsOnCall == nil {
fake.deserializeIdentityReturnsOnCall = make(map[int]struct {
result1 msp.Identity
result2 error
})
}
fake.deserializeIdentityReturnsOnCall[i] = struct {
result1 msp.Identity
result2 error
}{result1, result2}
}
func (fake *MSP) GetDefaultSigningIdentity() (msp.SigningIdentity, error) {
fake.getDefaultSigningIdentityMutex.Lock()
ret, specificReturn := fake.getDefaultSigningIdentityReturnsOnCall[len(fake.getDefaultSigningIdentityArgsForCall)]
fake.getDefaultSigningIdentityArgsForCall = append(fake.getDefaultSigningIdentityArgsForCall, struct {
}{})
fake.recordInvocation("GetDefaultSigningIdentity", []interface{}{})
fake.getDefaultSigningIdentityMutex.Unlock()
if fake.GetDefaultSigningIdentityStub != nil {
return fake.GetDefaultSigningIdentityStub()
}
if specificReturn {
return ret.result1, ret.result2
}
fakeReturns := fake.getDefaultSigningIdentityReturns
return fakeReturns.result1, fakeReturns.result2
}
func (fake *MSP) GetDefaultSigningIdentityCallCount() int {
fake.getDefaultSigningIdentityMutex.RLock()
defer fake.getDefaultSigningIdentityMutex.RUnlock()
return len(fake.getDefaultSigningIdentityArgsForCall)
}
func (fake *MSP) GetDefaultSigningIdentityCalls(stub func() (msp.SigningIdentity, error)) {
fake.getDefaultSigningIdentityMutex.Lock()
defer fake.getDefaultSigningIdentityMutex.Unlock()
fake.GetDefaultSigningIdentityStub = stub
}
func (fake *MSP) GetDefaultSigningIdentityReturns(result1 msp.SigningIdentity, result2 error) {
fake.getDefaultSigningIdentityMutex.Lock()
defer fake.getDefaultSigningIdentityMutex.Unlock()
fake.GetDefaultSigningIdentityStub = nil
fake.getDefaultSigningIdentityReturns = struct {
result1 msp.SigningIdentity
result2 error
}{result1, result2}
}
func (fake *MSP) GetDefaultSigningIdentityReturnsOnCall(i int, result1 msp.SigningIdentity, result2 error) {
fake.getDefaultSigningIdentityMutex.Lock()
defer fake.getDefaultSigningIdentityMutex.Unlock()
fake.GetDefaultSigningIdentityStub = nil
if fake.getDefaultSigningIdentityReturnsOnCall == nil {
fake.getDefaultSigningIdentityReturnsOnCall = make(map[int]struct {
result1 msp.SigningIdentity
result2 error
})
}
fake.getDefaultSigningIdentityReturnsOnCall[i] = struct {
result1 msp.SigningIdentity
result2 error
}{result1, result2}
}
func (fake *MSP) GetIdentifier() (string, error) {
fake.getIdentifierMutex.Lock()
ret, specificReturn := fake.getIdentifierReturnsOnCall[len(fake.getIdentifierArgsForCall)]
fake.getIdentifierArgsForCall = append(fake.getIdentifierArgsForCall, struct {
}{})
fake.recordInvocation("GetIdentifier", []interface{}{})
fake.getIdentifierMutex.Unlock()
if fake.GetIdentifierStub != nil {
return fake.GetIdentifierStub()
}
if specificReturn {
return ret.result1, ret.result2
}
fakeReturns := fake.getIdentifierReturns
return fakeReturns.result1, fakeReturns.result2
}
func (fake *MSP) GetIdentifierCallCount() int {
fake.getIdentifierMutex.RLock()
defer fake.getIdentifierMutex.RUnlock()
return len(fake.getIdentifierArgsForCall)
}
func (fake *MSP) GetIdentifierCalls(stub func() (string, error)) {
fake.getIdentifierMutex.Lock()
defer fake.getIdentifierMutex.Unlock()
fake.GetIdentifierStub = stub
}
func (fake *MSP) GetIdentifierReturns(result1 string, result2 error) {
fake.getIdentifierMutex.Lock()
defer fake.getIdentifierMutex.Unlock()
fake.GetIdentifierStub = nil
fake.getIdentifierReturns = struct {
result1 string
result2 error
}{result1, result2}
}
func (fake *MSP) GetIdentifierReturnsOnCall(i int, result1 string, result2 error) {
fake.getIdentifierMutex.Lock()
defer fake.getIdentifierMutex.Unlock()
fake.GetIdentifierStub = nil
if fake.getIdentifierReturnsOnCall == nil {
fake.getIdentifierReturnsOnCall = make(map[int]struct {
result1 string
result2 error
})
}
fake.getIdentifierReturnsOnCall[i] = struct {
result1 string
result2 error
}{result1, result2}
}
func (fake *MSP) GetSigningIdentity(arg1 *msp.IdentityIdentifier) (msp.SigningIdentity, error) {
fake.getSigningIdentityMutex.Lock()
ret, specificReturn := fake.getSigningIdentityReturnsOnCall[len(fake.getSigningIdentityArgsForCall)]
fake.getSigningIdentityArgsForCall = append(fake.getSigningIdentityArgsForCall, struct {
arg1 *msp.IdentityIdentifier
}{arg1})
fake.recordInvocation("GetSigningIdentity", []interface{}{arg1})
fake.getSigningIdentityMutex.Unlock()
if fake.GetSigningIdentityStub != nil {
return fake.GetSigningIdentityStub(arg1)
}
if specificReturn {
return ret.result1, ret.result2
}
fakeReturns := fake.getSigningIdentityReturns
return fakeReturns.result1, fakeReturns.result2
}
func (fake *MSP) GetSigningIdentityCallCount() int {
fake.getSigningIdentityMutex.RLock()
defer fake.getSigningIdentityMutex.RUnlock()
return len(fake.getSigningIdentityArgsForCall)
}
func (fake *MSP) GetSigningIdentityCalls(stub func(*msp.IdentityIdentifier) (msp.SigningIdentity, error)) {
fake.getSigningIdentityMutex.Lock()
defer fake.getSigningIdentityMutex.Unlock()
fake.GetSigningIdentityStub = stub
}
func (fake *MSP) GetSigningIdentityArgsForCall(i int) *msp.IdentityIdentifier {
fake.getSigningIdentityMutex.RLock()
defer fake.getSigningIdentityMutex.RUnlock()
argsForCall := fake.getSigningIdentityArgsForCall[i]
return argsForCall.arg1
}
func (fake *MSP) GetSigningIdentityReturns(result1 msp.SigningIdentity, result2 error) {
fake.getSigningIdentityMutex.Lock()
defer fake.getSigningIdentityMutex.Unlock()
fake.GetSigningIdentityStub = nil
fake.getSigningIdentityReturns = struct {
result1 msp.SigningIdentity
result2 error
}{result1, result2}
}
func (fake *MSP) GetSigningIdentityReturnsOnCall(i int, result1 msp.SigningIdentity, result2 error) {
fake.getSigningIdentityMutex.Lock()
defer fake.getSigningIdentityMutex.Unlock()
fake.GetSigningIdentityStub = nil
if fake.getSigningIdentityReturnsOnCall == nil {
fake.getSigningIdentityReturnsOnCall = make(map[int]struct {
result1 msp.SigningIdentity
result2 error
})
}
fake.getSigningIdentityReturnsOnCall[i] = struct {
result1 msp.SigningIdentity
result2 error
}{result1, result2}
}
func (fake *MSP) GetTLSIntermediateCerts() [][]byte {
fake.getTLSIntermediateCertsMutex.Lock()
ret, specificReturn := fake.getTLSIntermediateCertsReturnsOnCall[len(fake.getTLSIntermediateCertsArgsForCall)]
fake.getTLSIntermediateCertsArgsForCall = append(fake.getTLSIntermediateCertsArgsForCall, struct {
}{})
fake.recordInvocation("GetTLSIntermediateCerts", []interface{}{})
fake.getTLSIntermediateCertsMutex.Unlock()
if fake.GetTLSIntermediateCertsStub != nil {
return fake.GetTLSIntermediateCertsStub()
}
if specificReturn {
return ret.result1
}
fakeReturns := fake.getTLSIntermediateCertsReturns
return fakeReturns.result1
}
func (fake *MSP) GetTLSIntermediateCertsCallCount() int {
fake.getTLSIntermediateCertsMutex.RLock()
defer fake.getTLSIntermediateCertsMutex.RUnlock()
return len(fake.getTLSIntermediateCertsArgsForCall)
}
func (fake *MSP) GetTLSIntermediateCertsCalls(stub func() [][]byte) {
fake.getTLSIntermediateCertsMutex.Lock()
defer fake.getTLSIntermediateCertsMutex.Unlock()
fake.GetTLSIntermediateCertsStub = stub
}
func (fake *MSP) GetTLSIntermediateCertsReturns(result1 [][]byte) {
fake.getTLSIntermediateCertsMutex.Lock()
defer fake.getTLSIntermediateCertsMutex.Unlock()
fake.GetTLSIntermediateCertsStub = nil
fake.getTLSIntermediateCertsReturns = struct {
result1 [][]byte
}{result1}
}
func (fake *MSP) GetTLSIntermediateCertsReturnsOnCall(i int, result1 [][]byte) {
fake.getTLSIntermediateCertsMutex.Lock()
defer fake.getTLSIntermediateCertsMutex.Unlock()
fake.GetTLSIntermediateCertsStub = nil
if fake.getTLSIntermediateCertsReturnsOnCall == nil {
fake.getTLSIntermediateCertsReturnsOnCall = make(map[int]struct {
result1 [][]byte
})
}
fake.getTLSIntermediateCertsReturnsOnCall[i] = struct {
result1 [][]byte
}{result1}
}
func (fake *MSP) GetTLSRootCerts() [][]byte {
fake.getTLSRootCertsMutex.Lock()
ret, specificReturn := fake.getTLSRootCertsReturnsOnCall[len(fake.getTLSRootCertsArgsForCall)]
fake.getTLSRootCertsArgsForCall = append(fake.getTLSRootCertsArgsForCall, struct {
}{})
fake.recordInvocation("GetTLSRootCerts", []interface{}{})
fake.getTLSRootCertsMutex.Unlock()
if fake.GetTLSRootCertsStub != nil {
return fake.GetTLSRootCertsStub()
}
if specificReturn {
return ret.result1
}
fakeReturns := fake.getTLSRootCertsReturns
return fakeReturns.result1
}
func (fake *MSP) GetTLSRootCertsCallCount() int {
fake.getTLSRootCertsMutex.RLock()
defer fake.getTLSRootCertsMutex.RUnlock()
return len(fake.getTLSRootCertsArgsForCall)
}
func (fake *MSP) GetTLSRootCertsCalls(stub func() [][]byte) {
fake.getTLSRootCertsMutex.Lock()
defer fake.getTLSRootCertsMutex.Unlock()
fake.GetTLSRootCertsStub = stub
}
func (fake *MSP) GetTLSRootCertsReturns(result1 [][]byte) {
fake.getTLSRootCertsMutex.Lock()
defer fake.getTLSRootCertsMutex.Unlock()
fake.GetTLSRootCertsStub = nil
fake.getTLSRootCertsReturns = struct {
result1 [][]byte
}{result1}
}
func (fake *MSP) GetTLSRootCertsReturnsOnCall(i int, result1 [][]byte) {
fake.getTLSRootCertsMutex.Lock()
defer fake.getTLSRootCertsMutex.Unlock()
fake.GetTLSRootCertsStub = nil
if fake.getTLSRootCertsReturnsOnCall == nil {
fake.getTLSRootCertsReturnsOnCall = make(map[int]struct {
result1 [][]byte
})
}
fake.getTLSRootCertsReturnsOnCall[i] = struct {
result1 [][]byte
}{result1}
}
func (fake *MSP) GetType() msp.ProviderType {
fake.getTypeMutex.Lock()
ret, specificReturn := fake.getTypeReturnsOnCall[len(fake.getTypeArgsForCall)]
fake.getTypeArgsForCall = append(fake.getTypeArgsForCall, struct {
}{})
fake.recordInvocation("GetType", []interface{}{})
fake.getTypeMutex.Unlock()
if fake.GetTypeStub != nil {
return fake.GetTypeStub()
}
if specificReturn {
return ret.result1
}
fakeReturns := fake.getTypeReturns
return fakeReturns.result1
}
func (fake *MSP) GetTypeCallCount() int {
fake.getTypeMutex.RLock()
defer fake.getTypeMutex.RUnlock()
return len(fake.getTypeArgsForCall)
}
func (fake *MSP) GetTypeCalls(stub func() msp.ProviderType) {
fake.getTypeMutex.Lock()
defer fake.getTypeMutex.Unlock()
fake.GetTypeStub = stub
}
func (fake *MSP) GetTypeReturns(result1 msp.ProviderType) {
fake.getTypeMutex.Lock()
defer fake.getTypeMutex.Unlock()
fake.GetTypeStub = nil
fake.getTypeReturns = struct {
result1 msp.ProviderType
}{result1}
}
func (fake *MSP) GetTypeReturnsOnCall(i int, result1 msp.ProviderType) {
fake.getTypeMutex.Lock()
defer fake.getTypeMutex.Unlock()
fake.GetTypeStub = nil
if fake.getTypeReturnsOnCall == nil {
fake.getTypeReturnsOnCall = make(map[int]struct {
result1 msp.ProviderType
})
}
fake.getTypeReturnsOnCall[i] = struct {
result1 msp.ProviderType
}{result1}
}
func (fake *MSP) GetVersion() msp.MSPVersion {
fake.getVersionMutex.Lock()
ret, specificReturn := fake.getVersionReturnsOnCall[len(fake.getVersionArgsForCall)]
fake.getVersionArgsForCall = append(fake.getVersionArgsForCall, struct {
}{})
fake.recordInvocation("GetVersion", []interface{}{})
fake.getVersionMutex.Unlock()
if fake.GetVersionStub != nil {
return fake.GetVersionStub()
}
if specificReturn {
return ret.result1
}
fakeReturns := fake.getVersionReturns
return fakeReturns.result1
}
func (fake *MSP) GetVersionCallCount() int {
fake.getVersionMutex.RLock()
defer fake.getVersionMutex.RUnlock()
return len(fake.getVersionArgsForCall)
}
func (fake *MSP) GetVersionCalls(stub func() msp.MSPVersion) {
fake.getVersionMutex.Lock()
defer fake.getVersionMutex.Unlock()
fake.GetVersionStub = stub
}
func (fake *MSP) GetVersionReturns(result1 msp.MSPVersion) {
fake.getVersionMutex.Lock()
defer fake.getVersionMutex.Unlock()
fake.GetVersionStub = nil
fake.getVersionReturns = struct {
result1 msp.MSPVersion
}{result1}
}
func (fake *MSP) GetVersionReturnsOnCall(i int, result1 msp.MSPVersion) {
fake.getVersionMutex.Lock()
defer fake.getVersionMutex.Unlock()
fake.GetVersionStub = nil
if fake.getVersionReturnsOnCall == nil {
fake.getVersionReturnsOnCall = make(map[int]struct {
result1 msp.MSPVersion
})
}
fake.getVersionReturnsOnCall[i] = struct {
result1 msp.MSPVersion
}{result1}
}
func (fake *MSP) IsWellFormed(arg1 *mspa.SerializedIdentity) error {
fake.isWellFormedMutex.Lock()
ret, specificReturn := fake.isWellFormedReturnsOnCall[len(fake.isWellFormedArgsForCall)]
fake.isWellFormedArgsForCall = append(fake.isWellFormedArgsForCall, struct {
arg1 *mspa.SerializedIdentity
}{arg1})
fake.recordInvocation("IsWellFormed", []interface{}{arg1})
fake.isWellFormedMutex.Unlock()
if fake.IsWellFormedStub != nil {
return fake.IsWellFormedStub(arg1)
}
if specificReturn {
return ret.result1
}
fakeReturns := fake.isWellFormedReturns
return fakeReturns.result1
}
func (fake *MSP) IsWellFormedCallCount() int {
fake.isWellFormedMutex.RLock()
defer fake.isWellFormedMutex.RUnlock()
return len(fake.isWellFormedArgsForCall)
}
func (fake *MSP) IsWellFormedCalls(stub func(*mspa.SerializedIdentity) error) {
fake.isWellFormedMutex.Lock()
defer fake.isWellFormedMutex.Unlock()
fake.IsWellFormedStub = stub
}
func (fake *MSP) IsWellFormedArgsForCall(i int) *mspa.SerializedIdentity {
fake.isWellFormedMutex.RLock()
defer fake.isWellFormedMutex.RUnlock()
argsForCall := fake.isWellFormedArgsForCall[i]
return argsForCall.arg1
}
func (fake *MSP) IsWellFormedReturns(result1 error) {
fake.isWellFormedMutex.Lock()
defer fake.isWellFormedMutex.Unlock()
fake.IsWellFormedStub = nil
fake.isWellFormedReturns = struct {
result1 error
}{result1}
}
func (fake *MSP) IsWellFormedReturnsOnCall(i int, result1 error) {
fake.isWellFormedMutex.Lock()
defer fake.isWellFormedMutex.Unlock()
fake.IsWellFormedStub = nil
if fake.isWellFormedReturnsOnCall == nil {
fake.isWellFormedReturnsOnCall = make(map[int]struct {
result1 error
})
}
fake.isWellFormedReturnsOnCall[i] = struct {
result1 error
}{result1}
}
func (fake *MSP) SatisfiesPrincipal(arg1 msp.Identity, arg2 *mspa.MSPPrincipal) error {
fake.satisfiesPrincipalMutex.Lock()
ret, specificReturn := fake.satisfiesPrincipalReturnsOnCall[len(fake.satisfiesPrincipalArgsForCall)]
fake.satisfiesPrincipalArgsForCall = append(fake.satisfiesPrincipalArgsForCall, struct {
arg1 msp.Identity
arg2 *mspa.MSPPrincipal
}{arg1, arg2})
fake.recordInvocation("SatisfiesPrincipal", []interface{}{arg1, arg2})
fake.satisfiesPrincipalMutex.Unlock()
if fake.SatisfiesPrincipalStub != nil {
return fake.SatisfiesPrincipalStub(arg1, arg2)
}
if specificReturn {
return ret.result1
}
fakeReturns := fake.satisfiesPrincipalReturns
return fakeReturns.result1
}
func (fake *MSP) SatisfiesPrincipalCallCount() int {
fake.satisfiesPrincipalMutex.RLock()
defer fake.satisfiesPrincipalMutex.RUnlock()
return len(fake.satisfiesPrincipalArgsForCall)
}
func (fake *MSP) SatisfiesPrincipalCalls(stub func(msp.Identity, *mspa.MSPPrincipal) error) {
fake.satisfiesPrincipalMutex.Lock()
defer fake.satisfiesPrincipalMutex.Unlock()
fake.SatisfiesPrincipalStub = stub
}
func (fake *MSP) SatisfiesPrincipalArgsForCall(i int) (msp.Identity, *mspa.MSPPrincipal) {
fake.satisfiesPrincipalMutex.RLock()
defer fake.satisfiesPrincipalMutex.RUnlock()
argsForCall := fake.satisfiesPrincipalArgsForCall[i]
return argsForCall.arg1, argsForCall.arg2
}
func (fake *MSP) SatisfiesPrincipalReturns(result1 error) {
fake.satisfiesPrincipalMutex.Lock()
defer fake.satisfiesPrincipalMutex.Unlock()
fake.SatisfiesPrincipalStub = nil
fake.satisfiesPrincipalReturns = struct {
result1 error
}{result1}
}
func (fake *MSP) SatisfiesPrincipalReturnsOnCall(i int, result1 error) {
fake.satisfiesPrincipalMutex.Lock()
defer fake.satisfiesPrincipalMutex.Unlock()
fake.SatisfiesPrincipalStub = nil
if fake.satisfiesPrincipalReturnsOnCall == nil {
fake.satisfiesPrincipalReturnsOnCall = make(map[int]struct {
result1 error
})
}
fake.satisfiesPrincipalReturnsOnCall[i] = struct {
result1 error
}{result1}
}
func (fake *MSP) Setup(arg1 *mspa.MSPConfig) error {
fake.setupMutex.Lock()
ret, specificReturn := fake.setupReturnsOnCall[len(fake.setupArgsForCall)]
fake.setupArgsForCall = append(fake.setupArgsForCall, struct {
arg1 *mspa.MSPConfig
}{arg1})
fake.recordInvocation("Setup", []interface{}{arg1})
fake.setupMutex.Unlock()
if fake.SetupStub != nil {
return fake.SetupStub(arg1)
}
if specificReturn {
return ret.result1
}
fakeReturns := fake.setupReturns
return fakeReturns.result1
}
func (fake *MSP) SetupCallCount() int {
fake.setupMutex.RLock()
defer fake.setupMutex.RUnlock()
return len(fake.setupArgsForCall)
}
func (fake *MSP) SetupCalls(stub func(*mspa.MSPConfig) error) {
fake.setupMutex.Lock()
defer fake.setupMutex.Unlock()
fake.SetupStub = stub
}
func (fake *MSP) SetupArgsForCall(i int) *mspa.MSPConfig {
fake.setupMutex.RLock()
defer fake.setupMutex.RUnlock()
argsForCall := fake.setupArgsForCall[i]
return argsForCall.arg1
}
func (fake *MSP) SetupReturns(result1 error) {
fake.setupMutex.Lock()
defer fake.setupMutex.Unlock()
fake.SetupStub = nil
fake.setupReturns = struct {
result1 error
}{result1}
}
func (fake *MSP) SetupReturnsOnCall(i int, result1 error) {
fake.setupMutex.Lock()
defer fake.setupMutex.Unlock()
fake.SetupStub = nil
if fake.setupReturnsOnCall == nil {
fake.setupReturnsOnCall = make(map[int]struct {
result1 error
})
}
fake.setupReturnsOnCall[i] = struct {
result1 error
}{result1}
}
func (fake *MSP) Validate(arg1 msp.Identity) error {
fake.validateMutex.Lock()
ret, specificReturn := fake.validateReturnsOnCall[len(fake.validateArgsForCall)]
fake.validateArgsForCall = append(fake.validateArgsForCall, struct {
arg1 msp.Identity
}{arg1})
fake.recordInvocation("Validate", []interface{}{arg1})
fake.validateMutex.Unlock()
if fake.ValidateStub != nil {
return fake.ValidateStub(arg1)
}
if specificReturn {
return ret.result1
}
fakeReturns := fake.validateReturns
return fakeReturns.result1
}
func (fake *MSP) ValidateCallCount() int {
fake.validateMutex.RLock()
defer fake.validateMutex.RUnlock()
return len(fake.validateArgsForCall)
}
func (fake *MSP) ValidateCalls(stub func(msp.Identity) error) {
fake.validateMutex.Lock()
defer fake.validateMutex.Unlock()
fake.ValidateStub = stub
}
func (fake *MSP) ValidateArgsForCall(i int) msp.Identity {
fake.validateMutex.RLock()
defer fake.validateMutex.RUnlock()
argsForCall := fake.validateArgsForCall[i]
return argsForCall.arg1
}
func (fake *MSP) ValidateReturns(result1 error) {
fake.validateMutex.Lock()
defer fake.validateMutex.Unlock()
fake.ValidateStub = nil
fake.validateReturns = struct {
result1 error
}{result1}
}
func (fake *MSP) ValidateReturnsOnCall(i int, result1 error) {
fake.validateMutex.Lock()
defer fake.validateMutex.Unlock()
fake.ValidateStub = nil
if fake.validateReturnsOnCall == nil {
fake.validateReturnsOnCall = make(map[int]struct {
result1 error
})
}
fake.validateReturnsOnCall[i] = struct {
result1 error
}{result1}
}
func (fake *MSP) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.deserializeIdentityMutex.RLock()
defer fake.deserializeIdentityMutex.RUnlock()
fake.getDefaultSigningIdentityMutex.RLock()
defer fake.getDefaultSigningIdentityMutex.RUnlock()
fake.getIdentifierMutex.RLock()
defer fake.getIdentifierMutex.RUnlock()
fake.getSigningIdentityMutex.RLock()
defer fake.getSigningIdentityMutex.RUnlock()
fake.getTLSIntermediateCertsMutex.RLock()
defer fake.getTLSIntermediateCertsMutex.RUnlock()
fake.getTLSRootCertsMutex.RLock()
defer fake.getTLSRootCertsMutex.RUnlock()
fake.getTypeMutex.RLock()
defer fake.getTypeMutex.RUnlock()
fake.getVersionMutex.RLock()
defer fake.getVersionMutex.RUnlock()
fake.isWellFormedMutex.RLock()
defer fake.isWellFormedMutex.RUnlock()
fake.satisfiesPrincipalMutex.RLock()
defer fake.satisfiesPrincipalMutex.RUnlock()
fake.setupMutex.RLock()
defer fake.setupMutex.RUnlock()
fake.validateMutex.RLock()
defer fake.validateMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
}
return copiedInvocations
}
func (fake *MSP) 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)
}