/
mock.go
853 lines (786 loc) · 26.7 KB
/
mock.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
// Code generated by moq; DO NOT EDIT.
// github.com/matryer/moq
package mock
import (
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
cosmossdktypes "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/staking/types"
"github.com/tendermint/tendermint/proto/tendermint/crypto"
"sync"
)
// Ensure, that ValidatorIMock does implement ValidatorI.
// If this is not the case, regenerate this file with moq.
var _ ValidatorI = &ValidatorIMock{}
// ValidatorIMock is a mock implementation of ValidatorI.
//
// func TestSomethingThatUsesValidatorI(t *testing.T) {
//
// // make and configure a mocked ValidatorI
// mockedValidatorI := &ValidatorIMock{
// ConsPubKeyFunc: func() (cryptotypes.PubKey, error) {
// panic("mock out the ConsPubKey method")
// },
// GetBondedTokensFunc: func() cosmossdktypes.Int {
// panic("mock out the GetBondedTokens method")
// },
// GetCommissionFunc: func() cosmossdktypes.Dec {
// panic("mock out the GetCommission method")
// },
// GetConsAddrFunc: func() (cosmossdktypes.ConsAddress, error) {
// panic("mock out the GetConsAddr method")
// },
// GetConsensusPowerFunc: func(intMoqParam cosmossdktypes.Int) int64 {
// panic("mock out the GetConsensusPower method")
// },
// GetDelegatorSharesFunc: func() cosmossdktypes.Dec {
// panic("mock out the GetDelegatorShares method")
// },
// GetMinSelfDelegationFunc: func() cosmossdktypes.Int {
// panic("mock out the GetMinSelfDelegation method")
// },
// GetMonikerFunc: func() string {
// panic("mock out the GetMoniker method")
// },
// GetOperatorFunc: func() cosmossdktypes.ValAddress {
// panic("mock out the GetOperator method")
// },
// GetStatusFunc: func() types.BondStatus {
// panic("mock out the GetStatus method")
// },
// GetTokensFunc: func() cosmossdktypes.Int {
// panic("mock out the GetTokens method")
// },
// IsBondedFunc: func() bool {
// panic("mock out the IsBonded method")
// },
// IsJailedFunc: func() bool {
// panic("mock out the IsJailed method")
// },
// IsUnbondedFunc: func() bool {
// panic("mock out the IsUnbonded method")
// },
// IsUnbondingFunc: func() bool {
// panic("mock out the IsUnbonding method")
// },
// SharesFromTokensFunc: func(amt cosmossdktypes.Int) (cosmossdktypes.Dec, error) {
// panic("mock out the SharesFromTokens method")
// },
// SharesFromTokensTruncatedFunc: func(amt cosmossdktypes.Int) (cosmossdktypes.Dec, error) {
// panic("mock out the SharesFromTokensTruncated method")
// },
// TmConsPublicKeyFunc: func() (crypto.PublicKey, error) {
// panic("mock out the TmConsPublicKey method")
// },
// TokensFromSharesFunc: func(dec cosmossdktypes.Dec) cosmossdktypes.Dec {
// panic("mock out the TokensFromShares method")
// },
// TokensFromSharesRoundUpFunc: func(dec cosmossdktypes.Dec) cosmossdktypes.Dec {
// panic("mock out the TokensFromSharesRoundUp method")
// },
// TokensFromSharesTruncatedFunc: func(dec cosmossdktypes.Dec) cosmossdktypes.Dec {
// panic("mock out the TokensFromSharesTruncated method")
// },
// }
//
// // use mockedValidatorI in code that requires ValidatorI
// // and then make assertions.
//
// }
type ValidatorIMock struct {
// ConsPubKeyFunc mocks the ConsPubKey method.
ConsPubKeyFunc func() (cryptotypes.PubKey, error)
// GetBondedTokensFunc mocks the GetBondedTokens method.
GetBondedTokensFunc func() cosmossdktypes.Int
// GetCommissionFunc mocks the GetCommission method.
GetCommissionFunc func() cosmossdktypes.Dec
// GetConsAddrFunc mocks the GetConsAddr method.
GetConsAddrFunc func() (cosmossdktypes.ConsAddress, error)
// GetConsensusPowerFunc mocks the GetConsensusPower method.
GetConsensusPowerFunc func(intMoqParam cosmossdktypes.Int) int64
// GetDelegatorSharesFunc mocks the GetDelegatorShares method.
GetDelegatorSharesFunc func() cosmossdktypes.Dec
// GetMinSelfDelegationFunc mocks the GetMinSelfDelegation method.
GetMinSelfDelegationFunc func() cosmossdktypes.Int
// GetMonikerFunc mocks the GetMoniker method.
GetMonikerFunc func() string
// GetOperatorFunc mocks the GetOperator method.
GetOperatorFunc func() cosmossdktypes.ValAddress
// GetStatusFunc mocks the GetStatus method.
GetStatusFunc func() types.BondStatus
// GetTokensFunc mocks the GetTokens method.
GetTokensFunc func() cosmossdktypes.Int
// IsBondedFunc mocks the IsBonded method.
IsBondedFunc func() bool
// IsJailedFunc mocks the IsJailed method.
IsJailedFunc func() bool
// IsUnbondedFunc mocks the IsUnbonded method.
IsUnbondedFunc func() bool
// IsUnbondingFunc mocks the IsUnbonding method.
IsUnbondingFunc func() bool
// SharesFromTokensFunc mocks the SharesFromTokens method.
SharesFromTokensFunc func(amt cosmossdktypes.Int) (cosmossdktypes.Dec, error)
// SharesFromTokensTruncatedFunc mocks the SharesFromTokensTruncated method.
SharesFromTokensTruncatedFunc func(amt cosmossdktypes.Int) (cosmossdktypes.Dec, error)
// TmConsPublicKeyFunc mocks the TmConsPublicKey method.
TmConsPublicKeyFunc func() (crypto.PublicKey, error)
// TokensFromSharesFunc mocks the TokensFromShares method.
TokensFromSharesFunc func(dec cosmossdktypes.Dec) cosmossdktypes.Dec
// TokensFromSharesRoundUpFunc mocks the TokensFromSharesRoundUp method.
TokensFromSharesRoundUpFunc func(dec cosmossdktypes.Dec) cosmossdktypes.Dec
// TokensFromSharesTruncatedFunc mocks the TokensFromSharesTruncated method.
TokensFromSharesTruncatedFunc func(dec cosmossdktypes.Dec) cosmossdktypes.Dec
// calls tracks calls to the methods.
calls struct {
// ConsPubKey holds details about calls to the ConsPubKey method.
ConsPubKey []struct {
}
// GetBondedTokens holds details about calls to the GetBondedTokens method.
GetBondedTokens []struct {
}
// GetCommission holds details about calls to the GetCommission method.
GetCommission []struct {
}
// GetConsAddr holds details about calls to the GetConsAddr method.
GetConsAddr []struct {
}
// GetConsensusPower holds details about calls to the GetConsensusPower method.
GetConsensusPower []struct {
// IntMoqParam is the intMoqParam argument value.
IntMoqParam cosmossdktypes.Int
}
// GetDelegatorShares holds details about calls to the GetDelegatorShares method.
GetDelegatorShares []struct {
}
// GetMinSelfDelegation holds details about calls to the GetMinSelfDelegation method.
GetMinSelfDelegation []struct {
}
// GetMoniker holds details about calls to the GetMoniker method.
GetMoniker []struct {
}
// GetOperator holds details about calls to the GetOperator method.
GetOperator []struct {
}
// GetStatus holds details about calls to the GetStatus method.
GetStatus []struct {
}
// GetTokens holds details about calls to the GetTokens method.
GetTokens []struct {
}
// IsBonded holds details about calls to the IsBonded method.
IsBonded []struct {
}
// IsJailed holds details about calls to the IsJailed method.
IsJailed []struct {
}
// IsUnbonded holds details about calls to the IsUnbonded method.
IsUnbonded []struct {
}
// IsUnbonding holds details about calls to the IsUnbonding method.
IsUnbonding []struct {
}
// SharesFromTokens holds details about calls to the SharesFromTokens method.
SharesFromTokens []struct {
// Amt is the amt argument value.
Amt cosmossdktypes.Int
}
// SharesFromTokensTruncated holds details about calls to the SharesFromTokensTruncated method.
SharesFromTokensTruncated []struct {
// Amt is the amt argument value.
Amt cosmossdktypes.Int
}
// TmConsPublicKey holds details about calls to the TmConsPublicKey method.
TmConsPublicKey []struct {
}
// TokensFromShares holds details about calls to the TokensFromShares method.
TokensFromShares []struct {
// Dec is the dec argument value.
Dec cosmossdktypes.Dec
}
// TokensFromSharesRoundUp holds details about calls to the TokensFromSharesRoundUp method.
TokensFromSharesRoundUp []struct {
// Dec is the dec argument value.
Dec cosmossdktypes.Dec
}
// TokensFromSharesTruncated holds details about calls to the TokensFromSharesTruncated method.
TokensFromSharesTruncated []struct {
// Dec is the dec argument value.
Dec cosmossdktypes.Dec
}
}
lockConsPubKey sync.RWMutex
lockGetBondedTokens sync.RWMutex
lockGetCommission sync.RWMutex
lockGetConsAddr sync.RWMutex
lockGetConsensusPower sync.RWMutex
lockGetDelegatorShares sync.RWMutex
lockGetMinSelfDelegation sync.RWMutex
lockGetMoniker sync.RWMutex
lockGetOperator sync.RWMutex
lockGetStatus sync.RWMutex
lockGetTokens sync.RWMutex
lockIsBonded sync.RWMutex
lockIsJailed sync.RWMutex
lockIsUnbonded sync.RWMutex
lockIsUnbonding sync.RWMutex
lockSharesFromTokens sync.RWMutex
lockSharesFromTokensTruncated sync.RWMutex
lockTmConsPublicKey sync.RWMutex
lockTokensFromShares sync.RWMutex
lockTokensFromSharesRoundUp sync.RWMutex
lockTokensFromSharesTruncated sync.RWMutex
}
// ConsPubKey calls ConsPubKeyFunc.
func (mock *ValidatorIMock) ConsPubKey() (cryptotypes.PubKey, error) {
if mock.ConsPubKeyFunc == nil {
panic("ValidatorIMock.ConsPubKeyFunc: method is nil but ValidatorI.ConsPubKey was just called")
}
callInfo := struct {
}{}
mock.lockConsPubKey.Lock()
mock.calls.ConsPubKey = append(mock.calls.ConsPubKey, callInfo)
mock.lockConsPubKey.Unlock()
return mock.ConsPubKeyFunc()
}
// ConsPubKeyCalls gets all the calls that were made to ConsPubKey.
// Check the length with:
//
// len(mockedValidatorI.ConsPubKeyCalls())
func (mock *ValidatorIMock) ConsPubKeyCalls() []struct {
} {
var calls []struct {
}
mock.lockConsPubKey.RLock()
calls = mock.calls.ConsPubKey
mock.lockConsPubKey.RUnlock()
return calls
}
// GetBondedTokens calls GetBondedTokensFunc.
func (mock *ValidatorIMock) GetBondedTokens() cosmossdktypes.Int {
if mock.GetBondedTokensFunc == nil {
panic("ValidatorIMock.GetBondedTokensFunc: method is nil but ValidatorI.GetBondedTokens was just called")
}
callInfo := struct {
}{}
mock.lockGetBondedTokens.Lock()
mock.calls.GetBondedTokens = append(mock.calls.GetBondedTokens, callInfo)
mock.lockGetBondedTokens.Unlock()
return mock.GetBondedTokensFunc()
}
// GetBondedTokensCalls gets all the calls that were made to GetBondedTokens.
// Check the length with:
//
// len(mockedValidatorI.GetBondedTokensCalls())
func (mock *ValidatorIMock) GetBondedTokensCalls() []struct {
} {
var calls []struct {
}
mock.lockGetBondedTokens.RLock()
calls = mock.calls.GetBondedTokens
mock.lockGetBondedTokens.RUnlock()
return calls
}
// GetCommission calls GetCommissionFunc.
func (mock *ValidatorIMock) GetCommission() cosmossdktypes.Dec {
if mock.GetCommissionFunc == nil {
panic("ValidatorIMock.GetCommissionFunc: method is nil but ValidatorI.GetCommission was just called")
}
callInfo := struct {
}{}
mock.lockGetCommission.Lock()
mock.calls.GetCommission = append(mock.calls.GetCommission, callInfo)
mock.lockGetCommission.Unlock()
return mock.GetCommissionFunc()
}
// GetCommissionCalls gets all the calls that were made to GetCommission.
// Check the length with:
//
// len(mockedValidatorI.GetCommissionCalls())
func (mock *ValidatorIMock) GetCommissionCalls() []struct {
} {
var calls []struct {
}
mock.lockGetCommission.RLock()
calls = mock.calls.GetCommission
mock.lockGetCommission.RUnlock()
return calls
}
// GetConsAddr calls GetConsAddrFunc.
func (mock *ValidatorIMock) GetConsAddr() (cosmossdktypes.ConsAddress, error) {
if mock.GetConsAddrFunc == nil {
panic("ValidatorIMock.GetConsAddrFunc: method is nil but ValidatorI.GetConsAddr was just called")
}
callInfo := struct {
}{}
mock.lockGetConsAddr.Lock()
mock.calls.GetConsAddr = append(mock.calls.GetConsAddr, callInfo)
mock.lockGetConsAddr.Unlock()
return mock.GetConsAddrFunc()
}
// GetConsAddrCalls gets all the calls that were made to GetConsAddr.
// Check the length with:
//
// len(mockedValidatorI.GetConsAddrCalls())
func (mock *ValidatorIMock) GetConsAddrCalls() []struct {
} {
var calls []struct {
}
mock.lockGetConsAddr.RLock()
calls = mock.calls.GetConsAddr
mock.lockGetConsAddr.RUnlock()
return calls
}
// GetConsensusPower calls GetConsensusPowerFunc.
func (mock *ValidatorIMock) GetConsensusPower(intMoqParam cosmossdktypes.Int) int64 {
if mock.GetConsensusPowerFunc == nil {
panic("ValidatorIMock.GetConsensusPowerFunc: method is nil but ValidatorI.GetConsensusPower was just called")
}
callInfo := struct {
IntMoqParam cosmossdktypes.Int
}{
IntMoqParam: intMoqParam,
}
mock.lockGetConsensusPower.Lock()
mock.calls.GetConsensusPower = append(mock.calls.GetConsensusPower, callInfo)
mock.lockGetConsensusPower.Unlock()
return mock.GetConsensusPowerFunc(intMoqParam)
}
// GetConsensusPowerCalls gets all the calls that were made to GetConsensusPower.
// Check the length with:
//
// len(mockedValidatorI.GetConsensusPowerCalls())
func (mock *ValidatorIMock) GetConsensusPowerCalls() []struct {
IntMoqParam cosmossdktypes.Int
} {
var calls []struct {
IntMoqParam cosmossdktypes.Int
}
mock.lockGetConsensusPower.RLock()
calls = mock.calls.GetConsensusPower
mock.lockGetConsensusPower.RUnlock()
return calls
}
// GetDelegatorShares calls GetDelegatorSharesFunc.
func (mock *ValidatorIMock) GetDelegatorShares() cosmossdktypes.Dec {
if mock.GetDelegatorSharesFunc == nil {
panic("ValidatorIMock.GetDelegatorSharesFunc: method is nil but ValidatorI.GetDelegatorShares was just called")
}
callInfo := struct {
}{}
mock.lockGetDelegatorShares.Lock()
mock.calls.GetDelegatorShares = append(mock.calls.GetDelegatorShares, callInfo)
mock.lockGetDelegatorShares.Unlock()
return mock.GetDelegatorSharesFunc()
}
// GetDelegatorSharesCalls gets all the calls that were made to GetDelegatorShares.
// Check the length with:
//
// len(mockedValidatorI.GetDelegatorSharesCalls())
func (mock *ValidatorIMock) GetDelegatorSharesCalls() []struct {
} {
var calls []struct {
}
mock.lockGetDelegatorShares.RLock()
calls = mock.calls.GetDelegatorShares
mock.lockGetDelegatorShares.RUnlock()
return calls
}
// GetMinSelfDelegation calls GetMinSelfDelegationFunc.
func (mock *ValidatorIMock) GetMinSelfDelegation() cosmossdktypes.Int {
if mock.GetMinSelfDelegationFunc == nil {
panic("ValidatorIMock.GetMinSelfDelegationFunc: method is nil but ValidatorI.GetMinSelfDelegation was just called")
}
callInfo := struct {
}{}
mock.lockGetMinSelfDelegation.Lock()
mock.calls.GetMinSelfDelegation = append(mock.calls.GetMinSelfDelegation, callInfo)
mock.lockGetMinSelfDelegation.Unlock()
return mock.GetMinSelfDelegationFunc()
}
// GetMinSelfDelegationCalls gets all the calls that were made to GetMinSelfDelegation.
// Check the length with:
//
// len(mockedValidatorI.GetMinSelfDelegationCalls())
func (mock *ValidatorIMock) GetMinSelfDelegationCalls() []struct {
} {
var calls []struct {
}
mock.lockGetMinSelfDelegation.RLock()
calls = mock.calls.GetMinSelfDelegation
mock.lockGetMinSelfDelegation.RUnlock()
return calls
}
// GetMoniker calls GetMonikerFunc.
func (mock *ValidatorIMock) GetMoniker() string {
if mock.GetMonikerFunc == nil {
panic("ValidatorIMock.GetMonikerFunc: method is nil but ValidatorI.GetMoniker was just called")
}
callInfo := struct {
}{}
mock.lockGetMoniker.Lock()
mock.calls.GetMoniker = append(mock.calls.GetMoniker, callInfo)
mock.lockGetMoniker.Unlock()
return mock.GetMonikerFunc()
}
// GetMonikerCalls gets all the calls that were made to GetMoniker.
// Check the length with:
//
// len(mockedValidatorI.GetMonikerCalls())
func (mock *ValidatorIMock) GetMonikerCalls() []struct {
} {
var calls []struct {
}
mock.lockGetMoniker.RLock()
calls = mock.calls.GetMoniker
mock.lockGetMoniker.RUnlock()
return calls
}
// GetOperator calls GetOperatorFunc.
func (mock *ValidatorIMock) GetOperator() cosmossdktypes.ValAddress {
if mock.GetOperatorFunc == nil {
panic("ValidatorIMock.GetOperatorFunc: method is nil but ValidatorI.GetOperator was just called")
}
callInfo := struct {
}{}
mock.lockGetOperator.Lock()
mock.calls.GetOperator = append(mock.calls.GetOperator, callInfo)
mock.lockGetOperator.Unlock()
return mock.GetOperatorFunc()
}
// GetOperatorCalls gets all the calls that were made to GetOperator.
// Check the length with:
//
// len(mockedValidatorI.GetOperatorCalls())
func (mock *ValidatorIMock) GetOperatorCalls() []struct {
} {
var calls []struct {
}
mock.lockGetOperator.RLock()
calls = mock.calls.GetOperator
mock.lockGetOperator.RUnlock()
return calls
}
// GetStatus calls GetStatusFunc.
func (mock *ValidatorIMock) GetStatus() types.BondStatus {
if mock.GetStatusFunc == nil {
panic("ValidatorIMock.GetStatusFunc: method is nil but ValidatorI.GetStatus was just called")
}
callInfo := struct {
}{}
mock.lockGetStatus.Lock()
mock.calls.GetStatus = append(mock.calls.GetStatus, callInfo)
mock.lockGetStatus.Unlock()
return mock.GetStatusFunc()
}
// GetStatusCalls gets all the calls that were made to GetStatus.
// Check the length with:
//
// len(mockedValidatorI.GetStatusCalls())
func (mock *ValidatorIMock) GetStatusCalls() []struct {
} {
var calls []struct {
}
mock.lockGetStatus.RLock()
calls = mock.calls.GetStatus
mock.lockGetStatus.RUnlock()
return calls
}
// GetTokens calls GetTokensFunc.
func (mock *ValidatorIMock) GetTokens() cosmossdktypes.Int {
if mock.GetTokensFunc == nil {
panic("ValidatorIMock.GetTokensFunc: method is nil but ValidatorI.GetTokens was just called")
}
callInfo := struct {
}{}
mock.lockGetTokens.Lock()
mock.calls.GetTokens = append(mock.calls.GetTokens, callInfo)
mock.lockGetTokens.Unlock()
return mock.GetTokensFunc()
}
// GetTokensCalls gets all the calls that were made to GetTokens.
// Check the length with:
//
// len(mockedValidatorI.GetTokensCalls())
func (mock *ValidatorIMock) GetTokensCalls() []struct {
} {
var calls []struct {
}
mock.lockGetTokens.RLock()
calls = mock.calls.GetTokens
mock.lockGetTokens.RUnlock()
return calls
}
// IsBonded calls IsBondedFunc.
func (mock *ValidatorIMock) IsBonded() bool {
if mock.IsBondedFunc == nil {
panic("ValidatorIMock.IsBondedFunc: method is nil but ValidatorI.IsBonded was just called")
}
callInfo := struct {
}{}
mock.lockIsBonded.Lock()
mock.calls.IsBonded = append(mock.calls.IsBonded, callInfo)
mock.lockIsBonded.Unlock()
return mock.IsBondedFunc()
}
// IsBondedCalls gets all the calls that were made to IsBonded.
// Check the length with:
//
// len(mockedValidatorI.IsBondedCalls())
func (mock *ValidatorIMock) IsBondedCalls() []struct {
} {
var calls []struct {
}
mock.lockIsBonded.RLock()
calls = mock.calls.IsBonded
mock.lockIsBonded.RUnlock()
return calls
}
// IsJailed calls IsJailedFunc.
func (mock *ValidatorIMock) IsJailed() bool {
if mock.IsJailedFunc == nil {
panic("ValidatorIMock.IsJailedFunc: method is nil but ValidatorI.IsJailed was just called")
}
callInfo := struct {
}{}
mock.lockIsJailed.Lock()
mock.calls.IsJailed = append(mock.calls.IsJailed, callInfo)
mock.lockIsJailed.Unlock()
return mock.IsJailedFunc()
}
// IsJailedCalls gets all the calls that were made to IsJailed.
// Check the length with:
//
// len(mockedValidatorI.IsJailedCalls())
func (mock *ValidatorIMock) IsJailedCalls() []struct {
} {
var calls []struct {
}
mock.lockIsJailed.RLock()
calls = mock.calls.IsJailed
mock.lockIsJailed.RUnlock()
return calls
}
// IsUnbonded calls IsUnbondedFunc.
func (mock *ValidatorIMock) IsUnbonded() bool {
if mock.IsUnbondedFunc == nil {
panic("ValidatorIMock.IsUnbondedFunc: method is nil but ValidatorI.IsUnbonded was just called")
}
callInfo := struct {
}{}
mock.lockIsUnbonded.Lock()
mock.calls.IsUnbonded = append(mock.calls.IsUnbonded, callInfo)
mock.lockIsUnbonded.Unlock()
return mock.IsUnbondedFunc()
}
// IsUnbondedCalls gets all the calls that were made to IsUnbonded.
// Check the length with:
//
// len(mockedValidatorI.IsUnbondedCalls())
func (mock *ValidatorIMock) IsUnbondedCalls() []struct {
} {
var calls []struct {
}
mock.lockIsUnbonded.RLock()
calls = mock.calls.IsUnbonded
mock.lockIsUnbonded.RUnlock()
return calls
}
// IsUnbonding calls IsUnbondingFunc.
func (mock *ValidatorIMock) IsUnbonding() bool {
if mock.IsUnbondingFunc == nil {
panic("ValidatorIMock.IsUnbondingFunc: method is nil but ValidatorI.IsUnbonding was just called")
}
callInfo := struct {
}{}
mock.lockIsUnbonding.Lock()
mock.calls.IsUnbonding = append(mock.calls.IsUnbonding, callInfo)
mock.lockIsUnbonding.Unlock()
return mock.IsUnbondingFunc()
}
// IsUnbondingCalls gets all the calls that were made to IsUnbonding.
// Check the length with:
//
// len(mockedValidatorI.IsUnbondingCalls())
func (mock *ValidatorIMock) IsUnbondingCalls() []struct {
} {
var calls []struct {
}
mock.lockIsUnbonding.RLock()
calls = mock.calls.IsUnbonding
mock.lockIsUnbonding.RUnlock()
return calls
}
// SharesFromTokens calls SharesFromTokensFunc.
func (mock *ValidatorIMock) SharesFromTokens(amt cosmossdktypes.Int) (cosmossdktypes.Dec, error) {
if mock.SharesFromTokensFunc == nil {
panic("ValidatorIMock.SharesFromTokensFunc: method is nil but ValidatorI.SharesFromTokens was just called")
}
callInfo := struct {
Amt cosmossdktypes.Int
}{
Amt: amt,
}
mock.lockSharesFromTokens.Lock()
mock.calls.SharesFromTokens = append(mock.calls.SharesFromTokens, callInfo)
mock.lockSharesFromTokens.Unlock()
return mock.SharesFromTokensFunc(amt)
}
// SharesFromTokensCalls gets all the calls that were made to SharesFromTokens.
// Check the length with:
//
// len(mockedValidatorI.SharesFromTokensCalls())
func (mock *ValidatorIMock) SharesFromTokensCalls() []struct {
Amt cosmossdktypes.Int
} {
var calls []struct {
Amt cosmossdktypes.Int
}
mock.lockSharesFromTokens.RLock()
calls = mock.calls.SharesFromTokens
mock.lockSharesFromTokens.RUnlock()
return calls
}
// SharesFromTokensTruncated calls SharesFromTokensTruncatedFunc.
func (mock *ValidatorIMock) SharesFromTokensTruncated(amt cosmossdktypes.Int) (cosmossdktypes.Dec, error) {
if mock.SharesFromTokensTruncatedFunc == nil {
panic("ValidatorIMock.SharesFromTokensTruncatedFunc: method is nil but ValidatorI.SharesFromTokensTruncated was just called")
}
callInfo := struct {
Amt cosmossdktypes.Int
}{
Amt: amt,
}
mock.lockSharesFromTokensTruncated.Lock()
mock.calls.SharesFromTokensTruncated = append(mock.calls.SharesFromTokensTruncated, callInfo)
mock.lockSharesFromTokensTruncated.Unlock()
return mock.SharesFromTokensTruncatedFunc(amt)
}
// SharesFromTokensTruncatedCalls gets all the calls that were made to SharesFromTokensTruncated.
// Check the length with:
//
// len(mockedValidatorI.SharesFromTokensTruncatedCalls())
func (mock *ValidatorIMock) SharesFromTokensTruncatedCalls() []struct {
Amt cosmossdktypes.Int
} {
var calls []struct {
Amt cosmossdktypes.Int
}
mock.lockSharesFromTokensTruncated.RLock()
calls = mock.calls.SharesFromTokensTruncated
mock.lockSharesFromTokensTruncated.RUnlock()
return calls
}
// TmConsPublicKey calls TmConsPublicKeyFunc.
func (mock *ValidatorIMock) TmConsPublicKey() (crypto.PublicKey, error) {
if mock.TmConsPublicKeyFunc == nil {
panic("ValidatorIMock.TmConsPublicKeyFunc: method is nil but ValidatorI.TmConsPublicKey was just called")
}
callInfo := struct {
}{}
mock.lockTmConsPublicKey.Lock()
mock.calls.TmConsPublicKey = append(mock.calls.TmConsPublicKey, callInfo)
mock.lockTmConsPublicKey.Unlock()
return mock.TmConsPublicKeyFunc()
}
// TmConsPublicKeyCalls gets all the calls that were made to TmConsPublicKey.
// Check the length with:
//
// len(mockedValidatorI.TmConsPublicKeyCalls())
func (mock *ValidatorIMock) TmConsPublicKeyCalls() []struct {
} {
var calls []struct {
}
mock.lockTmConsPublicKey.RLock()
calls = mock.calls.TmConsPublicKey
mock.lockTmConsPublicKey.RUnlock()
return calls
}
// TokensFromShares calls TokensFromSharesFunc.
func (mock *ValidatorIMock) TokensFromShares(dec cosmossdktypes.Dec) cosmossdktypes.Dec {
if mock.TokensFromSharesFunc == nil {
panic("ValidatorIMock.TokensFromSharesFunc: method is nil but ValidatorI.TokensFromShares was just called")
}
callInfo := struct {
Dec cosmossdktypes.Dec
}{
Dec: dec,
}
mock.lockTokensFromShares.Lock()
mock.calls.TokensFromShares = append(mock.calls.TokensFromShares, callInfo)
mock.lockTokensFromShares.Unlock()
return mock.TokensFromSharesFunc(dec)
}
// TokensFromSharesCalls gets all the calls that were made to TokensFromShares.
// Check the length with:
//
// len(mockedValidatorI.TokensFromSharesCalls())
func (mock *ValidatorIMock) TokensFromSharesCalls() []struct {
Dec cosmossdktypes.Dec
} {
var calls []struct {
Dec cosmossdktypes.Dec
}
mock.lockTokensFromShares.RLock()
calls = mock.calls.TokensFromShares
mock.lockTokensFromShares.RUnlock()
return calls
}
// TokensFromSharesRoundUp calls TokensFromSharesRoundUpFunc.
func (mock *ValidatorIMock) TokensFromSharesRoundUp(dec cosmossdktypes.Dec) cosmossdktypes.Dec {
if mock.TokensFromSharesRoundUpFunc == nil {
panic("ValidatorIMock.TokensFromSharesRoundUpFunc: method is nil but ValidatorI.TokensFromSharesRoundUp was just called")
}
callInfo := struct {
Dec cosmossdktypes.Dec
}{
Dec: dec,
}
mock.lockTokensFromSharesRoundUp.Lock()
mock.calls.TokensFromSharesRoundUp = append(mock.calls.TokensFromSharesRoundUp, callInfo)
mock.lockTokensFromSharesRoundUp.Unlock()
return mock.TokensFromSharesRoundUpFunc(dec)
}
// TokensFromSharesRoundUpCalls gets all the calls that were made to TokensFromSharesRoundUp.
// Check the length with:
//
// len(mockedValidatorI.TokensFromSharesRoundUpCalls())
func (mock *ValidatorIMock) TokensFromSharesRoundUpCalls() []struct {
Dec cosmossdktypes.Dec
} {
var calls []struct {
Dec cosmossdktypes.Dec
}
mock.lockTokensFromSharesRoundUp.RLock()
calls = mock.calls.TokensFromSharesRoundUp
mock.lockTokensFromSharesRoundUp.RUnlock()
return calls
}
// TokensFromSharesTruncated calls TokensFromSharesTruncatedFunc.
func (mock *ValidatorIMock) TokensFromSharesTruncated(dec cosmossdktypes.Dec) cosmossdktypes.Dec {
if mock.TokensFromSharesTruncatedFunc == nil {
panic("ValidatorIMock.TokensFromSharesTruncatedFunc: method is nil but ValidatorI.TokensFromSharesTruncated was just called")
}
callInfo := struct {
Dec cosmossdktypes.Dec
}{
Dec: dec,
}
mock.lockTokensFromSharesTruncated.Lock()
mock.calls.TokensFromSharesTruncated = append(mock.calls.TokensFromSharesTruncated, callInfo)
mock.lockTokensFromSharesTruncated.Unlock()
return mock.TokensFromSharesTruncatedFunc(dec)
}
// TokensFromSharesTruncatedCalls gets all the calls that were made to TokensFromSharesTruncated.
// Check the length with:
//
// len(mockedValidatorI.TokensFromSharesTruncatedCalls())
func (mock *ValidatorIMock) TokensFromSharesTruncatedCalls() []struct {
Dec cosmossdktypes.Dec
} {
var calls []struct {
Dec cosmossdktypes.Dec
}
mock.lockTokensFromSharesTruncated.RLock()
calls = mock.calls.TokensFromSharesTruncated
mock.lockTokensFromSharesTruncated.RUnlock()
return calls
}