-
Notifications
You must be signed in to change notification settings - Fork 109
/
expected_keepers.go
2197 lines (2066 loc) · 76.1 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 (
axelarnettypes "github.com/axelarnetwork/axelar-core/x/axelarnet/types"
exported "github.com/axelarnetwork/axelar-core/x/nexus/exported"
cosmossdktypes "github.com/cosmos/cosmos-sdk/types"
ibctypes "github.com/cosmos/ibc-go/modules/apps/transfer/types"
clienttypes "github.com/cosmos/ibc-go/modules/core/02-client/types"
ibcclient "github.com/cosmos/ibc-go/modules/core/exported"
tmbytes "github.com/tendermint/tendermint/libs/bytes"
"github.com/tendermint/tendermint/libs/log"
"sync"
)
// Ensure, that BaseKeeperMock does implement axelarnettypes.BaseKeeper.
// If this is not the case, regenerate this file with moq.
var _ axelarnettypes.BaseKeeper = &BaseKeeperMock{}
// BaseKeeperMock is a mock implementation of axelarnettypes.BaseKeeper.
//
// func TestSomethingThatUsesBaseKeeper(t *testing.T) {
//
// // make and configure a mocked axelarnettypes.BaseKeeper
// mockedBaseKeeper := &BaseKeeperMock{
// DeletePendingIBCTransferFunc: func(ctx cosmossdktypes.Context, portID string, channelID string, sequence uint64) {
// panic("mock out the DeletePendingIBCTransfer method")
// },
// GetAssetFunc: func(ctx cosmossdktypes.Context, chain string, denom string) (axelarnettypes.Asset, bool) {
// panic("mock out the GetAsset method")
// },
// GetCosmosChainByAssetFunc: func(ctx cosmossdktypes.Context, asset string) (axelarnettypes.CosmosChain, bool) {
// panic("mock out the GetCosmosChainByAsset method")
// },
// GetCosmosChainByNameFunc: func(ctx cosmossdktypes.Context, chain string) (axelarnettypes.CosmosChain, bool) {
// panic("mock out the GetCosmosChainByName method")
// },
// GetCosmosChainsFunc: func(ctx cosmossdktypes.Context) []string {
// panic("mock out the GetCosmosChains method")
// },
// GetFeeCollectorFunc: func(ctx cosmossdktypes.Context) (cosmossdktypes.AccAddress, bool) {
// panic("mock out the GetFeeCollector method")
// },
// GetIBCPathFunc: func(ctx cosmossdktypes.Context, chain string) (string, bool) {
// panic("mock out the GetIBCPath method")
// },
// GetPendingIBCTransferFunc: func(ctx cosmossdktypes.Context, portID string, channelID string, sequence uint64) (axelarnettypes.IBCTransfer, bool) {
// panic("mock out the GetPendingIBCTransfer method")
// },
// GetRouteTimeoutWindowFunc: func(ctx cosmossdktypes.Context) uint64 {
// panic("mock out the GetRouteTimeoutWindow method")
// },
// GetTransactionFeeRateFunc: func(ctx cosmossdktypes.Context) cosmossdktypes.Dec {
// panic("mock out the GetTransactionFeeRate method")
// },
// LoggerFunc: func(ctx cosmossdktypes.Context) log.Logger {
// panic("mock out the Logger method")
// },
// RegisterAssetToCosmosChainFunc: func(ctx cosmossdktypes.Context, asset axelarnettypes.Asset, chain string) error {
// panic("mock out the RegisterAssetToCosmosChain method")
// },
// RegisterIBCPathFunc: func(ctx cosmossdktypes.Context, asset string, path string) error {
// panic("mock out the RegisterIBCPath method")
// },
// SetCosmosChainFunc: func(ctx cosmossdktypes.Context, chain axelarnettypes.CosmosChain) {
// panic("mock out the SetCosmosChain method")
// },
// SetFeeCollectorFunc: func(ctx cosmossdktypes.Context, address cosmossdktypes.AccAddress) error {
// panic("mock out the SetFeeCollector method")
// },
// SetPendingIBCTransferFunc: func(ctx cosmossdktypes.Context, transfer axelarnettypes.IBCTransfer) {
// panic("mock out the SetPendingIBCTransfer method")
// },
// }
//
// // use mockedBaseKeeper in code that requires axelarnettypes.BaseKeeper
// // and then make assertions.
//
// }
type BaseKeeperMock struct {
// DeletePendingIBCTransferFunc mocks the DeletePendingIBCTransfer method.
DeletePendingIBCTransferFunc func(ctx cosmossdktypes.Context, portID string, channelID string, sequence uint64)
// GetAssetFunc mocks the GetAsset method.
GetAssetFunc func(ctx cosmossdktypes.Context, chain string, denom string) (axelarnettypes.Asset, bool)
// GetCosmosChainByAssetFunc mocks the GetCosmosChainByAsset method.
GetCosmosChainByAssetFunc func(ctx cosmossdktypes.Context, asset string) (axelarnettypes.CosmosChain, bool)
// GetCosmosChainByNameFunc mocks the GetCosmosChainByName method.
GetCosmosChainByNameFunc func(ctx cosmossdktypes.Context, chain string) (axelarnettypes.CosmosChain, bool)
// GetCosmosChainsFunc mocks the GetCosmosChains method.
GetCosmosChainsFunc func(ctx cosmossdktypes.Context) []string
// GetFeeCollectorFunc mocks the GetFeeCollector method.
GetFeeCollectorFunc func(ctx cosmossdktypes.Context) (cosmossdktypes.AccAddress, bool)
// GetIBCPathFunc mocks the GetIBCPath method.
GetIBCPathFunc func(ctx cosmossdktypes.Context, chain string) (string, bool)
// GetPendingIBCTransferFunc mocks the GetPendingIBCTransfer method.
GetPendingIBCTransferFunc func(ctx cosmossdktypes.Context, portID string, channelID string, sequence uint64) (axelarnettypes.IBCTransfer, bool)
// GetRouteTimeoutWindowFunc mocks the GetRouteTimeoutWindow method.
GetRouteTimeoutWindowFunc func(ctx cosmossdktypes.Context) uint64
// GetTransactionFeeRateFunc mocks the GetTransactionFeeRate method.
GetTransactionFeeRateFunc func(ctx cosmossdktypes.Context) cosmossdktypes.Dec
// LoggerFunc mocks the Logger method.
LoggerFunc func(ctx cosmossdktypes.Context) log.Logger
// RegisterAssetToCosmosChainFunc mocks the RegisterAssetToCosmosChain method.
RegisterAssetToCosmosChainFunc func(ctx cosmossdktypes.Context, asset axelarnettypes.Asset, chain string) error
// RegisterIBCPathFunc mocks the RegisterIBCPath method.
RegisterIBCPathFunc func(ctx cosmossdktypes.Context, asset string, path string) error
// SetCosmosChainFunc mocks the SetCosmosChain method.
SetCosmosChainFunc func(ctx cosmossdktypes.Context, chain axelarnettypes.CosmosChain)
// SetFeeCollectorFunc mocks the SetFeeCollector method.
SetFeeCollectorFunc func(ctx cosmossdktypes.Context, address cosmossdktypes.AccAddress) error
// SetPendingIBCTransferFunc mocks the SetPendingIBCTransfer method.
SetPendingIBCTransferFunc func(ctx cosmossdktypes.Context, transfer axelarnettypes.IBCTransfer)
// calls tracks calls to the methods.
calls struct {
// DeletePendingIBCTransfer holds details about calls to the DeletePendingIBCTransfer method.
DeletePendingIBCTransfer []struct {
// Ctx is the ctx argument value.
Ctx cosmossdktypes.Context
// PortID is the portID argument value.
PortID string
// ChannelID is the channelID argument value.
ChannelID string
// Sequence is the sequence argument value.
Sequence uint64
}
// GetAsset holds details about calls to the GetAsset method.
GetAsset []struct {
// Ctx is the ctx argument value.
Ctx cosmossdktypes.Context
// Chain is the chain argument value.
Chain string
// Denom is the denom argument value.
Denom string
}
// GetCosmosChainByAsset holds details about calls to the GetCosmosChainByAsset method.
GetCosmosChainByAsset []struct {
// Ctx is the ctx argument value.
Ctx cosmossdktypes.Context
// Asset is the asset argument value.
Asset string
}
// GetCosmosChainByName holds details about calls to the GetCosmosChainByName method.
GetCosmosChainByName []struct {
// Ctx is the ctx argument value.
Ctx cosmossdktypes.Context
// Chain is the chain argument value.
Chain string
}
// GetCosmosChains holds details about calls to the GetCosmosChains method.
GetCosmosChains []struct {
// Ctx is the ctx argument value.
Ctx cosmossdktypes.Context
}
// GetFeeCollector holds details about calls to the GetFeeCollector method.
GetFeeCollector []struct {
// Ctx is the ctx argument value.
Ctx cosmossdktypes.Context
}
// GetIBCPath holds details about calls to the GetIBCPath method.
GetIBCPath []struct {
// Ctx is the ctx argument value.
Ctx cosmossdktypes.Context
// Chain is the chain argument value.
Chain string
}
// GetPendingIBCTransfer holds details about calls to the GetPendingIBCTransfer method.
GetPendingIBCTransfer []struct {
// Ctx is the ctx argument value.
Ctx cosmossdktypes.Context
// PortID is the portID argument value.
PortID string
// ChannelID is the channelID argument value.
ChannelID string
// Sequence is the sequence argument value.
Sequence uint64
}
// GetRouteTimeoutWindow holds details about calls to the GetRouteTimeoutWindow method.
GetRouteTimeoutWindow []struct {
// Ctx is the ctx argument value.
Ctx cosmossdktypes.Context
}
// GetTransactionFeeRate holds details about calls to the GetTransactionFeeRate method.
GetTransactionFeeRate []struct {
// Ctx is the ctx argument value.
Ctx cosmossdktypes.Context
}
// Logger holds details about calls to the Logger method.
Logger []struct {
// Ctx is the ctx argument value.
Ctx cosmossdktypes.Context
}
// RegisterAssetToCosmosChain holds details about calls to the RegisterAssetToCosmosChain method.
RegisterAssetToCosmosChain []struct {
// Ctx is the ctx argument value.
Ctx cosmossdktypes.Context
// Asset is the asset argument value.
Asset axelarnettypes.Asset
// Chain is the chain argument value.
Chain string
}
// RegisterIBCPath holds details about calls to the RegisterIBCPath method.
RegisterIBCPath []struct {
// Ctx is the ctx argument value.
Ctx cosmossdktypes.Context
// Asset is the asset argument value.
Asset string
// Path is the path argument value.
Path string
}
// SetCosmosChain holds details about calls to the SetCosmosChain method.
SetCosmosChain []struct {
// Ctx is the ctx argument value.
Ctx cosmossdktypes.Context
// Chain is the chain argument value.
Chain axelarnettypes.CosmosChain
}
// SetFeeCollector holds details about calls to the SetFeeCollector method.
SetFeeCollector []struct {
// Ctx is the ctx argument value.
Ctx cosmossdktypes.Context
// Address is the address argument value.
Address cosmossdktypes.AccAddress
}
// SetPendingIBCTransfer holds details about calls to the SetPendingIBCTransfer method.
SetPendingIBCTransfer []struct {
// Ctx is the ctx argument value.
Ctx cosmossdktypes.Context
// Transfer is the transfer argument value.
Transfer axelarnettypes.IBCTransfer
}
}
lockDeletePendingIBCTransfer sync.RWMutex
lockGetAsset sync.RWMutex
lockGetCosmosChainByAsset sync.RWMutex
lockGetCosmosChainByName sync.RWMutex
lockGetCosmosChains sync.RWMutex
lockGetFeeCollector sync.RWMutex
lockGetIBCPath sync.RWMutex
lockGetPendingIBCTransfer sync.RWMutex
lockGetRouteTimeoutWindow sync.RWMutex
lockGetTransactionFeeRate sync.RWMutex
lockLogger sync.RWMutex
lockRegisterAssetToCosmosChain sync.RWMutex
lockRegisterIBCPath sync.RWMutex
lockSetCosmosChain sync.RWMutex
lockSetFeeCollector sync.RWMutex
lockSetPendingIBCTransfer sync.RWMutex
}
// DeletePendingIBCTransfer calls DeletePendingIBCTransferFunc.
func (mock *BaseKeeperMock) DeletePendingIBCTransfer(ctx cosmossdktypes.Context, portID string, channelID string, sequence uint64) {
if mock.DeletePendingIBCTransferFunc == nil {
panic("BaseKeeperMock.DeletePendingIBCTransferFunc: method is nil but BaseKeeper.DeletePendingIBCTransfer was just called")
}
callInfo := struct {
Ctx cosmossdktypes.Context
PortID string
ChannelID string
Sequence uint64
}{
Ctx: ctx,
PortID: portID,
ChannelID: channelID,
Sequence: sequence,
}
mock.lockDeletePendingIBCTransfer.Lock()
mock.calls.DeletePendingIBCTransfer = append(mock.calls.DeletePendingIBCTransfer, callInfo)
mock.lockDeletePendingIBCTransfer.Unlock()
mock.DeletePendingIBCTransferFunc(ctx, portID, channelID, sequence)
}
// DeletePendingIBCTransferCalls gets all the calls that were made to DeletePendingIBCTransfer.
// Check the length with:
// len(mockedBaseKeeper.DeletePendingIBCTransferCalls())
func (mock *BaseKeeperMock) DeletePendingIBCTransferCalls() []struct {
Ctx cosmossdktypes.Context
PortID string
ChannelID string
Sequence uint64
} {
var calls []struct {
Ctx cosmossdktypes.Context
PortID string
ChannelID string
Sequence uint64
}
mock.lockDeletePendingIBCTransfer.RLock()
calls = mock.calls.DeletePendingIBCTransfer
mock.lockDeletePendingIBCTransfer.RUnlock()
return calls
}
// GetAsset calls GetAssetFunc.
func (mock *BaseKeeperMock) GetAsset(ctx cosmossdktypes.Context, chain string, denom string) (axelarnettypes.Asset, bool) {
if mock.GetAssetFunc == nil {
panic("BaseKeeperMock.GetAssetFunc: method is nil but BaseKeeper.GetAsset was just called")
}
callInfo := struct {
Ctx cosmossdktypes.Context
Chain string
Denom string
}{
Ctx: ctx,
Chain: chain,
Denom: denom,
}
mock.lockGetAsset.Lock()
mock.calls.GetAsset = append(mock.calls.GetAsset, callInfo)
mock.lockGetAsset.Unlock()
return mock.GetAssetFunc(ctx, chain, denom)
}
// GetAssetCalls gets all the calls that were made to GetAsset.
// Check the length with:
// len(mockedBaseKeeper.GetAssetCalls())
func (mock *BaseKeeperMock) GetAssetCalls() []struct {
Ctx cosmossdktypes.Context
Chain string
Denom string
} {
var calls []struct {
Ctx cosmossdktypes.Context
Chain string
Denom string
}
mock.lockGetAsset.RLock()
calls = mock.calls.GetAsset
mock.lockGetAsset.RUnlock()
return calls
}
// GetCosmosChainByAsset calls GetCosmosChainByAssetFunc.
func (mock *BaseKeeperMock) GetCosmosChainByAsset(ctx cosmossdktypes.Context, asset string) (axelarnettypes.CosmosChain, bool) {
if mock.GetCosmosChainByAssetFunc == nil {
panic("BaseKeeperMock.GetCosmosChainByAssetFunc: method is nil but BaseKeeper.GetCosmosChainByAsset was just called")
}
callInfo := struct {
Ctx cosmossdktypes.Context
Asset string
}{
Ctx: ctx,
Asset: asset,
}
mock.lockGetCosmosChainByAsset.Lock()
mock.calls.GetCosmosChainByAsset = append(mock.calls.GetCosmosChainByAsset, callInfo)
mock.lockGetCosmosChainByAsset.Unlock()
return mock.GetCosmosChainByAssetFunc(ctx, asset)
}
// GetCosmosChainByAssetCalls gets all the calls that were made to GetCosmosChainByAsset.
// Check the length with:
// len(mockedBaseKeeper.GetCosmosChainByAssetCalls())
func (mock *BaseKeeperMock) GetCosmosChainByAssetCalls() []struct {
Ctx cosmossdktypes.Context
Asset string
} {
var calls []struct {
Ctx cosmossdktypes.Context
Asset string
}
mock.lockGetCosmosChainByAsset.RLock()
calls = mock.calls.GetCosmosChainByAsset
mock.lockGetCosmosChainByAsset.RUnlock()
return calls
}
// GetCosmosChainByName calls GetCosmosChainByNameFunc.
func (mock *BaseKeeperMock) GetCosmosChainByName(ctx cosmossdktypes.Context, chain string) (axelarnettypes.CosmosChain, bool) {
if mock.GetCosmosChainByNameFunc == nil {
panic("BaseKeeperMock.GetCosmosChainByNameFunc: method is nil but BaseKeeper.GetCosmosChainByName was just called")
}
callInfo := struct {
Ctx cosmossdktypes.Context
Chain string
}{
Ctx: ctx,
Chain: chain,
}
mock.lockGetCosmosChainByName.Lock()
mock.calls.GetCosmosChainByName = append(mock.calls.GetCosmosChainByName, callInfo)
mock.lockGetCosmosChainByName.Unlock()
return mock.GetCosmosChainByNameFunc(ctx, chain)
}
// GetCosmosChainByNameCalls gets all the calls that were made to GetCosmosChainByName.
// Check the length with:
// len(mockedBaseKeeper.GetCosmosChainByNameCalls())
func (mock *BaseKeeperMock) GetCosmosChainByNameCalls() []struct {
Ctx cosmossdktypes.Context
Chain string
} {
var calls []struct {
Ctx cosmossdktypes.Context
Chain string
}
mock.lockGetCosmosChainByName.RLock()
calls = mock.calls.GetCosmosChainByName
mock.lockGetCosmosChainByName.RUnlock()
return calls
}
// GetCosmosChains calls GetCosmosChainsFunc.
func (mock *BaseKeeperMock) GetCosmosChains(ctx cosmossdktypes.Context) []string {
if mock.GetCosmosChainsFunc == nil {
panic("BaseKeeperMock.GetCosmosChainsFunc: method is nil but BaseKeeper.GetCosmosChains was just called")
}
callInfo := struct {
Ctx cosmossdktypes.Context
}{
Ctx: ctx,
}
mock.lockGetCosmosChains.Lock()
mock.calls.GetCosmosChains = append(mock.calls.GetCosmosChains, callInfo)
mock.lockGetCosmosChains.Unlock()
return mock.GetCosmosChainsFunc(ctx)
}
// GetCosmosChainsCalls gets all the calls that were made to GetCosmosChains.
// Check the length with:
// len(mockedBaseKeeper.GetCosmosChainsCalls())
func (mock *BaseKeeperMock) GetCosmosChainsCalls() []struct {
Ctx cosmossdktypes.Context
} {
var calls []struct {
Ctx cosmossdktypes.Context
}
mock.lockGetCosmosChains.RLock()
calls = mock.calls.GetCosmosChains
mock.lockGetCosmosChains.RUnlock()
return calls
}
// GetFeeCollector calls GetFeeCollectorFunc.
func (mock *BaseKeeperMock) GetFeeCollector(ctx cosmossdktypes.Context) (cosmossdktypes.AccAddress, bool) {
if mock.GetFeeCollectorFunc == nil {
panic("BaseKeeperMock.GetFeeCollectorFunc: method is nil but BaseKeeper.GetFeeCollector was just called")
}
callInfo := struct {
Ctx cosmossdktypes.Context
}{
Ctx: ctx,
}
mock.lockGetFeeCollector.Lock()
mock.calls.GetFeeCollector = append(mock.calls.GetFeeCollector, callInfo)
mock.lockGetFeeCollector.Unlock()
return mock.GetFeeCollectorFunc(ctx)
}
// GetFeeCollectorCalls gets all the calls that were made to GetFeeCollector.
// Check the length with:
// len(mockedBaseKeeper.GetFeeCollectorCalls())
func (mock *BaseKeeperMock) GetFeeCollectorCalls() []struct {
Ctx cosmossdktypes.Context
} {
var calls []struct {
Ctx cosmossdktypes.Context
}
mock.lockGetFeeCollector.RLock()
calls = mock.calls.GetFeeCollector
mock.lockGetFeeCollector.RUnlock()
return calls
}
// GetIBCPath calls GetIBCPathFunc.
func (mock *BaseKeeperMock) GetIBCPath(ctx cosmossdktypes.Context, chain string) (string, bool) {
if mock.GetIBCPathFunc == nil {
panic("BaseKeeperMock.GetIBCPathFunc: method is nil but BaseKeeper.GetIBCPath was just called")
}
callInfo := struct {
Ctx cosmossdktypes.Context
Chain string
}{
Ctx: ctx,
Chain: chain,
}
mock.lockGetIBCPath.Lock()
mock.calls.GetIBCPath = append(mock.calls.GetIBCPath, callInfo)
mock.lockGetIBCPath.Unlock()
return mock.GetIBCPathFunc(ctx, chain)
}
// GetIBCPathCalls gets all the calls that were made to GetIBCPath.
// Check the length with:
// len(mockedBaseKeeper.GetIBCPathCalls())
func (mock *BaseKeeperMock) GetIBCPathCalls() []struct {
Ctx cosmossdktypes.Context
Chain string
} {
var calls []struct {
Ctx cosmossdktypes.Context
Chain string
}
mock.lockGetIBCPath.RLock()
calls = mock.calls.GetIBCPath
mock.lockGetIBCPath.RUnlock()
return calls
}
// GetPendingIBCTransfer calls GetPendingIBCTransferFunc.
func (mock *BaseKeeperMock) GetPendingIBCTransfer(ctx cosmossdktypes.Context, portID string, channelID string, sequence uint64) (axelarnettypes.IBCTransfer, bool) {
if mock.GetPendingIBCTransferFunc == nil {
panic("BaseKeeperMock.GetPendingIBCTransferFunc: method is nil but BaseKeeper.GetPendingIBCTransfer was just called")
}
callInfo := struct {
Ctx cosmossdktypes.Context
PortID string
ChannelID string
Sequence uint64
}{
Ctx: ctx,
PortID: portID,
ChannelID: channelID,
Sequence: sequence,
}
mock.lockGetPendingIBCTransfer.Lock()
mock.calls.GetPendingIBCTransfer = append(mock.calls.GetPendingIBCTransfer, callInfo)
mock.lockGetPendingIBCTransfer.Unlock()
return mock.GetPendingIBCTransferFunc(ctx, portID, channelID, sequence)
}
// GetPendingIBCTransferCalls gets all the calls that were made to GetPendingIBCTransfer.
// Check the length with:
// len(mockedBaseKeeper.GetPendingIBCTransferCalls())
func (mock *BaseKeeperMock) GetPendingIBCTransferCalls() []struct {
Ctx cosmossdktypes.Context
PortID string
ChannelID string
Sequence uint64
} {
var calls []struct {
Ctx cosmossdktypes.Context
PortID string
ChannelID string
Sequence uint64
}
mock.lockGetPendingIBCTransfer.RLock()
calls = mock.calls.GetPendingIBCTransfer
mock.lockGetPendingIBCTransfer.RUnlock()
return calls
}
// GetRouteTimeoutWindow calls GetRouteTimeoutWindowFunc.
func (mock *BaseKeeperMock) GetRouteTimeoutWindow(ctx cosmossdktypes.Context) uint64 {
if mock.GetRouteTimeoutWindowFunc == nil {
panic("BaseKeeperMock.GetRouteTimeoutWindowFunc: method is nil but BaseKeeper.GetRouteTimeoutWindow was just called")
}
callInfo := struct {
Ctx cosmossdktypes.Context
}{
Ctx: ctx,
}
mock.lockGetRouteTimeoutWindow.Lock()
mock.calls.GetRouteTimeoutWindow = append(mock.calls.GetRouteTimeoutWindow, callInfo)
mock.lockGetRouteTimeoutWindow.Unlock()
return mock.GetRouteTimeoutWindowFunc(ctx)
}
// GetRouteTimeoutWindowCalls gets all the calls that were made to GetRouteTimeoutWindow.
// Check the length with:
// len(mockedBaseKeeper.GetRouteTimeoutWindowCalls())
func (mock *BaseKeeperMock) GetRouteTimeoutWindowCalls() []struct {
Ctx cosmossdktypes.Context
} {
var calls []struct {
Ctx cosmossdktypes.Context
}
mock.lockGetRouteTimeoutWindow.RLock()
calls = mock.calls.GetRouteTimeoutWindow
mock.lockGetRouteTimeoutWindow.RUnlock()
return calls
}
// GetTransactionFeeRate calls GetTransactionFeeRateFunc.
func (mock *BaseKeeperMock) GetTransactionFeeRate(ctx cosmossdktypes.Context) cosmossdktypes.Dec {
if mock.GetTransactionFeeRateFunc == nil {
panic("BaseKeeperMock.GetTransactionFeeRateFunc: method is nil but BaseKeeper.GetTransactionFeeRate was just called")
}
callInfo := struct {
Ctx cosmossdktypes.Context
}{
Ctx: ctx,
}
mock.lockGetTransactionFeeRate.Lock()
mock.calls.GetTransactionFeeRate = append(mock.calls.GetTransactionFeeRate, callInfo)
mock.lockGetTransactionFeeRate.Unlock()
return mock.GetTransactionFeeRateFunc(ctx)
}
// GetTransactionFeeRateCalls gets all the calls that were made to GetTransactionFeeRate.
// Check the length with:
// len(mockedBaseKeeper.GetTransactionFeeRateCalls())
func (mock *BaseKeeperMock) GetTransactionFeeRateCalls() []struct {
Ctx cosmossdktypes.Context
} {
var calls []struct {
Ctx cosmossdktypes.Context
}
mock.lockGetTransactionFeeRate.RLock()
calls = mock.calls.GetTransactionFeeRate
mock.lockGetTransactionFeeRate.RUnlock()
return calls
}
// Logger calls LoggerFunc.
func (mock *BaseKeeperMock) Logger(ctx cosmossdktypes.Context) log.Logger {
if mock.LoggerFunc == nil {
panic("BaseKeeperMock.LoggerFunc: method is nil but BaseKeeper.Logger was just called")
}
callInfo := struct {
Ctx cosmossdktypes.Context
}{
Ctx: ctx,
}
mock.lockLogger.Lock()
mock.calls.Logger = append(mock.calls.Logger, callInfo)
mock.lockLogger.Unlock()
return mock.LoggerFunc(ctx)
}
// LoggerCalls gets all the calls that were made to Logger.
// Check the length with:
// len(mockedBaseKeeper.LoggerCalls())
func (mock *BaseKeeperMock) LoggerCalls() []struct {
Ctx cosmossdktypes.Context
} {
var calls []struct {
Ctx cosmossdktypes.Context
}
mock.lockLogger.RLock()
calls = mock.calls.Logger
mock.lockLogger.RUnlock()
return calls
}
// RegisterAssetToCosmosChain calls RegisterAssetToCosmosChainFunc.
func (mock *BaseKeeperMock) RegisterAssetToCosmosChain(ctx cosmossdktypes.Context, asset axelarnettypes.Asset, chain string) error {
if mock.RegisterAssetToCosmosChainFunc == nil {
panic("BaseKeeperMock.RegisterAssetToCosmosChainFunc: method is nil but BaseKeeper.RegisterAssetToCosmosChain was just called")
}
callInfo := struct {
Ctx cosmossdktypes.Context
Asset axelarnettypes.Asset
Chain string
}{
Ctx: ctx,
Asset: asset,
Chain: chain,
}
mock.lockRegisterAssetToCosmosChain.Lock()
mock.calls.RegisterAssetToCosmosChain = append(mock.calls.RegisterAssetToCosmosChain, callInfo)
mock.lockRegisterAssetToCosmosChain.Unlock()
return mock.RegisterAssetToCosmosChainFunc(ctx, asset, chain)
}
// RegisterAssetToCosmosChainCalls gets all the calls that were made to RegisterAssetToCosmosChain.
// Check the length with:
// len(mockedBaseKeeper.RegisterAssetToCosmosChainCalls())
func (mock *BaseKeeperMock) RegisterAssetToCosmosChainCalls() []struct {
Ctx cosmossdktypes.Context
Asset axelarnettypes.Asset
Chain string
} {
var calls []struct {
Ctx cosmossdktypes.Context
Asset axelarnettypes.Asset
Chain string
}
mock.lockRegisterAssetToCosmosChain.RLock()
calls = mock.calls.RegisterAssetToCosmosChain
mock.lockRegisterAssetToCosmosChain.RUnlock()
return calls
}
// RegisterIBCPath calls RegisterIBCPathFunc.
func (mock *BaseKeeperMock) RegisterIBCPath(ctx cosmossdktypes.Context, asset string, path string) error {
if mock.RegisterIBCPathFunc == nil {
panic("BaseKeeperMock.RegisterIBCPathFunc: method is nil but BaseKeeper.RegisterIBCPath was just called")
}
callInfo := struct {
Ctx cosmossdktypes.Context
Asset string
Path string
}{
Ctx: ctx,
Asset: asset,
Path: path,
}
mock.lockRegisterIBCPath.Lock()
mock.calls.RegisterIBCPath = append(mock.calls.RegisterIBCPath, callInfo)
mock.lockRegisterIBCPath.Unlock()
return mock.RegisterIBCPathFunc(ctx, asset, path)
}
// RegisterIBCPathCalls gets all the calls that were made to RegisterIBCPath.
// Check the length with:
// len(mockedBaseKeeper.RegisterIBCPathCalls())
func (mock *BaseKeeperMock) RegisterIBCPathCalls() []struct {
Ctx cosmossdktypes.Context
Asset string
Path string
} {
var calls []struct {
Ctx cosmossdktypes.Context
Asset string
Path string
}
mock.lockRegisterIBCPath.RLock()
calls = mock.calls.RegisterIBCPath
mock.lockRegisterIBCPath.RUnlock()
return calls
}
// SetCosmosChain calls SetCosmosChainFunc.
func (mock *BaseKeeperMock) SetCosmosChain(ctx cosmossdktypes.Context, chain axelarnettypes.CosmosChain) {
if mock.SetCosmosChainFunc == nil {
panic("BaseKeeperMock.SetCosmosChainFunc: method is nil but BaseKeeper.SetCosmosChain was just called")
}
callInfo := struct {
Ctx cosmossdktypes.Context
Chain axelarnettypes.CosmosChain
}{
Ctx: ctx,
Chain: chain,
}
mock.lockSetCosmosChain.Lock()
mock.calls.SetCosmosChain = append(mock.calls.SetCosmosChain, callInfo)
mock.lockSetCosmosChain.Unlock()
mock.SetCosmosChainFunc(ctx, chain)
}
// SetCosmosChainCalls gets all the calls that were made to SetCosmosChain.
// Check the length with:
// len(mockedBaseKeeper.SetCosmosChainCalls())
func (mock *BaseKeeperMock) SetCosmosChainCalls() []struct {
Ctx cosmossdktypes.Context
Chain axelarnettypes.CosmosChain
} {
var calls []struct {
Ctx cosmossdktypes.Context
Chain axelarnettypes.CosmosChain
}
mock.lockSetCosmosChain.RLock()
calls = mock.calls.SetCosmosChain
mock.lockSetCosmosChain.RUnlock()
return calls
}
// SetFeeCollector calls SetFeeCollectorFunc.
func (mock *BaseKeeperMock) SetFeeCollector(ctx cosmossdktypes.Context, address cosmossdktypes.AccAddress) error {
if mock.SetFeeCollectorFunc == nil {
panic("BaseKeeperMock.SetFeeCollectorFunc: method is nil but BaseKeeper.SetFeeCollector was just called")
}
callInfo := struct {
Ctx cosmossdktypes.Context
Address cosmossdktypes.AccAddress
}{
Ctx: ctx,
Address: address,
}
mock.lockSetFeeCollector.Lock()
mock.calls.SetFeeCollector = append(mock.calls.SetFeeCollector, callInfo)
mock.lockSetFeeCollector.Unlock()
return mock.SetFeeCollectorFunc(ctx, address)
}
// SetFeeCollectorCalls gets all the calls that were made to SetFeeCollector.
// Check the length with:
// len(mockedBaseKeeper.SetFeeCollectorCalls())
func (mock *BaseKeeperMock) SetFeeCollectorCalls() []struct {
Ctx cosmossdktypes.Context
Address cosmossdktypes.AccAddress
} {
var calls []struct {
Ctx cosmossdktypes.Context
Address cosmossdktypes.AccAddress
}
mock.lockSetFeeCollector.RLock()
calls = mock.calls.SetFeeCollector
mock.lockSetFeeCollector.RUnlock()
return calls
}
// SetPendingIBCTransfer calls SetPendingIBCTransferFunc.
func (mock *BaseKeeperMock) SetPendingIBCTransfer(ctx cosmossdktypes.Context, transfer axelarnettypes.IBCTransfer) {
if mock.SetPendingIBCTransferFunc == nil {
panic("BaseKeeperMock.SetPendingIBCTransferFunc: method is nil but BaseKeeper.SetPendingIBCTransfer was just called")
}
callInfo := struct {
Ctx cosmossdktypes.Context
Transfer axelarnettypes.IBCTransfer
}{
Ctx: ctx,
Transfer: transfer,
}
mock.lockSetPendingIBCTransfer.Lock()
mock.calls.SetPendingIBCTransfer = append(mock.calls.SetPendingIBCTransfer, callInfo)
mock.lockSetPendingIBCTransfer.Unlock()
mock.SetPendingIBCTransferFunc(ctx, transfer)
}
// SetPendingIBCTransferCalls gets all the calls that were made to SetPendingIBCTransfer.
// Check the length with:
// len(mockedBaseKeeper.SetPendingIBCTransferCalls())
func (mock *BaseKeeperMock) SetPendingIBCTransferCalls() []struct {
Ctx cosmossdktypes.Context
Transfer axelarnettypes.IBCTransfer
} {
var calls []struct {
Ctx cosmossdktypes.Context
Transfer axelarnettypes.IBCTransfer
}
mock.lockSetPendingIBCTransfer.RLock()
calls = mock.calls.SetPendingIBCTransfer
mock.lockSetPendingIBCTransfer.RUnlock()
return calls
}
// Ensure, that NexusMock does implement axelarnettypes.Nexus.
// If this is not the case, regenerate this file with moq.
var _ axelarnettypes.Nexus = &NexusMock{}
// NexusMock is a mock implementation of axelarnettypes.Nexus.
//
// func TestSomethingThatUsesNexus(t *testing.T) {
//
// // make and configure a mocked axelarnettypes.Nexus
// mockedNexus := &NexusMock{
// ActivateChainFunc: func(ctx cosmossdktypes.Context, chain exported.Chain) {
// panic("mock out the ActivateChain method")
// },
// ArchivePendingTransferFunc: func(ctx cosmossdktypes.Context, transfer exported.CrossChainTransfer) {
// panic("mock out the ArchivePendingTransfer method")
// },
// EnqueueForTransferFunc: func(ctx cosmossdktypes.Context, sender exported.CrossChainAddress, amount cosmossdktypes.Coin, feeRate cosmossdktypes.Dec) (exported.TransferID, error) {
// panic("mock out the EnqueueForTransfer method")
// },
// GetChainFunc: func(ctx cosmossdktypes.Context, chain string) (exported.Chain, bool) {
// panic("mock out the GetChain method")
// },
// GetRecipientFunc: func(ctx cosmossdktypes.Context, sender exported.CrossChainAddress) (exported.CrossChainAddress, bool) {
// panic("mock out the GetRecipient method")
// },
// GetTransferFeesFunc: func(ctx cosmossdktypes.Context) cosmossdktypes.Coins {
// panic("mock out the GetTransferFees method")
// },
// GetTransfersForChainFunc: func(ctx cosmossdktypes.Context, chain exported.Chain, state exported.TransferState) []exported.CrossChainTransfer {
// panic("mock out the GetTransfersForChain method")
// },
// IsAssetRegisteredFunc: func(ctx cosmossdktypes.Context, chain exported.Chain, denom string) bool {
// panic("mock out the IsAssetRegistered method")
// },
// LinkAddressesFunc: func(ctx cosmossdktypes.Context, sender exported.CrossChainAddress, recipient exported.CrossChainAddress) error {
// panic("mock out the LinkAddresses method")
// },
// RegisterAssetFunc: func(ctx cosmossdktypes.Context, chain exported.Chain, denom string) {
// panic("mock out the RegisterAsset method")
// },
// SetChainFunc: func(ctx cosmossdktypes.Context, chain exported.Chain) {
// panic("mock out the SetChain method")
// },
// SubTransferFeeFunc: func(ctx cosmossdktypes.Context, coin cosmossdktypes.Coin) {
// panic("mock out the SubTransferFee method")
// },
// }
//
// // use mockedNexus in code that requires axelarnettypes.Nexus
// // and then make assertions.
//
// }
type NexusMock struct {
// ActivateChainFunc mocks the ActivateChain method.
ActivateChainFunc func(ctx cosmossdktypes.Context, chain exported.Chain)
// ArchivePendingTransferFunc mocks the ArchivePendingTransfer method.
ArchivePendingTransferFunc func(ctx cosmossdktypes.Context, transfer exported.CrossChainTransfer)
// EnqueueForTransferFunc mocks the EnqueueForTransfer method.
EnqueueForTransferFunc func(ctx cosmossdktypes.Context, sender exported.CrossChainAddress, amount cosmossdktypes.Coin, feeRate cosmossdktypes.Dec) (exported.TransferID, error)
// GetChainFunc mocks the GetChain method.
GetChainFunc func(ctx cosmossdktypes.Context, chain string) (exported.Chain, bool)
// GetRecipientFunc mocks the GetRecipient method.
GetRecipientFunc func(ctx cosmossdktypes.Context, sender exported.CrossChainAddress) (exported.CrossChainAddress, bool)
// GetTransferFeesFunc mocks the GetTransferFees method.
GetTransferFeesFunc func(ctx cosmossdktypes.Context) cosmossdktypes.Coins
// GetTransfersForChainFunc mocks the GetTransfersForChain method.
GetTransfersForChainFunc func(ctx cosmossdktypes.Context, chain exported.Chain, state exported.TransferState) []exported.CrossChainTransfer
// IsAssetRegisteredFunc mocks the IsAssetRegistered method.
IsAssetRegisteredFunc func(ctx cosmossdktypes.Context, chain exported.Chain, denom string) bool
// LinkAddressesFunc mocks the LinkAddresses method.
LinkAddressesFunc func(ctx cosmossdktypes.Context, sender exported.CrossChainAddress, recipient exported.CrossChainAddress) error
// RegisterAssetFunc mocks the RegisterAsset method.
RegisterAssetFunc func(ctx cosmossdktypes.Context, chain exported.Chain, denom string)
// SetChainFunc mocks the SetChain method.
SetChainFunc func(ctx cosmossdktypes.Context, chain exported.Chain)
// SubTransferFeeFunc mocks the SubTransferFee method.
SubTransferFeeFunc func(ctx cosmossdktypes.Context, coin cosmossdktypes.Coin)
// calls tracks calls to the methods.
calls struct {
// ActivateChain holds details about calls to the ActivateChain method.
ActivateChain []struct {
// Ctx is the ctx argument value.
Ctx cosmossdktypes.Context
// Chain is the chain argument value.
Chain exported.Chain
}
// ArchivePendingTransfer holds details about calls to the ArchivePendingTransfer method.
ArchivePendingTransfer []struct {
// Ctx is the ctx argument value.
Ctx cosmossdktypes.Context
// Transfer is the transfer argument value.
Transfer exported.CrossChainTransfer
}
// EnqueueForTransfer holds details about calls to the EnqueueForTransfer method.
EnqueueForTransfer []struct {
// Ctx is the ctx argument value.
Ctx cosmossdktypes.Context
// Sender is the sender argument value.
Sender exported.CrossChainAddress
// Amount is the amount argument value.
Amount cosmossdktypes.Coin
// FeeRate is the feeRate argument value.
FeeRate cosmossdktypes.Dec
}
// GetChain holds details about calls to the GetChain method.
GetChain []struct {
// Ctx is the ctx argument value.
Ctx cosmossdktypes.Context
// Chain is the chain argument value.
Chain string
}
// GetRecipient holds details about calls to the GetRecipient method.
GetRecipient []struct {
// Ctx is the ctx argument value.
Ctx cosmossdktypes.Context
// Sender is the sender argument value.
Sender exported.CrossChainAddress
}
// GetTransferFees holds details about calls to the GetTransferFees method.
GetTransferFees []struct {
// Ctx is the ctx argument value.
Ctx cosmossdktypes.Context
}
// GetTransfersForChain holds details about calls to the GetTransfersForChain method.
GetTransfersForChain []struct {
// Ctx is the ctx argument value.
Ctx cosmossdktypes.Context
// Chain is the chain argument value.
Chain exported.Chain
// State is the state argument value.
State exported.TransferState
}
// IsAssetRegistered holds details about calls to the IsAssetRegistered method.
IsAssetRegistered []struct {
// Ctx is the ctx argument value.
Ctx cosmossdktypes.Context
// Chain is the chain argument value.
Chain exported.Chain
// Denom is the denom argument value.
Denom string
}
// LinkAddresses holds details about calls to the LinkAddresses method.
LinkAddresses []struct {
// Ctx is the ctx argument value.
Ctx cosmossdktypes.Context
// Sender is the sender argument value.
Sender exported.CrossChainAddress
// Recipient is the recipient argument value.
Recipient exported.CrossChainAddress
}
// RegisterAsset holds details about calls to the RegisterAsset method.
RegisterAsset []struct {
// Ctx is the ctx argument value.