-
Notifications
You must be signed in to change notification settings - Fork 44
/
open_short_checker.go
790 lines (648 loc) · 29.9 KB
/
open_short_checker.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
// Code generated by mockery v2.32.4. DO NOT EDIT.
package mocks
import (
math "cosmossdk.io/math"
ammtypes "github.com/elys-network/elys/x/amm/types"
mock "github.com/stretchr/testify/mock"
perpetualtypes "github.com/elys-network/elys/x/perpetual/types"
types "github.com/cosmos/cosmos-sdk/types"
)
// OpenShortChecker is an autogenerated mock type for the OpenShortChecker type
type OpenShortChecker struct {
mock.Mock
}
type OpenShortChecker_Expecter struct {
mock *mock.Mock
}
func (_m *OpenShortChecker) EXPECT() *OpenShortChecker_Expecter {
return &OpenShortChecker_Expecter{mock: &_m.Mock}
}
// Borrow provides a mock function with given fields: ctx, collateralAmount, custodyAmount, mtp, ammPool, pool, eta, baseCurrency, isBroker
func (_m *OpenShortChecker) Borrow(ctx types.Context, collateralAmount math.Int, custodyAmount math.Int, mtp *perpetualtypes.MTP, ammPool *ammtypes.Pool, pool *perpetualtypes.Pool, eta math.LegacyDec, baseCurrency string, isBroker bool) error {
ret := _m.Called(ctx, collateralAmount, custodyAmount, mtp, ammPool, pool, eta, baseCurrency, isBroker)
var r0 error
if rf, ok := ret.Get(0).(func(types.Context, math.Int, math.Int, *perpetualtypes.MTP, *ammtypes.Pool, *perpetualtypes.Pool, math.LegacyDec, string, bool) error); ok {
r0 = rf(ctx, collateralAmount, custodyAmount, mtp, ammPool, pool, eta, baseCurrency, isBroker)
} else {
r0 = ret.Error(0)
}
return r0
}
// OpenShortChecker_Borrow_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Borrow'
type OpenShortChecker_Borrow_Call struct {
*mock.Call
}
// Borrow is a helper method to define mock.On call
// - ctx types.Context
// - collateralAmount math.Int
// - custodyAmount math.Int
// - mtp *perpetualtypes.MTP
// - ammPool *ammtypes.Pool
// - pool *perpetualtypes.Pool
// - eta math.LegacyDec
// - baseCurrency string
// - isBroker bool
func (_e *OpenShortChecker_Expecter) Borrow(ctx interface{}, collateralAmount interface{}, custodyAmount interface{}, mtp interface{}, ammPool interface{}, pool interface{}, eta interface{}, baseCurrency interface{}, isBroker interface{}) *OpenShortChecker_Borrow_Call {
return &OpenShortChecker_Borrow_Call{Call: _e.mock.On("Borrow", ctx, collateralAmount, custodyAmount, mtp, ammPool, pool, eta, baseCurrency, isBroker)}
}
func (_c *OpenShortChecker_Borrow_Call) Run(run func(ctx types.Context, collateralAmount math.Int, custodyAmount math.Int, mtp *perpetualtypes.MTP, ammPool *ammtypes.Pool, pool *perpetualtypes.Pool, eta math.LegacyDec, baseCurrency string, isBroker bool)) *OpenShortChecker_Borrow_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(types.Context), args[1].(math.Int), args[2].(math.Int), args[3].(*perpetualtypes.MTP), args[4].(*ammtypes.Pool), args[5].(*perpetualtypes.Pool), args[6].(math.LegacyDec), args[7].(string), args[8].(bool))
})
return _c
}
func (_c *OpenShortChecker_Borrow_Call) Return(_a0 error) *OpenShortChecker_Borrow_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *OpenShortChecker_Borrow_Call) RunAndReturn(run func(types.Context, math.Int, math.Int, *perpetualtypes.MTP, *ammtypes.Pool, *perpetualtypes.Pool, math.LegacyDec, string, bool) error) *OpenShortChecker_Borrow_Call {
_c.Call.Return(run)
return _c
}
// CalcMTPConsolidateCollateral provides a mock function with given fields: ctx, mtp, baseCurrency
func (_m *OpenShortChecker) CalcMTPConsolidateCollateral(ctx types.Context, mtp *perpetualtypes.MTP, baseCurrency string) error {
ret := _m.Called(ctx, mtp, baseCurrency)
var r0 error
if rf, ok := ret.Get(0).(func(types.Context, *perpetualtypes.MTP, string) error); ok {
r0 = rf(ctx, mtp, baseCurrency)
} else {
r0 = ret.Error(0)
}
return r0
}
// OpenShortChecker_CalcMTPConsolidateCollateral_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CalcMTPConsolidateCollateral'
type OpenShortChecker_CalcMTPConsolidateCollateral_Call struct {
*mock.Call
}
// CalcMTPConsolidateCollateral is a helper method to define mock.On call
// - ctx types.Context
// - mtp *perpetualtypes.MTP
// - baseCurrency string
func (_e *OpenShortChecker_Expecter) CalcMTPConsolidateCollateral(ctx interface{}, mtp interface{}, baseCurrency interface{}) *OpenShortChecker_CalcMTPConsolidateCollateral_Call {
return &OpenShortChecker_CalcMTPConsolidateCollateral_Call{Call: _e.mock.On("CalcMTPConsolidateCollateral", ctx, mtp, baseCurrency)}
}
func (_c *OpenShortChecker_CalcMTPConsolidateCollateral_Call) Run(run func(ctx types.Context, mtp *perpetualtypes.MTP, baseCurrency string)) *OpenShortChecker_CalcMTPConsolidateCollateral_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(types.Context), args[1].(*perpetualtypes.MTP), args[2].(string))
})
return _c
}
func (_c *OpenShortChecker_CalcMTPConsolidateCollateral_Call) Return(_a0 error) *OpenShortChecker_CalcMTPConsolidateCollateral_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *OpenShortChecker_CalcMTPConsolidateCollateral_Call) RunAndReturn(run func(types.Context, *perpetualtypes.MTP, string) error) *OpenShortChecker_CalcMTPConsolidateCollateral_Call {
_c.Call.Return(run)
return _c
}
// CheckMinLiabilities provides a mock function with given fields: ctx, collateralTokenAmt, eta, ammPool, borrowAsset, baseCurrency
func (_m *OpenShortChecker) CheckMinLiabilities(ctx types.Context, collateralTokenAmt types.Coin, eta math.LegacyDec, ammPool ammtypes.Pool, borrowAsset string, baseCurrency string) error {
ret := _m.Called(ctx, collateralTokenAmt, eta, ammPool, borrowAsset, baseCurrency)
var r0 error
if rf, ok := ret.Get(0).(func(types.Context, types.Coin, math.LegacyDec, ammtypes.Pool, string, string) error); ok {
r0 = rf(ctx, collateralTokenAmt, eta, ammPool, borrowAsset, baseCurrency)
} else {
r0 = ret.Error(0)
}
return r0
}
// OpenShortChecker_CheckMinLiabilities_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CheckMinLiabilities'
type OpenShortChecker_CheckMinLiabilities_Call struct {
*mock.Call
}
// CheckMinLiabilities is a helper method to define mock.On call
// - ctx types.Context
// - collateralTokenAmt types.Coin
// - eta math.LegacyDec
// - ammPool ammtypes.Pool
// - borrowAsset string
// - baseCurrency string
func (_e *OpenShortChecker_Expecter) CheckMinLiabilities(ctx interface{}, collateralTokenAmt interface{}, eta interface{}, ammPool interface{}, borrowAsset interface{}, baseCurrency interface{}) *OpenShortChecker_CheckMinLiabilities_Call {
return &OpenShortChecker_CheckMinLiabilities_Call{Call: _e.mock.On("CheckMinLiabilities", ctx, collateralTokenAmt, eta, ammPool, borrowAsset, baseCurrency)}
}
func (_c *OpenShortChecker_CheckMinLiabilities_Call) Run(run func(ctx types.Context, collateralTokenAmt types.Coin, eta math.LegacyDec, ammPool ammtypes.Pool, borrowAsset string, baseCurrency string)) *OpenShortChecker_CheckMinLiabilities_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(types.Context), args[1].(types.Coin), args[2].(math.LegacyDec), args[3].(ammtypes.Pool), args[4].(string), args[5].(string))
})
return _c
}
func (_c *OpenShortChecker_CheckMinLiabilities_Call) Return(_a0 error) *OpenShortChecker_CheckMinLiabilities_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *OpenShortChecker_CheckMinLiabilities_Call) RunAndReturn(run func(types.Context, types.Coin, math.LegacyDec, ammtypes.Pool, string, string) error) *OpenShortChecker_CheckMinLiabilities_Call {
_c.Call.Return(run)
return _c
}
// CheckSameAssetPosition provides a mock function with given fields: ctx, msg
func (_m *OpenShortChecker) CheckSameAssetPosition(ctx types.Context, msg *perpetualtypes.MsgOpen) *perpetualtypes.MTP {
ret := _m.Called(ctx, msg)
var r0 *perpetualtypes.MTP
if rf, ok := ret.Get(0).(func(types.Context, *perpetualtypes.MsgOpen) *perpetualtypes.MTP); ok {
r0 = rf(ctx, msg)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*perpetualtypes.MTP)
}
}
return r0
}
// OpenShortChecker_CheckSameAssetPosition_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CheckSameAssetPosition'
type OpenShortChecker_CheckSameAssetPosition_Call struct {
*mock.Call
}
// CheckSameAssetPosition is a helper method to define mock.On call
// - ctx types.Context
// - msg *perpetualtypes.MsgOpen
func (_e *OpenShortChecker_Expecter) CheckSameAssetPosition(ctx interface{}, msg interface{}) *OpenShortChecker_CheckSameAssetPosition_Call {
return &OpenShortChecker_CheckSameAssetPosition_Call{Call: _e.mock.On("CheckSameAssetPosition", ctx, msg)}
}
func (_c *OpenShortChecker_CheckSameAssetPosition_Call) Run(run func(ctx types.Context, msg *perpetualtypes.MsgOpen)) *OpenShortChecker_CheckSameAssetPosition_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(types.Context), args[1].(*perpetualtypes.MsgOpen))
})
return _c
}
func (_c *OpenShortChecker_CheckSameAssetPosition_Call) Return(_a0 *perpetualtypes.MTP) *OpenShortChecker_CheckSameAssetPosition_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *OpenShortChecker_CheckSameAssetPosition_Call) RunAndReturn(run func(types.Context, *perpetualtypes.MsgOpen) *perpetualtypes.MTP) *OpenShortChecker_CheckSameAssetPosition_Call {
_c.Call.Return(run)
return _c
}
// EstimateSwap provides a mock function with given fields: ctx, leveragedAmtTokenIn, borrowAsset, ammPool
func (_m *OpenShortChecker) EstimateSwap(ctx types.Context, leveragedAmtTokenIn types.Coin, borrowAsset string, ammPool ammtypes.Pool) (math.Int, error) {
ret := _m.Called(ctx, leveragedAmtTokenIn, borrowAsset, ammPool)
var r0 math.Int
var r1 error
if rf, ok := ret.Get(0).(func(types.Context, types.Coin, string, ammtypes.Pool) (math.Int, error)); ok {
return rf(ctx, leveragedAmtTokenIn, borrowAsset, ammPool)
}
if rf, ok := ret.Get(0).(func(types.Context, types.Coin, string, ammtypes.Pool) math.Int); ok {
r0 = rf(ctx, leveragedAmtTokenIn, borrowAsset, ammPool)
} else {
r0 = ret.Get(0).(math.Int)
}
if rf, ok := ret.Get(1).(func(types.Context, types.Coin, string, ammtypes.Pool) error); ok {
r1 = rf(ctx, leveragedAmtTokenIn, borrowAsset, ammPool)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// OpenShortChecker_EstimateSwap_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EstimateSwap'
type OpenShortChecker_EstimateSwap_Call struct {
*mock.Call
}
// EstimateSwap is a helper method to define mock.On call
// - ctx types.Context
// - leveragedAmtTokenIn types.Coin
// - borrowAsset string
// - ammPool ammtypes.Pool
func (_e *OpenShortChecker_Expecter) EstimateSwap(ctx interface{}, leveragedAmtTokenIn interface{}, borrowAsset interface{}, ammPool interface{}) *OpenShortChecker_EstimateSwap_Call {
return &OpenShortChecker_EstimateSwap_Call{Call: _e.mock.On("EstimateSwap", ctx, leveragedAmtTokenIn, borrowAsset, ammPool)}
}
func (_c *OpenShortChecker_EstimateSwap_Call) Run(run func(ctx types.Context, leveragedAmtTokenIn types.Coin, borrowAsset string, ammPool ammtypes.Pool)) *OpenShortChecker_EstimateSwap_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(types.Context), args[1].(types.Coin), args[2].(string), args[3].(ammtypes.Pool))
})
return _c
}
func (_c *OpenShortChecker_EstimateSwap_Call) Return(_a0 math.Int, _a1 error) *OpenShortChecker_EstimateSwap_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *OpenShortChecker_EstimateSwap_Call) RunAndReturn(run func(types.Context, types.Coin, string, ammtypes.Pool) (math.Int, error)) *OpenShortChecker_EstimateSwap_Call {
_c.Call.Return(run)
return _c
}
// EstimateSwapGivenOut provides a mock function with given fields: ctx, tokenOutAmount, tokenInDenom, ammPool
func (_m *OpenShortChecker) EstimateSwapGivenOut(ctx types.Context, tokenOutAmount types.Coin, tokenInDenom string, ammPool ammtypes.Pool) (math.Int, error) {
ret := _m.Called(ctx, tokenOutAmount, tokenInDenom, ammPool)
var r0 math.Int
var r1 error
if rf, ok := ret.Get(0).(func(types.Context, types.Coin, string, ammtypes.Pool) (math.Int, error)); ok {
return rf(ctx, tokenOutAmount, tokenInDenom, ammPool)
}
if rf, ok := ret.Get(0).(func(types.Context, types.Coin, string, ammtypes.Pool) math.Int); ok {
r0 = rf(ctx, tokenOutAmount, tokenInDenom, ammPool)
} else {
r0 = ret.Get(0).(math.Int)
}
if rf, ok := ret.Get(1).(func(types.Context, types.Coin, string, ammtypes.Pool) error); ok {
r1 = rf(ctx, tokenOutAmount, tokenInDenom, ammPool)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// OpenShortChecker_EstimateSwapGivenOut_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EstimateSwapGivenOut'
type OpenShortChecker_EstimateSwapGivenOut_Call struct {
*mock.Call
}
// EstimateSwapGivenOut is a helper method to define mock.On call
// - ctx types.Context
// - tokenOutAmount types.Coin
// - tokenInDenom string
// - ammPool ammtypes.Pool
func (_e *OpenShortChecker_Expecter) EstimateSwapGivenOut(ctx interface{}, tokenOutAmount interface{}, tokenInDenom interface{}, ammPool interface{}) *OpenShortChecker_EstimateSwapGivenOut_Call {
return &OpenShortChecker_EstimateSwapGivenOut_Call{Call: _e.mock.On("EstimateSwapGivenOut", ctx, tokenOutAmount, tokenInDenom, ammPool)}
}
func (_c *OpenShortChecker_EstimateSwapGivenOut_Call) Run(run func(ctx types.Context, tokenOutAmount types.Coin, tokenInDenom string, ammPool ammtypes.Pool)) *OpenShortChecker_EstimateSwapGivenOut_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(types.Context), args[1].(types.Coin), args[2].(string), args[3].(ammtypes.Pool))
})
return _c
}
func (_c *OpenShortChecker_EstimateSwapGivenOut_Call) Return(_a0 math.Int, _a1 error) *OpenShortChecker_EstimateSwapGivenOut_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *OpenShortChecker_EstimateSwapGivenOut_Call) RunAndReturn(run func(types.Context, types.Coin, string, ammtypes.Pool) (math.Int, error)) *OpenShortChecker_EstimateSwapGivenOut_Call {
_c.Call.Return(run)
return _c
}
// GetAmmPool provides a mock function with given fields: ctx, poolId, tradingAsset
func (_m *OpenShortChecker) GetAmmPool(ctx types.Context, poolId uint64, tradingAsset string) (ammtypes.Pool, error) {
ret := _m.Called(ctx, poolId, tradingAsset)
var r0 ammtypes.Pool
var r1 error
if rf, ok := ret.Get(0).(func(types.Context, uint64, string) (ammtypes.Pool, error)); ok {
return rf(ctx, poolId, tradingAsset)
}
if rf, ok := ret.Get(0).(func(types.Context, uint64, string) ammtypes.Pool); ok {
r0 = rf(ctx, poolId, tradingAsset)
} else {
r0 = ret.Get(0).(ammtypes.Pool)
}
if rf, ok := ret.Get(1).(func(types.Context, uint64, string) error); ok {
r1 = rf(ctx, poolId, tradingAsset)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// OpenShortChecker_GetAmmPool_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAmmPool'
type OpenShortChecker_GetAmmPool_Call struct {
*mock.Call
}
// GetAmmPool is a helper method to define mock.On call
// - ctx types.Context
// - poolId uint64
// - tradingAsset string
func (_e *OpenShortChecker_Expecter) GetAmmPool(ctx interface{}, poolId interface{}, tradingAsset interface{}) *OpenShortChecker_GetAmmPool_Call {
return &OpenShortChecker_GetAmmPool_Call{Call: _e.mock.On("GetAmmPool", ctx, poolId, tradingAsset)}
}
func (_c *OpenShortChecker_GetAmmPool_Call) Run(run func(ctx types.Context, poolId uint64, tradingAsset string)) *OpenShortChecker_GetAmmPool_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(types.Context), args[1].(uint64), args[2].(string))
})
return _c
}
func (_c *OpenShortChecker_GetAmmPool_Call) Return(_a0 ammtypes.Pool, _a1 error) *OpenShortChecker_GetAmmPool_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *OpenShortChecker_GetAmmPool_Call) RunAndReturn(run func(types.Context, uint64, string) (ammtypes.Pool, error)) *OpenShortChecker_GetAmmPool_Call {
_c.Call.Return(run)
return _c
}
// GetMaxLeverageParam provides a mock function with given fields: ctx
func (_m *OpenShortChecker) GetMaxLeverageParam(ctx types.Context) math.LegacyDec {
ret := _m.Called(ctx)
var r0 math.LegacyDec
if rf, ok := ret.Get(0).(func(types.Context) math.LegacyDec); ok {
r0 = rf(ctx)
} else {
r0 = ret.Get(0).(math.LegacyDec)
}
return r0
}
// OpenShortChecker_GetMaxLeverageParam_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetMaxLeverageParam'
type OpenShortChecker_GetMaxLeverageParam_Call struct {
*mock.Call
}
// GetMaxLeverageParam is a helper method to define mock.On call
// - ctx types.Context
func (_e *OpenShortChecker_Expecter) GetMaxLeverageParam(ctx interface{}) *OpenShortChecker_GetMaxLeverageParam_Call {
return &OpenShortChecker_GetMaxLeverageParam_Call{Call: _e.mock.On("GetMaxLeverageParam", ctx)}
}
func (_c *OpenShortChecker_GetMaxLeverageParam_Call) Run(run func(ctx types.Context)) *OpenShortChecker_GetMaxLeverageParam_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(types.Context))
})
return _c
}
func (_c *OpenShortChecker_GetMaxLeverageParam_Call) Return(_a0 math.LegacyDec) *OpenShortChecker_GetMaxLeverageParam_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *OpenShortChecker_GetMaxLeverageParam_Call) RunAndReturn(run func(types.Context) math.LegacyDec) *OpenShortChecker_GetMaxLeverageParam_Call {
_c.Call.Return(run)
return _c
}
// GetPool provides a mock function with given fields: ctx, poolId
func (_m *OpenShortChecker) GetPool(ctx types.Context, poolId uint64) (perpetualtypes.Pool, bool) {
ret := _m.Called(ctx, poolId)
var r0 perpetualtypes.Pool
var r1 bool
if rf, ok := ret.Get(0).(func(types.Context, uint64) (perpetualtypes.Pool, bool)); ok {
return rf(ctx, poolId)
}
if rf, ok := ret.Get(0).(func(types.Context, uint64) perpetualtypes.Pool); ok {
r0 = rf(ctx, poolId)
} else {
r0 = ret.Get(0).(perpetualtypes.Pool)
}
if rf, ok := ret.Get(1).(func(types.Context, uint64) bool); ok {
r1 = rf(ctx, poolId)
} else {
r1 = ret.Get(1).(bool)
}
return r0, r1
}
// OpenShortChecker_GetPool_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPool'
type OpenShortChecker_GetPool_Call struct {
*mock.Call
}
// GetPool is a helper method to define mock.On call
// - ctx types.Context
// - poolId uint64
func (_e *OpenShortChecker_Expecter) GetPool(ctx interface{}, poolId interface{}) *OpenShortChecker_GetPool_Call {
return &OpenShortChecker_GetPool_Call{Call: _e.mock.On("GetPool", ctx, poolId)}
}
func (_c *OpenShortChecker_GetPool_Call) Run(run func(ctx types.Context, poolId uint64)) *OpenShortChecker_GetPool_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(types.Context), args[1].(uint64))
})
return _c
}
func (_c *OpenShortChecker_GetPool_Call) Return(_a0 perpetualtypes.Pool, _a1 bool) *OpenShortChecker_GetPool_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *OpenShortChecker_GetPool_Call) RunAndReturn(run func(types.Context, uint64) (perpetualtypes.Pool, bool)) *OpenShortChecker_GetPool_Call {
_c.Call.Return(run)
return _c
}
// GetSafetyFactor provides a mock function with given fields: ctx
func (_m *OpenShortChecker) GetSafetyFactor(ctx types.Context) math.LegacyDec {
ret := _m.Called(ctx)
var r0 math.LegacyDec
if rf, ok := ret.Get(0).(func(types.Context) math.LegacyDec); ok {
r0 = rf(ctx)
} else {
r0 = ret.Get(0).(math.LegacyDec)
}
return r0
}
// OpenShortChecker_GetSafetyFactor_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSafetyFactor'
type OpenShortChecker_GetSafetyFactor_Call struct {
*mock.Call
}
// GetSafetyFactor is a helper method to define mock.On call
// - ctx types.Context
func (_e *OpenShortChecker_Expecter) GetSafetyFactor(ctx interface{}) *OpenShortChecker_GetSafetyFactor_Call {
return &OpenShortChecker_GetSafetyFactor_Call{Call: _e.mock.On("GetSafetyFactor", ctx)}
}
func (_c *OpenShortChecker_GetSafetyFactor_Call) Run(run func(ctx types.Context)) *OpenShortChecker_GetSafetyFactor_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(types.Context))
})
return _c
}
func (_c *OpenShortChecker_GetSafetyFactor_Call) Return(_a0 math.LegacyDec) *OpenShortChecker_GetSafetyFactor_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *OpenShortChecker_GetSafetyFactor_Call) RunAndReturn(run func(types.Context) math.LegacyDec) *OpenShortChecker_GetSafetyFactor_Call {
_c.Call.Return(run)
return _c
}
// IsPoolEnabled provides a mock function with given fields: ctx, poolId
func (_m *OpenShortChecker) IsPoolEnabled(ctx types.Context, poolId uint64) bool {
ret := _m.Called(ctx, poolId)
var r0 bool
if rf, ok := ret.Get(0).(func(types.Context, uint64) bool); ok {
r0 = rf(ctx, poolId)
} else {
r0 = ret.Get(0).(bool)
}
return r0
}
// OpenShortChecker_IsPoolEnabled_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsPoolEnabled'
type OpenShortChecker_IsPoolEnabled_Call struct {
*mock.Call
}
// IsPoolEnabled is a helper method to define mock.On call
// - ctx types.Context
// - poolId uint64
func (_e *OpenShortChecker_Expecter) IsPoolEnabled(ctx interface{}, poolId interface{}) *OpenShortChecker_IsPoolEnabled_Call {
return &OpenShortChecker_IsPoolEnabled_Call{Call: _e.mock.On("IsPoolEnabled", ctx, poolId)}
}
func (_c *OpenShortChecker_IsPoolEnabled_Call) Run(run func(ctx types.Context, poolId uint64)) *OpenShortChecker_IsPoolEnabled_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(types.Context), args[1].(uint64))
})
return _c
}
func (_c *OpenShortChecker_IsPoolEnabled_Call) Return(_a0 bool) *OpenShortChecker_IsPoolEnabled_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *OpenShortChecker_IsPoolEnabled_Call) RunAndReturn(run func(types.Context, uint64) bool) *OpenShortChecker_IsPoolEnabled_Call {
_c.Call.Return(run)
return _c
}
// SetMTP provides a mock function with given fields: ctx, mtp
func (_m *OpenShortChecker) SetMTP(ctx types.Context, mtp *perpetualtypes.MTP) error {
ret := _m.Called(ctx, mtp)
var r0 error
if rf, ok := ret.Get(0).(func(types.Context, *perpetualtypes.MTP) error); ok {
r0 = rf(ctx, mtp)
} else {
r0 = ret.Error(0)
}
return r0
}
// OpenShortChecker_SetMTP_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetMTP'
type OpenShortChecker_SetMTP_Call struct {
*mock.Call
}
// SetMTP is a helper method to define mock.On call
// - ctx types.Context
// - mtp *perpetualtypes.MTP
func (_e *OpenShortChecker_Expecter) SetMTP(ctx interface{}, mtp interface{}) *OpenShortChecker_SetMTP_Call {
return &OpenShortChecker_SetMTP_Call{Call: _e.mock.On("SetMTP", ctx, mtp)}
}
func (_c *OpenShortChecker_SetMTP_Call) Run(run func(ctx types.Context, mtp *perpetualtypes.MTP)) *OpenShortChecker_SetMTP_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(types.Context), args[1].(*perpetualtypes.MTP))
})
return _c
}
func (_c *OpenShortChecker_SetMTP_Call) Return(_a0 error) *OpenShortChecker_SetMTP_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *OpenShortChecker_SetMTP_Call) RunAndReturn(run func(types.Context, *perpetualtypes.MTP) error) *OpenShortChecker_SetMTP_Call {
_c.Call.Return(run)
return _c
}
// SetPool provides a mock function with given fields: ctx, pool
func (_m *OpenShortChecker) SetPool(ctx types.Context, pool perpetualtypes.Pool) {
_m.Called(ctx, pool)
}
// OpenShortChecker_SetPool_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetPool'
type OpenShortChecker_SetPool_Call struct {
*mock.Call
}
// SetPool is a helper method to define mock.On call
// - ctx types.Context
// - pool perpetualtypes.Pool
func (_e *OpenShortChecker_Expecter) SetPool(ctx interface{}, pool interface{}) *OpenShortChecker_SetPool_Call {
return &OpenShortChecker_SetPool_Call{Call: _e.mock.On("SetPool", ctx, pool)}
}
func (_c *OpenShortChecker_SetPool_Call) Run(run func(ctx types.Context, pool perpetualtypes.Pool)) *OpenShortChecker_SetPool_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(types.Context), args[1].(perpetualtypes.Pool))
})
return _c
}
func (_c *OpenShortChecker_SetPool_Call) Return() *OpenShortChecker_SetPool_Call {
_c.Call.Return()
return _c
}
func (_c *OpenShortChecker_SetPool_Call) RunAndReturn(run func(types.Context, perpetualtypes.Pool)) *OpenShortChecker_SetPool_Call {
_c.Call.Return(run)
return _c
}
// TakeInCustody provides a mock function with given fields: ctx, mtp, pool
func (_m *OpenShortChecker) TakeInCustody(ctx types.Context, mtp perpetualtypes.MTP, pool *perpetualtypes.Pool) error {
ret := _m.Called(ctx, mtp, pool)
var r0 error
if rf, ok := ret.Get(0).(func(types.Context, perpetualtypes.MTP, *perpetualtypes.Pool) error); ok {
r0 = rf(ctx, mtp, pool)
} else {
r0 = ret.Error(0)
}
return r0
}
// OpenShortChecker_TakeInCustody_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TakeInCustody'
type OpenShortChecker_TakeInCustody_Call struct {
*mock.Call
}
// TakeInCustody is a helper method to define mock.On call
// - ctx types.Context
// - mtp perpetualtypes.MTP
// - pool *perpetualtypes.Pool
func (_e *OpenShortChecker_Expecter) TakeInCustody(ctx interface{}, mtp interface{}, pool interface{}) *OpenShortChecker_TakeInCustody_Call {
return &OpenShortChecker_TakeInCustody_Call{Call: _e.mock.On("TakeInCustody", ctx, mtp, pool)}
}
func (_c *OpenShortChecker_TakeInCustody_Call) Run(run func(ctx types.Context, mtp perpetualtypes.MTP, pool *perpetualtypes.Pool)) *OpenShortChecker_TakeInCustody_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(types.Context), args[1].(perpetualtypes.MTP), args[2].(*perpetualtypes.Pool))
})
return _c
}
func (_c *OpenShortChecker_TakeInCustody_Call) Return(_a0 error) *OpenShortChecker_TakeInCustody_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *OpenShortChecker_TakeInCustody_Call) RunAndReturn(run func(types.Context, perpetualtypes.MTP, *perpetualtypes.Pool) error) *OpenShortChecker_TakeInCustody_Call {
_c.Call.Return(run)
return _c
}
// UpdateMTPHealth provides a mock function with given fields: ctx, mtp, ammPool, baseCurrency
func (_m *OpenShortChecker) UpdateMTPHealth(ctx types.Context, mtp perpetualtypes.MTP, ammPool ammtypes.Pool, baseCurrency string) (math.LegacyDec, error) {
ret := _m.Called(ctx, mtp, ammPool, baseCurrency)
var r0 math.LegacyDec
var r1 error
if rf, ok := ret.Get(0).(func(types.Context, perpetualtypes.MTP, ammtypes.Pool, string) (math.LegacyDec, error)); ok {
return rf(ctx, mtp, ammPool, baseCurrency)
}
if rf, ok := ret.Get(0).(func(types.Context, perpetualtypes.MTP, ammtypes.Pool, string) math.LegacyDec); ok {
r0 = rf(ctx, mtp, ammPool, baseCurrency)
} else {
r0 = ret.Get(0).(math.LegacyDec)
}
if rf, ok := ret.Get(1).(func(types.Context, perpetualtypes.MTP, ammtypes.Pool, string) error); ok {
r1 = rf(ctx, mtp, ammPool, baseCurrency)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// OpenShortChecker_UpdateMTPHealth_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateMTPHealth'
type OpenShortChecker_UpdateMTPHealth_Call struct {
*mock.Call
}
// UpdateMTPHealth is a helper method to define mock.On call
// - ctx types.Context
// - mtp perpetualtypes.MTP
// - ammPool ammtypes.Pool
// - baseCurrency string
func (_e *OpenShortChecker_Expecter) UpdateMTPHealth(ctx interface{}, mtp interface{}, ammPool interface{}, baseCurrency interface{}) *OpenShortChecker_UpdateMTPHealth_Call {
return &OpenShortChecker_UpdateMTPHealth_Call{Call: _e.mock.On("UpdateMTPHealth", ctx, mtp, ammPool, baseCurrency)}
}
func (_c *OpenShortChecker_UpdateMTPHealth_Call) Run(run func(ctx types.Context, mtp perpetualtypes.MTP, ammPool ammtypes.Pool, baseCurrency string)) *OpenShortChecker_UpdateMTPHealth_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(types.Context), args[1].(perpetualtypes.MTP), args[2].(ammtypes.Pool), args[3].(string))
})
return _c
}
func (_c *OpenShortChecker_UpdateMTPHealth_Call) Return(_a0 math.LegacyDec, _a1 error) *OpenShortChecker_UpdateMTPHealth_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *OpenShortChecker_UpdateMTPHealth_Call) RunAndReturn(run func(types.Context, perpetualtypes.MTP, ammtypes.Pool, string) (math.LegacyDec, error)) *OpenShortChecker_UpdateMTPHealth_Call {
_c.Call.Return(run)
return _c
}
// UpdatePoolHealth provides a mock function with given fields: ctx, pool
func (_m *OpenShortChecker) UpdatePoolHealth(ctx types.Context, pool *perpetualtypes.Pool) error {
ret := _m.Called(ctx, pool)
var r0 error
if rf, ok := ret.Get(0).(func(types.Context, *perpetualtypes.Pool) error); ok {
r0 = rf(ctx, pool)
} else {
r0 = ret.Error(0)
}
return r0
}
// OpenShortChecker_UpdatePoolHealth_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdatePoolHealth'
type OpenShortChecker_UpdatePoolHealth_Call struct {
*mock.Call
}
// UpdatePoolHealth is a helper method to define mock.On call
// - ctx types.Context
// - pool *perpetualtypes.Pool
func (_e *OpenShortChecker_Expecter) UpdatePoolHealth(ctx interface{}, pool interface{}) *OpenShortChecker_UpdatePoolHealth_Call {
return &OpenShortChecker_UpdatePoolHealth_Call{Call: _e.mock.On("UpdatePoolHealth", ctx, pool)}
}
func (_c *OpenShortChecker_UpdatePoolHealth_Call) Run(run func(ctx types.Context, pool *perpetualtypes.Pool)) *OpenShortChecker_UpdatePoolHealth_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(types.Context), args[1].(*perpetualtypes.Pool))
})
return _c
}
func (_c *OpenShortChecker_UpdatePoolHealth_Call) Return(_a0 error) *OpenShortChecker_UpdatePoolHealth_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *OpenShortChecker_UpdatePoolHealth_Call) RunAndReturn(run func(types.Context, *perpetualtypes.Pool) error) *OpenShortChecker_UpdatePoolHealth_Call {
_c.Call.Return(run)
return _c
}
// NewOpenShortChecker creates a new instance of OpenShortChecker. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewOpenShortChecker(t interface {
mock.TestingT
Cleanup(func())
}) *OpenShortChecker {
mock := &OpenShortChecker{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}