-
Notifications
You must be signed in to change notification settings - Fork 114
/
expected_keepers.go
4650 lines (4360 loc) · 184 KB
/
expected_keepers.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
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Code generated by moq; DO NOT EDIT.
// github.com/matryer/moq
package mock
import (
context "context"
"crypto/ecdsa"
utils "github.com/axelarnetwork/axelar-core/utils"
nexus "github.com/axelarnetwork/axelar-core/x/nexus/exported"
reward "github.com/axelarnetwork/axelar-core/x/reward/exported"
github_com_axelarnetwork_axelar_core_x_snapshot_exported "github.com/axelarnetwork/axelar-core/x/snapshot/exported"
github_com_axelarnetwork_axelar_core_x_tss_exported "github.com/axelarnetwork/axelar-core/x/tss/exported"
tofnd "github.com/axelarnetwork/axelar-core/x/tss/tofnd"
"github.com/axelarnetwork/axelar-core/x/tss/types"
exported1 "github.com/axelarnetwork/axelar-core/x/vote/exported"
github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
"github.com/tendermint/tendermint/libs/log"
grpc "google.golang.org/grpc"
"google.golang.org/grpc/metadata"
"sync"
)
// Ensure, that TofndClientMock does implement types.TofndClient.
// If this is not the case, regenerate this file with moq.
var _ types.TofndClient = &TofndClientMock{}
// TofndClientMock is a mock implementation of types.TofndClient.
//
// func TestSomethingThatUsesTofndClient(t *testing.T) {
//
// // make and configure a mocked types.TofndClient
// mockedTofndClient := &TofndClientMock{
// KeyPresenceFunc: func(ctx context.Context, in *tofnd.KeyPresenceRequest, opts ...grpc.CallOption) (*tofnd.KeyPresenceResponse, error) {
// panic("mock out the KeyPresence method")
// },
// KeygenFunc: func(ctx context.Context, opts ...grpc.CallOption) (tofnd.GG20_KeygenClient, error) {
// panic("mock out the Keygen method")
// },
// RecoverFunc: func(ctx context.Context, in *tofnd.RecoverRequest, opts ...grpc.CallOption) (*tofnd.RecoverResponse, error) {
// panic("mock out the Recover method")
// },
// SignFunc: func(ctx context.Context, opts ...grpc.CallOption) (tofnd.GG20_SignClient, error) {
// panic("mock out the Sign method")
// },
// }
//
// // use mockedTofndClient in code that requires types.TofndClient
// // and then make assertions.
//
// }
type TofndClientMock struct {
// KeyPresenceFunc mocks the KeyPresence method.
KeyPresenceFunc func(ctx context.Context, in *tofnd.KeyPresenceRequest, opts ...grpc.CallOption) (*tofnd.KeyPresenceResponse, error)
// KeygenFunc mocks the Keygen method.
KeygenFunc func(ctx context.Context, opts ...grpc.CallOption) (tofnd.GG20_KeygenClient, error)
// RecoverFunc mocks the Recover method.
RecoverFunc func(ctx context.Context, in *tofnd.RecoverRequest, opts ...grpc.CallOption) (*tofnd.RecoverResponse, error)
// SignFunc mocks the Sign method.
SignFunc func(ctx context.Context, opts ...grpc.CallOption) (tofnd.GG20_SignClient, error)
// calls tracks calls to the methods.
calls struct {
// KeyPresence holds details about calls to the KeyPresence method.
KeyPresence []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// In is the in argument value.
In *tofnd.KeyPresenceRequest
// Opts is the opts argument value.
Opts []grpc.CallOption
}
// Keygen holds details about calls to the Keygen method.
Keygen []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// Opts is the opts argument value.
Opts []grpc.CallOption
}
// Recover holds details about calls to the Recover method.
Recover []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// In is the in argument value.
In *tofnd.RecoverRequest
// Opts is the opts argument value.
Opts []grpc.CallOption
}
// Sign holds details about calls to the Sign method.
Sign []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// Opts is the opts argument value.
Opts []grpc.CallOption
}
}
lockKeyPresence sync.RWMutex
lockKeygen sync.RWMutex
lockRecover sync.RWMutex
lockSign sync.RWMutex
}
// KeyPresence calls KeyPresenceFunc.
func (mock *TofndClientMock) KeyPresence(ctx context.Context, in *tofnd.KeyPresenceRequest, opts ...grpc.CallOption) (*tofnd.KeyPresenceResponse, error) {
if mock.KeyPresenceFunc == nil {
panic("TofndClientMock.KeyPresenceFunc: method is nil but TofndClient.KeyPresence was just called")
}
callInfo := struct {
Ctx context.Context
In *tofnd.KeyPresenceRequest
Opts []grpc.CallOption
}{
Ctx: ctx,
In: in,
Opts: opts,
}
mock.lockKeyPresence.Lock()
mock.calls.KeyPresence = append(mock.calls.KeyPresence, callInfo)
mock.lockKeyPresence.Unlock()
return mock.KeyPresenceFunc(ctx, in, opts...)
}
// KeyPresenceCalls gets all the calls that were made to KeyPresence.
// Check the length with:
// len(mockedTofndClient.KeyPresenceCalls())
func (mock *TofndClientMock) KeyPresenceCalls() []struct {
Ctx context.Context
In *tofnd.KeyPresenceRequest
Opts []grpc.CallOption
} {
var calls []struct {
Ctx context.Context
In *tofnd.KeyPresenceRequest
Opts []grpc.CallOption
}
mock.lockKeyPresence.RLock()
calls = mock.calls.KeyPresence
mock.lockKeyPresence.RUnlock()
return calls
}
// Keygen calls KeygenFunc.
func (mock *TofndClientMock) Keygen(ctx context.Context, opts ...grpc.CallOption) (tofnd.GG20_KeygenClient, error) {
if mock.KeygenFunc == nil {
panic("TofndClientMock.KeygenFunc: method is nil but TofndClient.Keygen was just called")
}
callInfo := struct {
Ctx context.Context
Opts []grpc.CallOption
}{
Ctx: ctx,
Opts: opts,
}
mock.lockKeygen.Lock()
mock.calls.Keygen = append(mock.calls.Keygen, callInfo)
mock.lockKeygen.Unlock()
return mock.KeygenFunc(ctx, opts...)
}
// KeygenCalls gets all the calls that were made to Keygen.
// Check the length with:
// len(mockedTofndClient.KeygenCalls())
func (mock *TofndClientMock) KeygenCalls() []struct {
Ctx context.Context
Opts []grpc.CallOption
} {
var calls []struct {
Ctx context.Context
Opts []grpc.CallOption
}
mock.lockKeygen.RLock()
calls = mock.calls.Keygen
mock.lockKeygen.RUnlock()
return calls
}
// Recover calls RecoverFunc.
func (mock *TofndClientMock) Recover(ctx context.Context, in *tofnd.RecoverRequest, opts ...grpc.CallOption) (*tofnd.RecoverResponse, error) {
if mock.RecoverFunc == nil {
panic("TofndClientMock.RecoverFunc: method is nil but TofndClient.Recover was just called")
}
callInfo := struct {
Ctx context.Context
In *tofnd.RecoverRequest
Opts []grpc.CallOption
}{
Ctx: ctx,
In: in,
Opts: opts,
}
mock.lockRecover.Lock()
mock.calls.Recover = append(mock.calls.Recover, callInfo)
mock.lockRecover.Unlock()
return mock.RecoverFunc(ctx, in, opts...)
}
// RecoverCalls gets all the calls that were made to Recover.
// Check the length with:
// len(mockedTofndClient.RecoverCalls())
func (mock *TofndClientMock) RecoverCalls() []struct {
Ctx context.Context
In *tofnd.RecoverRequest
Opts []grpc.CallOption
} {
var calls []struct {
Ctx context.Context
In *tofnd.RecoverRequest
Opts []grpc.CallOption
}
mock.lockRecover.RLock()
calls = mock.calls.Recover
mock.lockRecover.RUnlock()
return calls
}
// Sign calls SignFunc.
func (mock *TofndClientMock) Sign(ctx context.Context, opts ...grpc.CallOption) (tofnd.GG20_SignClient, error) {
if mock.SignFunc == nil {
panic("TofndClientMock.SignFunc: method is nil but TofndClient.Sign was just called")
}
callInfo := struct {
Ctx context.Context
Opts []grpc.CallOption
}{
Ctx: ctx,
Opts: opts,
}
mock.lockSign.Lock()
mock.calls.Sign = append(mock.calls.Sign, callInfo)
mock.lockSign.Unlock()
return mock.SignFunc(ctx, opts...)
}
// SignCalls gets all the calls that were made to Sign.
// Check the length with:
// len(mockedTofndClient.SignCalls())
func (mock *TofndClientMock) SignCalls() []struct {
Ctx context.Context
Opts []grpc.CallOption
} {
var calls []struct {
Ctx context.Context
Opts []grpc.CallOption
}
mock.lockSign.RLock()
calls = mock.calls.Sign
mock.lockSign.RUnlock()
return calls
}
// Ensure, that TofndKeyGenClientMock does implement types.TofndKeyGenClient.
// If this is not the case, regenerate this file with moq.
var _ types.TofndKeyGenClient = &TofndKeyGenClientMock{}
// TofndKeyGenClientMock is a mock implementation of types.TofndKeyGenClient.
//
// func TestSomethingThatUsesTofndKeyGenClient(t *testing.T) {
//
// // make and configure a mocked types.TofndKeyGenClient
// mockedTofndKeyGenClient := &TofndKeyGenClientMock{
// CloseSendFunc: func() error {
// panic("mock out the CloseSend method")
// },
// ContextFunc: func() context.Context {
// panic("mock out the Context method")
// },
// HeaderFunc: func() (metadata.MD, error) {
// panic("mock out the Header method")
// },
// RecvFunc: func() (*tofnd.MessageOut, error) {
// panic("mock out the Recv method")
// },
// RecvMsgFunc: func(m interface{}) error {
// panic("mock out the RecvMsg method")
// },
// SendFunc: func(messageIn *tofnd.MessageIn) error {
// panic("mock out the Send method")
// },
// SendMsgFunc: func(m interface{}) error {
// panic("mock out the SendMsg method")
// },
// TrailerFunc: func() metadata.MD {
// panic("mock out the Trailer method")
// },
// }
//
// // use mockedTofndKeyGenClient in code that requires types.TofndKeyGenClient
// // and then make assertions.
//
// }
type TofndKeyGenClientMock struct {
// CloseSendFunc mocks the CloseSend method.
CloseSendFunc func() error
// ContextFunc mocks the Context method.
ContextFunc func() context.Context
// HeaderFunc mocks the Header method.
HeaderFunc func() (metadata.MD, error)
// RecvFunc mocks the Recv method.
RecvFunc func() (*tofnd.MessageOut, error)
// RecvMsgFunc mocks the RecvMsg method.
RecvMsgFunc func(m interface{}) error
// SendFunc mocks the Send method.
SendFunc func(messageIn *tofnd.MessageIn) error
// SendMsgFunc mocks the SendMsg method.
SendMsgFunc func(m interface{}) error
// TrailerFunc mocks the Trailer method.
TrailerFunc func() metadata.MD
// calls tracks calls to the methods.
calls struct {
// CloseSend holds details about calls to the CloseSend method.
CloseSend []struct {
}
// Context holds details about calls to the Context method.
Context []struct {
}
// Header holds details about calls to the Header method.
Header []struct {
}
// Recv holds details about calls to the Recv method.
Recv []struct {
}
// RecvMsg holds details about calls to the RecvMsg method.
RecvMsg []struct {
// M is the m argument value.
M interface{}
}
// Send holds details about calls to the Send method.
Send []struct {
// MessageIn is the messageIn argument value.
MessageIn *tofnd.MessageIn
}
// SendMsg holds details about calls to the SendMsg method.
SendMsg []struct {
// M is the m argument value.
M interface{}
}
// Trailer holds details about calls to the Trailer method.
Trailer []struct {
}
}
lockCloseSend sync.RWMutex
lockContext sync.RWMutex
lockHeader sync.RWMutex
lockRecv sync.RWMutex
lockRecvMsg sync.RWMutex
lockSend sync.RWMutex
lockSendMsg sync.RWMutex
lockTrailer sync.RWMutex
}
// CloseSend calls CloseSendFunc.
func (mock *TofndKeyGenClientMock) CloseSend() error {
if mock.CloseSendFunc == nil {
panic("TofndKeyGenClientMock.CloseSendFunc: method is nil but TofndKeyGenClient.CloseSend was just called")
}
callInfo := struct {
}{}
mock.lockCloseSend.Lock()
mock.calls.CloseSend = append(mock.calls.CloseSend, callInfo)
mock.lockCloseSend.Unlock()
return mock.CloseSendFunc()
}
// CloseSendCalls gets all the calls that were made to CloseSend.
// Check the length with:
// len(mockedTofndKeyGenClient.CloseSendCalls())
func (mock *TofndKeyGenClientMock) CloseSendCalls() []struct {
} {
var calls []struct {
}
mock.lockCloseSend.RLock()
calls = mock.calls.CloseSend
mock.lockCloseSend.RUnlock()
return calls
}
// Context calls ContextFunc.
func (mock *TofndKeyGenClientMock) Context() context.Context {
if mock.ContextFunc == nil {
panic("TofndKeyGenClientMock.ContextFunc: method is nil but TofndKeyGenClient.Context was just called")
}
callInfo := struct {
}{}
mock.lockContext.Lock()
mock.calls.Context = append(mock.calls.Context, callInfo)
mock.lockContext.Unlock()
return mock.ContextFunc()
}
// ContextCalls gets all the calls that were made to Context.
// Check the length with:
// len(mockedTofndKeyGenClient.ContextCalls())
func (mock *TofndKeyGenClientMock) ContextCalls() []struct {
} {
var calls []struct {
}
mock.lockContext.RLock()
calls = mock.calls.Context
mock.lockContext.RUnlock()
return calls
}
// Header calls HeaderFunc.
func (mock *TofndKeyGenClientMock) Header() (metadata.MD, error) {
if mock.HeaderFunc == nil {
panic("TofndKeyGenClientMock.HeaderFunc: method is nil but TofndKeyGenClient.Header was just called")
}
callInfo := struct {
}{}
mock.lockHeader.Lock()
mock.calls.Header = append(mock.calls.Header, callInfo)
mock.lockHeader.Unlock()
return mock.HeaderFunc()
}
// HeaderCalls gets all the calls that were made to Header.
// Check the length with:
// len(mockedTofndKeyGenClient.HeaderCalls())
func (mock *TofndKeyGenClientMock) HeaderCalls() []struct {
} {
var calls []struct {
}
mock.lockHeader.RLock()
calls = mock.calls.Header
mock.lockHeader.RUnlock()
return calls
}
// Recv calls RecvFunc.
func (mock *TofndKeyGenClientMock) Recv() (*tofnd.MessageOut, error) {
if mock.RecvFunc == nil {
panic("TofndKeyGenClientMock.RecvFunc: method is nil but TofndKeyGenClient.Recv was just called")
}
callInfo := struct {
}{}
mock.lockRecv.Lock()
mock.calls.Recv = append(mock.calls.Recv, callInfo)
mock.lockRecv.Unlock()
return mock.RecvFunc()
}
// RecvCalls gets all the calls that were made to Recv.
// Check the length with:
// len(mockedTofndKeyGenClient.RecvCalls())
func (mock *TofndKeyGenClientMock) RecvCalls() []struct {
} {
var calls []struct {
}
mock.lockRecv.RLock()
calls = mock.calls.Recv
mock.lockRecv.RUnlock()
return calls
}
// RecvMsg calls RecvMsgFunc.
func (mock *TofndKeyGenClientMock) RecvMsg(m interface{}) error {
if mock.RecvMsgFunc == nil {
panic("TofndKeyGenClientMock.RecvMsgFunc: method is nil but TofndKeyGenClient.RecvMsg was just called")
}
callInfo := struct {
M interface{}
}{
M: m,
}
mock.lockRecvMsg.Lock()
mock.calls.RecvMsg = append(mock.calls.RecvMsg, callInfo)
mock.lockRecvMsg.Unlock()
return mock.RecvMsgFunc(m)
}
// RecvMsgCalls gets all the calls that were made to RecvMsg.
// Check the length with:
// len(mockedTofndKeyGenClient.RecvMsgCalls())
func (mock *TofndKeyGenClientMock) RecvMsgCalls() []struct {
M interface{}
} {
var calls []struct {
M interface{}
}
mock.lockRecvMsg.RLock()
calls = mock.calls.RecvMsg
mock.lockRecvMsg.RUnlock()
return calls
}
// Send calls SendFunc.
func (mock *TofndKeyGenClientMock) Send(messageIn *tofnd.MessageIn) error {
if mock.SendFunc == nil {
panic("TofndKeyGenClientMock.SendFunc: method is nil but TofndKeyGenClient.Send was just called")
}
callInfo := struct {
MessageIn *tofnd.MessageIn
}{
MessageIn: messageIn,
}
mock.lockSend.Lock()
mock.calls.Send = append(mock.calls.Send, callInfo)
mock.lockSend.Unlock()
return mock.SendFunc(messageIn)
}
// SendCalls gets all the calls that were made to Send.
// Check the length with:
// len(mockedTofndKeyGenClient.SendCalls())
func (mock *TofndKeyGenClientMock) SendCalls() []struct {
MessageIn *tofnd.MessageIn
} {
var calls []struct {
MessageIn *tofnd.MessageIn
}
mock.lockSend.RLock()
calls = mock.calls.Send
mock.lockSend.RUnlock()
return calls
}
// SendMsg calls SendMsgFunc.
func (mock *TofndKeyGenClientMock) SendMsg(m interface{}) error {
if mock.SendMsgFunc == nil {
panic("TofndKeyGenClientMock.SendMsgFunc: method is nil but TofndKeyGenClient.SendMsg was just called")
}
callInfo := struct {
M interface{}
}{
M: m,
}
mock.lockSendMsg.Lock()
mock.calls.SendMsg = append(mock.calls.SendMsg, callInfo)
mock.lockSendMsg.Unlock()
return mock.SendMsgFunc(m)
}
// SendMsgCalls gets all the calls that were made to SendMsg.
// Check the length with:
// len(mockedTofndKeyGenClient.SendMsgCalls())
func (mock *TofndKeyGenClientMock) SendMsgCalls() []struct {
M interface{}
} {
var calls []struct {
M interface{}
}
mock.lockSendMsg.RLock()
calls = mock.calls.SendMsg
mock.lockSendMsg.RUnlock()
return calls
}
// Trailer calls TrailerFunc.
func (mock *TofndKeyGenClientMock) Trailer() metadata.MD {
if mock.TrailerFunc == nil {
panic("TofndKeyGenClientMock.TrailerFunc: method is nil but TofndKeyGenClient.Trailer was just called")
}
callInfo := struct {
}{}
mock.lockTrailer.Lock()
mock.calls.Trailer = append(mock.calls.Trailer, callInfo)
mock.lockTrailer.Unlock()
return mock.TrailerFunc()
}
// TrailerCalls gets all the calls that were made to Trailer.
// Check the length with:
// len(mockedTofndKeyGenClient.TrailerCalls())
func (mock *TofndKeyGenClientMock) TrailerCalls() []struct {
} {
var calls []struct {
}
mock.lockTrailer.RLock()
calls = mock.calls.Trailer
mock.lockTrailer.RUnlock()
return calls
}
// Ensure, that TofndSignClientMock does implement types.TofndSignClient.
// If this is not the case, regenerate this file with moq.
var _ types.TofndSignClient = &TofndSignClientMock{}
// TofndSignClientMock is a mock implementation of types.TofndSignClient.
//
// func TestSomethingThatUsesTofndSignClient(t *testing.T) {
//
// // make and configure a mocked types.TofndSignClient
// mockedTofndSignClient := &TofndSignClientMock{
// CloseSendFunc: func() error {
// panic("mock out the CloseSend method")
// },
// ContextFunc: func() context.Context {
// panic("mock out the Context method")
// },
// HeaderFunc: func() (metadata.MD, error) {
// panic("mock out the Header method")
// },
// RecvFunc: func() (*tofnd.MessageOut, error) {
// panic("mock out the Recv method")
// },
// RecvMsgFunc: func(m interface{}) error {
// panic("mock out the RecvMsg method")
// },
// SendFunc: func(messageIn *tofnd.MessageIn) error {
// panic("mock out the Send method")
// },
// SendMsgFunc: func(m interface{}) error {
// panic("mock out the SendMsg method")
// },
// TrailerFunc: func() metadata.MD {
// panic("mock out the Trailer method")
// },
// }
//
// // use mockedTofndSignClient in code that requires types.TofndSignClient
// // and then make assertions.
//
// }
type TofndSignClientMock struct {
// CloseSendFunc mocks the CloseSend method.
CloseSendFunc func() error
// ContextFunc mocks the Context method.
ContextFunc func() context.Context
// HeaderFunc mocks the Header method.
HeaderFunc func() (metadata.MD, error)
// RecvFunc mocks the Recv method.
RecvFunc func() (*tofnd.MessageOut, error)
// RecvMsgFunc mocks the RecvMsg method.
RecvMsgFunc func(m interface{}) error
// SendFunc mocks the Send method.
SendFunc func(messageIn *tofnd.MessageIn) error
// SendMsgFunc mocks the SendMsg method.
SendMsgFunc func(m interface{}) error
// TrailerFunc mocks the Trailer method.
TrailerFunc func() metadata.MD
// calls tracks calls to the methods.
calls struct {
// CloseSend holds details about calls to the CloseSend method.
CloseSend []struct {
}
// Context holds details about calls to the Context method.
Context []struct {
}
// Header holds details about calls to the Header method.
Header []struct {
}
// Recv holds details about calls to the Recv method.
Recv []struct {
}
// RecvMsg holds details about calls to the RecvMsg method.
RecvMsg []struct {
// M is the m argument value.
M interface{}
}
// Send holds details about calls to the Send method.
Send []struct {
// MessageIn is the messageIn argument value.
MessageIn *tofnd.MessageIn
}
// SendMsg holds details about calls to the SendMsg method.
SendMsg []struct {
// M is the m argument value.
M interface{}
}
// Trailer holds details about calls to the Trailer method.
Trailer []struct {
}
}
lockCloseSend sync.RWMutex
lockContext sync.RWMutex
lockHeader sync.RWMutex
lockRecv sync.RWMutex
lockRecvMsg sync.RWMutex
lockSend sync.RWMutex
lockSendMsg sync.RWMutex
lockTrailer sync.RWMutex
}
// CloseSend calls CloseSendFunc.
func (mock *TofndSignClientMock) CloseSend() error {
if mock.CloseSendFunc == nil {
panic("TofndSignClientMock.CloseSendFunc: method is nil but TofndSignClient.CloseSend was just called")
}
callInfo := struct {
}{}
mock.lockCloseSend.Lock()
mock.calls.CloseSend = append(mock.calls.CloseSend, callInfo)
mock.lockCloseSend.Unlock()
return mock.CloseSendFunc()
}
// CloseSendCalls gets all the calls that were made to CloseSend.
// Check the length with:
// len(mockedTofndSignClient.CloseSendCalls())
func (mock *TofndSignClientMock) CloseSendCalls() []struct {
} {
var calls []struct {
}
mock.lockCloseSend.RLock()
calls = mock.calls.CloseSend
mock.lockCloseSend.RUnlock()
return calls
}
// Context calls ContextFunc.
func (mock *TofndSignClientMock) Context() context.Context {
if mock.ContextFunc == nil {
panic("TofndSignClientMock.ContextFunc: method is nil but TofndSignClient.Context was just called")
}
callInfo := struct {
}{}
mock.lockContext.Lock()
mock.calls.Context = append(mock.calls.Context, callInfo)
mock.lockContext.Unlock()
return mock.ContextFunc()
}
// ContextCalls gets all the calls that were made to Context.
// Check the length with:
// len(mockedTofndSignClient.ContextCalls())
func (mock *TofndSignClientMock) ContextCalls() []struct {
} {
var calls []struct {
}
mock.lockContext.RLock()
calls = mock.calls.Context
mock.lockContext.RUnlock()
return calls
}
// Header calls HeaderFunc.
func (mock *TofndSignClientMock) Header() (metadata.MD, error) {
if mock.HeaderFunc == nil {
panic("TofndSignClientMock.HeaderFunc: method is nil but TofndSignClient.Header was just called")
}
callInfo := struct {
}{}
mock.lockHeader.Lock()
mock.calls.Header = append(mock.calls.Header, callInfo)
mock.lockHeader.Unlock()
return mock.HeaderFunc()
}
// HeaderCalls gets all the calls that were made to Header.
// Check the length with:
// len(mockedTofndSignClient.HeaderCalls())
func (mock *TofndSignClientMock) HeaderCalls() []struct {
} {
var calls []struct {
}
mock.lockHeader.RLock()
calls = mock.calls.Header
mock.lockHeader.RUnlock()
return calls
}
// Recv calls RecvFunc.
func (mock *TofndSignClientMock) Recv() (*tofnd.MessageOut, error) {
if mock.RecvFunc == nil {
panic("TofndSignClientMock.RecvFunc: method is nil but TofndSignClient.Recv was just called")
}
callInfo := struct {
}{}
mock.lockRecv.Lock()
mock.calls.Recv = append(mock.calls.Recv, callInfo)
mock.lockRecv.Unlock()
return mock.RecvFunc()
}
// RecvCalls gets all the calls that were made to Recv.
// Check the length with:
// len(mockedTofndSignClient.RecvCalls())
func (mock *TofndSignClientMock) RecvCalls() []struct {
} {
var calls []struct {
}
mock.lockRecv.RLock()
calls = mock.calls.Recv
mock.lockRecv.RUnlock()
return calls
}
// RecvMsg calls RecvMsgFunc.
func (mock *TofndSignClientMock) RecvMsg(m interface{}) error {
if mock.RecvMsgFunc == nil {
panic("TofndSignClientMock.RecvMsgFunc: method is nil but TofndSignClient.RecvMsg was just called")
}
callInfo := struct {
M interface{}
}{
M: m,
}
mock.lockRecvMsg.Lock()
mock.calls.RecvMsg = append(mock.calls.RecvMsg, callInfo)
mock.lockRecvMsg.Unlock()
return mock.RecvMsgFunc(m)
}
// RecvMsgCalls gets all the calls that were made to RecvMsg.
// Check the length with:
// len(mockedTofndSignClient.RecvMsgCalls())
func (mock *TofndSignClientMock) RecvMsgCalls() []struct {
M interface{}
} {
var calls []struct {
M interface{}
}
mock.lockRecvMsg.RLock()
calls = mock.calls.RecvMsg
mock.lockRecvMsg.RUnlock()
return calls
}
// Send calls SendFunc.
func (mock *TofndSignClientMock) Send(messageIn *tofnd.MessageIn) error {
if mock.SendFunc == nil {
panic("TofndSignClientMock.SendFunc: method is nil but TofndSignClient.Send was just called")
}
callInfo := struct {
MessageIn *tofnd.MessageIn
}{
MessageIn: messageIn,
}
mock.lockSend.Lock()
mock.calls.Send = append(mock.calls.Send, callInfo)
mock.lockSend.Unlock()
return mock.SendFunc(messageIn)
}
// SendCalls gets all the calls that were made to Send.
// Check the length with:
// len(mockedTofndSignClient.SendCalls())
func (mock *TofndSignClientMock) SendCalls() []struct {
MessageIn *tofnd.MessageIn
} {
var calls []struct {
MessageIn *tofnd.MessageIn
}
mock.lockSend.RLock()
calls = mock.calls.Send
mock.lockSend.RUnlock()
return calls
}
// SendMsg calls SendMsgFunc.
func (mock *TofndSignClientMock) SendMsg(m interface{}) error {
if mock.SendMsgFunc == nil {
panic("TofndSignClientMock.SendMsgFunc: method is nil but TofndSignClient.SendMsg was just called")
}
callInfo := struct {
M interface{}
}{
M: m,
}
mock.lockSendMsg.Lock()
mock.calls.SendMsg = append(mock.calls.SendMsg, callInfo)
mock.lockSendMsg.Unlock()
return mock.SendMsgFunc(m)
}
// SendMsgCalls gets all the calls that were made to SendMsg.
// Check the length with:
// len(mockedTofndSignClient.SendMsgCalls())
func (mock *TofndSignClientMock) SendMsgCalls() []struct {
M interface{}
} {
var calls []struct {
M interface{}
}
mock.lockSendMsg.RLock()
calls = mock.calls.SendMsg
mock.lockSendMsg.RUnlock()
return calls
}
// Trailer calls TrailerFunc.
func (mock *TofndSignClientMock) Trailer() metadata.MD {
if mock.TrailerFunc == nil {
panic("TofndSignClientMock.TrailerFunc: method is nil but TofndSignClient.Trailer was just called")
}
callInfo := struct {
}{}
mock.lockTrailer.Lock()
mock.calls.Trailer = append(mock.calls.Trailer, callInfo)
mock.lockTrailer.Unlock()
return mock.TrailerFunc()
}
// TrailerCalls gets all the calls that were made to Trailer.
// Check the length with:
// len(mockedTofndSignClient.TrailerCalls())
func (mock *TofndSignClientMock) TrailerCalls() []struct {
} {
var calls []struct {
}
mock.lockTrailer.RLock()
calls = mock.calls.Trailer
mock.lockTrailer.RUnlock()
return calls
}
// Ensure, that VoterMock does implement types.Voter.
// If this is not the case, regenerate this file with moq.
var _ types.Voter = &VoterMock{}
// VoterMock is a mock implementation of types.Voter.
//
// func TestSomethingThatUsesVoter(t *testing.T) {
//
// // make and configure a mocked types.Voter
// mockedVoter := &VoterMock{
// GetPollFunc: func(ctx github_com_cosmos_cosmos_sdk_types.Context, pollKey exported1.PollKey) exported1.Poll {
// panic("mock out the GetPoll method")
// },
// InitializePollWithSnapshotFunc: func(ctx github_com_cosmos_cosmos_sdk_types.Context, key exported1.PollKey, snapshotSeqNo int64, pollProperties ...exported1.PollProperty) error {
// panic("mock out the InitializePollWithSnapshot method")
// },
// }
//
// // use mockedVoter in code that requires types.Voter
// // and then make assertions.
//
// }
type VoterMock struct {
// GetPollFunc mocks the GetPoll method.
GetPollFunc func(ctx github_com_cosmos_cosmos_sdk_types.Context, pollKey exported1.PollKey) exported1.Poll
// InitializePollWithSnapshotFunc mocks the InitializePollWithSnapshot method.
InitializePollWithSnapshotFunc func(ctx github_com_cosmos_cosmos_sdk_types.Context, key exported1.PollKey, snapshotSeqNo int64, pollProperties ...exported1.PollProperty) error
// calls tracks calls to the methods.
calls struct {
// GetPoll holds details about calls to the GetPoll method.
GetPoll []struct {
// Ctx is the ctx argument value.
Ctx github_com_cosmos_cosmos_sdk_types.Context
// PollKey is the pollKey argument value.
PollKey exported1.PollKey
}
// InitializePollWithSnapshot holds details about calls to the InitializePollWithSnapshot method.
InitializePollWithSnapshot []struct {
// Ctx is the ctx argument value.
Ctx github_com_cosmos_cosmos_sdk_types.Context
// Key is the key argument value.
Key exported1.PollKey
// SnapshotSeqNo is the snapshotSeqNo argument value.
SnapshotSeqNo int64
// PollProperties is the pollProperties argument value.
PollProperties []exported1.PollProperty
}
}
lockGetPoll sync.RWMutex
lockInitializePollWithSnapshot sync.RWMutex
}
// GetPoll calls GetPollFunc.
func (mock *VoterMock) GetPoll(ctx github_com_cosmos_cosmos_sdk_types.Context, pollKey exported1.PollKey) exported1.Poll {
if mock.GetPollFunc == nil {
panic("VoterMock.GetPollFunc: method is nil but Voter.GetPoll was just called")
}
callInfo := struct {
Ctx github_com_cosmos_cosmos_sdk_types.Context
PollKey exported1.PollKey
}{
Ctx: ctx,
PollKey: pollKey,
}
mock.lockGetPoll.Lock()
mock.calls.GetPoll = append(mock.calls.GetPoll, callInfo)
mock.lockGetPoll.Unlock()
return mock.GetPollFunc(ctx, pollKey)
}
// GetPollCalls gets all the calls that were made to GetPoll.
// Check the length with:
// len(mockedVoter.GetPollCalls())
func (mock *VoterMock) GetPollCalls() []struct {
Ctx github_com_cosmos_cosmos_sdk_types.Context
PollKey exported1.PollKey
} {
var calls []struct {
Ctx github_com_cosmos_cosmos_sdk_types.Context
PollKey exported1.PollKey
}
mock.lockGetPoll.RLock()