-
Notifications
You must be signed in to change notification settings - Fork 44
/
close_long_checker.go
349 lines (286 loc) · 12.9 KB
/
close_long_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
// 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"
)
// CloseLongChecker is an autogenerated mock type for the CloseLongChecker type
type CloseLongChecker struct {
mock.Mock
}
type CloseLongChecker_Expecter struct {
mock *mock.Mock
}
func (_m *CloseLongChecker) EXPECT() *CloseLongChecker_Expecter {
return &CloseLongChecker_Expecter{mock: &_m.Mock}
}
// EstimateAndRepay provides a mock function with given fields: ctx, mtp, pool, ammPool, amount, baseCurrency
func (_m *CloseLongChecker) EstimateAndRepay(ctx types.Context, mtp perpetualtypes.MTP, pool perpetualtypes.Pool, ammPool ammtypes.Pool, amount math.Int, baseCurrency string) (math.Int, error) {
ret := _m.Called(ctx, mtp, pool, ammPool, amount, baseCurrency)
var r0 math.Int
var r1 error
if rf, ok := ret.Get(0).(func(types.Context, perpetualtypes.MTP, perpetualtypes.Pool, ammtypes.Pool, math.Int, string) (math.Int, error)); ok {
return rf(ctx, mtp, pool, ammPool, amount, baseCurrency)
}
if rf, ok := ret.Get(0).(func(types.Context, perpetualtypes.MTP, perpetualtypes.Pool, ammtypes.Pool, math.Int, string) math.Int); ok {
r0 = rf(ctx, mtp, pool, ammPool, amount, baseCurrency)
} else {
r0 = ret.Get(0).(math.Int)
}
if rf, ok := ret.Get(1).(func(types.Context, perpetualtypes.MTP, perpetualtypes.Pool, ammtypes.Pool, math.Int, string) error); ok {
r1 = rf(ctx, mtp, pool, ammPool, amount, baseCurrency)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// CloseLongChecker_EstimateAndRepay_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EstimateAndRepay'
type CloseLongChecker_EstimateAndRepay_Call struct {
*mock.Call
}
// EstimateAndRepay is a helper method to define mock.On call
// - ctx types.Context
// - mtp perpetualtypes.MTP
// - pool perpetualtypes.Pool
// - ammPool ammtypes.Pool
// - amount math.Int
// - baseCurrency string
func (_e *CloseLongChecker_Expecter) EstimateAndRepay(ctx interface{}, mtp interface{}, pool interface{}, ammPool interface{}, amount interface{}, baseCurrency interface{}) *CloseLongChecker_EstimateAndRepay_Call {
return &CloseLongChecker_EstimateAndRepay_Call{Call: _e.mock.On("EstimateAndRepay", ctx, mtp, pool, ammPool, amount, baseCurrency)}
}
func (_c *CloseLongChecker_EstimateAndRepay_Call) Run(run func(ctx types.Context, mtp perpetualtypes.MTP, pool perpetualtypes.Pool, ammPool ammtypes.Pool, amount math.Int, baseCurrency string)) *CloseLongChecker_EstimateAndRepay_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(types.Context), args[1].(perpetualtypes.MTP), args[2].(perpetualtypes.Pool), args[3].(ammtypes.Pool), args[4].(math.Int), args[5].(string))
})
return _c
}
func (_c *CloseLongChecker_EstimateAndRepay_Call) Return(_a0 math.Int, _a1 error) *CloseLongChecker_EstimateAndRepay_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *CloseLongChecker_EstimateAndRepay_Call) RunAndReturn(run func(types.Context, perpetualtypes.MTP, perpetualtypes.Pool, ammtypes.Pool, math.Int, string) (math.Int, error)) *CloseLongChecker_EstimateAndRepay_Call {
_c.Call.Return(run)
return _c
}
// GetAmmPool provides a mock function with given fields: ctx, poolId, tradingAsset
func (_m *CloseLongChecker) 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
}
// CloseLongChecker_GetAmmPool_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAmmPool'
type CloseLongChecker_GetAmmPool_Call struct {
*mock.Call
}
// GetAmmPool is a helper method to define mock.On call
// - ctx types.Context
// - poolId uint64
// - tradingAsset string
func (_e *CloseLongChecker_Expecter) GetAmmPool(ctx interface{}, poolId interface{}, tradingAsset interface{}) *CloseLongChecker_GetAmmPool_Call {
return &CloseLongChecker_GetAmmPool_Call{Call: _e.mock.On("GetAmmPool", ctx, poolId, tradingAsset)}
}
func (_c *CloseLongChecker_GetAmmPool_Call) Run(run func(ctx types.Context, poolId uint64, tradingAsset string)) *CloseLongChecker_GetAmmPool_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(types.Context), args[1].(uint64), args[2].(string))
})
return _c
}
func (_c *CloseLongChecker_GetAmmPool_Call) Return(_a0 ammtypes.Pool, _a1 error) *CloseLongChecker_GetAmmPool_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *CloseLongChecker_GetAmmPool_Call) RunAndReturn(run func(types.Context, uint64, string) (ammtypes.Pool, error)) *CloseLongChecker_GetAmmPool_Call {
_c.Call.Return(run)
return _c
}
// GetMTP provides a mock function with given fields: ctx, mtpAddress, id
func (_m *CloseLongChecker) GetMTP(ctx types.Context, mtpAddress string, id uint64) (perpetualtypes.MTP, error) {
ret := _m.Called(ctx, mtpAddress, id)
var r0 perpetualtypes.MTP
var r1 error
if rf, ok := ret.Get(0).(func(types.Context, string, uint64) (perpetualtypes.MTP, error)); ok {
return rf(ctx, mtpAddress, id)
}
if rf, ok := ret.Get(0).(func(types.Context, string, uint64) perpetualtypes.MTP); ok {
r0 = rf(ctx, mtpAddress, id)
} else {
r0 = ret.Get(0).(perpetualtypes.MTP)
}
if rf, ok := ret.Get(1).(func(types.Context, string, uint64) error); ok {
r1 = rf(ctx, mtpAddress, id)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// CloseLongChecker_GetMTP_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetMTP'
type CloseLongChecker_GetMTP_Call struct {
*mock.Call
}
// GetMTP is a helper method to define mock.On call
// - ctx types.Context
// - mtpAddress string
// - id uint64
func (_e *CloseLongChecker_Expecter) GetMTP(ctx interface{}, mtpAddress interface{}, id interface{}) *CloseLongChecker_GetMTP_Call {
return &CloseLongChecker_GetMTP_Call{Call: _e.mock.On("GetMTP", ctx, mtpAddress, id)}
}
func (_c *CloseLongChecker_GetMTP_Call) Run(run func(ctx types.Context, mtpAddress string, id uint64)) *CloseLongChecker_GetMTP_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(types.Context), args[1].(string), args[2].(uint64))
})
return _c
}
func (_c *CloseLongChecker_GetMTP_Call) Return(_a0 perpetualtypes.MTP, _a1 error) *CloseLongChecker_GetMTP_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *CloseLongChecker_GetMTP_Call) RunAndReturn(run func(types.Context, string, uint64) (perpetualtypes.MTP, error)) *CloseLongChecker_GetMTP_Call {
_c.Call.Return(run)
return _c
}
// GetPool provides a mock function with given fields: ctx, poolId
func (_m *CloseLongChecker) 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
}
// CloseLongChecker_GetPool_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPool'
type CloseLongChecker_GetPool_Call struct {
*mock.Call
}
// GetPool is a helper method to define mock.On call
// - ctx types.Context
// - poolId uint64
func (_e *CloseLongChecker_Expecter) GetPool(ctx interface{}, poolId interface{}) *CloseLongChecker_GetPool_Call {
return &CloseLongChecker_GetPool_Call{Call: _e.mock.On("GetPool", ctx, poolId)}
}
func (_c *CloseLongChecker_GetPool_Call) Run(run func(ctx types.Context, poolId uint64)) *CloseLongChecker_GetPool_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(types.Context), args[1].(uint64))
})
return _c
}
func (_c *CloseLongChecker_GetPool_Call) Return(val perpetualtypes.Pool, found bool) *CloseLongChecker_GetPool_Call {
_c.Call.Return(val, found)
return _c
}
func (_c *CloseLongChecker_GetPool_Call) RunAndReturn(run func(types.Context, uint64) (perpetualtypes.Pool, bool)) *CloseLongChecker_GetPool_Call {
_c.Call.Return(run)
return _c
}
// HandleBorrowInterest provides a mock function with given fields: ctx, mtp, pool, ammPool
func (_m *CloseLongChecker) HandleBorrowInterest(ctx types.Context, mtp *perpetualtypes.MTP, pool *perpetualtypes.Pool, ammPool ammtypes.Pool) error {
ret := _m.Called(ctx, mtp, pool, ammPool)
var r0 error
if rf, ok := ret.Get(0).(func(types.Context, *perpetualtypes.MTP, *perpetualtypes.Pool, ammtypes.Pool) error); ok {
r0 = rf(ctx, mtp, pool, ammPool)
} else {
r0 = ret.Error(0)
}
return r0
}
// CloseLongChecker_HandleBorrowInterest_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HandleBorrowInterest'
type CloseLongChecker_HandleBorrowInterest_Call struct {
*mock.Call
}
// HandleBorrowInterest is a helper method to define mock.On call
// - ctx types.Context
// - mtp *perpetualtypes.MTP
// - pool *perpetualtypes.Pool
// - ammPool ammtypes.Pool
func (_e *CloseLongChecker_Expecter) HandleBorrowInterest(ctx interface{}, mtp interface{}, pool interface{}, ammPool interface{}) *CloseLongChecker_HandleBorrowInterest_Call {
return &CloseLongChecker_HandleBorrowInterest_Call{Call: _e.mock.On("HandleBorrowInterest", ctx, mtp, pool, ammPool)}
}
func (_c *CloseLongChecker_HandleBorrowInterest_Call) Run(run func(ctx types.Context, mtp *perpetualtypes.MTP, pool *perpetualtypes.Pool, ammPool ammtypes.Pool)) *CloseLongChecker_HandleBorrowInterest_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(types.Context), args[1].(*perpetualtypes.MTP), args[2].(*perpetualtypes.Pool), args[3].(ammtypes.Pool))
})
return _c
}
func (_c *CloseLongChecker_HandleBorrowInterest_Call) Return(_a0 error) *CloseLongChecker_HandleBorrowInterest_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *CloseLongChecker_HandleBorrowInterest_Call) RunAndReturn(run func(types.Context, *perpetualtypes.MTP, *perpetualtypes.Pool, ammtypes.Pool) error) *CloseLongChecker_HandleBorrowInterest_Call {
_c.Call.Return(run)
return _c
}
// TakeOutCustody provides a mock function with given fields: ctx, mtp, pool, amount
func (_m *CloseLongChecker) TakeOutCustody(ctx types.Context, mtp perpetualtypes.MTP, pool *perpetualtypes.Pool, amount math.Int) error {
ret := _m.Called(ctx, mtp, pool, amount)
var r0 error
if rf, ok := ret.Get(0).(func(types.Context, perpetualtypes.MTP, *perpetualtypes.Pool, math.Int) error); ok {
r0 = rf(ctx, mtp, pool, amount)
} else {
r0 = ret.Error(0)
}
return r0
}
// CloseLongChecker_TakeOutCustody_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TakeOutCustody'
type CloseLongChecker_TakeOutCustody_Call struct {
*mock.Call
}
// TakeOutCustody is a helper method to define mock.On call
// - ctx types.Context
// - mtp perpetualtypes.MTP
// - pool *perpetualtypes.Pool
// - amount math.Int
func (_e *CloseLongChecker_Expecter) TakeOutCustody(ctx interface{}, mtp interface{}, pool interface{}, amount interface{}) *CloseLongChecker_TakeOutCustody_Call {
return &CloseLongChecker_TakeOutCustody_Call{Call: _e.mock.On("TakeOutCustody", ctx, mtp, pool, amount)}
}
func (_c *CloseLongChecker_TakeOutCustody_Call) Run(run func(ctx types.Context, mtp perpetualtypes.MTP, pool *perpetualtypes.Pool, amount math.Int)) *CloseLongChecker_TakeOutCustody_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(types.Context), args[1].(perpetualtypes.MTP), args[2].(*perpetualtypes.Pool), args[3].(math.Int))
})
return _c
}
func (_c *CloseLongChecker_TakeOutCustody_Call) Return(_a0 error) *CloseLongChecker_TakeOutCustody_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *CloseLongChecker_TakeOutCustody_Call) RunAndReturn(run func(types.Context, perpetualtypes.MTP, *perpetualtypes.Pool, math.Int) error) *CloseLongChecker_TakeOutCustody_Call {
_c.Call.Return(run)
return _c
}
// NewCloseLongChecker creates a new instance of CloseLongChecker. 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 NewCloseLongChecker(t interface {
mock.TestingT
Cleanup(func())
}) *CloseLongChecker {
mock := &CloseLongChecker{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}