/
pool_checker.go
219 lines (177 loc) · 6.56 KB
/
pool_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
// Code generated by mockery v2.32.4. DO NOT EDIT.
package mocks
import (
math "cosmossdk.io/math"
perpetualtypes "github.com/elys-network/elys/x/perpetual/types"
mock "github.com/stretchr/testify/mock"
types "github.com/cosmos/cosmos-sdk/types"
)
// PoolChecker is an autogenerated mock type for the PoolChecker type
type PoolChecker struct {
mock.Mock
}
type PoolChecker_Expecter struct {
mock *mock.Mock
}
func (_m *PoolChecker) EXPECT() *PoolChecker_Expecter {
return &PoolChecker_Expecter{mock: &_m.Mock}
}
// GetPool provides a mock function with given fields: ctx, poolId
func (_m *PoolChecker) 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
}
// PoolChecker_GetPool_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPool'
type PoolChecker_GetPool_Call struct {
*mock.Call
}
// GetPool is a helper method to define mock.On call
// - ctx types.Context
// - poolId uint64
func (_e *PoolChecker_Expecter) GetPool(ctx interface{}, poolId interface{}) *PoolChecker_GetPool_Call {
return &PoolChecker_GetPool_Call{Call: _e.mock.On("GetPool", ctx, poolId)}
}
func (_c *PoolChecker_GetPool_Call) Run(run func(ctx types.Context, poolId uint64)) *PoolChecker_GetPool_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(types.Context), args[1].(uint64))
})
return _c
}
func (_c *PoolChecker_GetPool_Call) Return(_a0 perpetualtypes.Pool, _a1 bool) *PoolChecker_GetPool_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *PoolChecker_GetPool_Call) RunAndReturn(run func(types.Context, uint64) (perpetualtypes.Pool, bool)) *PoolChecker_GetPool_Call {
_c.Call.Return(run)
return _c
}
// GetPoolOpenThreshold provides a mock function with given fields: ctx
func (_m *PoolChecker) GetPoolOpenThreshold(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
}
// PoolChecker_GetPoolOpenThreshold_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPoolOpenThreshold'
type PoolChecker_GetPoolOpenThreshold_Call struct {
*mock.Call
}
// GetPoolOpenThreshold is a helper method to define mock.On call
// - ctx types.Context
func (_e *PoolChecker_Expecter) GetPoolOpenThreshold(ctx interface{}) *PoolChecker_GetPoolOpenThreshold_Call {
return &PoolChecker_GetPoolOpenThreshold_Call{Call: _e.mock.On("GetPoolOpenThreshold", ctx)}
}
func (_c *PoolChecker_GetPoolOpenThreshold_Call) Run(run func(ctx types.Context)) *PoolChecker_GetPoolOpenThreshold_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(types.Context))
})
return _c
}
func (_c *PoolChecker_GetPoolOpenThreshold_Call) Return(_a0 math.LegacyDec) *PoolChecker_GetPoolOpenThreshold_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *PoolChecker_GetPoolOpenThreshold_Call) RunAndReturn(run func(types.Context) math.LegacyDec) *PoolChecker_GetPoolOpenThreshold_Call {
_c.Call.Return(run)
return _c
}
// IsPoolClosed provides a mock function with given fields: ctx, poolId
func (_m *PoolChecker) IsPoolClosed(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
}
// PoolChecker_IsPoolClosed_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsPoolClosed'
type PoolChecker_IsPoolClosed_Call struct {
*mock.Call
}
// IsPoolClosed is a helper method to define mock.On call
// - ctx types.Context
// - poolId uint64
func (_e *PoolChecker_Expecter) IsPoolClosed(ctx interface{}, poolId interface{}) *PoolChecker_IsPoolClosed_Call {
return &PoolChecker_IsPoolClosed_Call{Call: _e.mock.On("IsPoolClosed", ctx, poolId)}
}
func (_c *PoolChecker_IsPoolClosed_Call) Run(run func(ctx types.Context, poolId uint64)) *PoolChecker_IsPoolClosed_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(types.Context), args[1].(uint64))
})
return _c
}
func (_c *PoolChecker_IsPoolClosed_Call) Return(_a0 bool) *PoolChecker_IsPoolClosed_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *PoolChecker_IsPoolClosed_Call) RunAndReturn(run func(types.Context, uint64) bool) *PoolChecker_IsPoolClosed_Call {
_c.Call.Return(run)
return _c
}
// IsPoolEnabled provides a mock function with given fields: ctx, poolId
func (_m *PoolChecker) 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
}
// PoolChecker_IsPoolEnabled_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsPoolEnabled'
type PoolChecker_IsPoolEnabled_Call struct {
*mock.Call
}
// IsPoolEnabled is a helper method to define mock.On call
// - ctx types.Context
// - poolId uint64
func (_e *PoolChecker_Expecter) IsPoolEnabled(ctx interface{}, poolId interface{}) *PoolChecker_IsPoolEnabled_Call {
return &PoolChecker_IsPoolEnabled_Call{Call: _e.mock.On("IsPoolEnabled", ctx, poolId)}
}
func (_c *PoolChecker_IsPoolEnabled_Call) Run(run func(ctx types.Context, poolId uint64)) *PoolChecker_IsPoolEnabled_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(types.Context), args[1].(uint64))
})
return _c
}
func (_c *PoolChecker_IsPoolEnabled_Call) Return(_a0 bool) *PoolChecker_IsPoolEnabled_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *PoolChecker_IsPoolEnabled_Call) RunAndReturn(run func(types.Context, uint64) bool) *PoolChecker_IsPoolEnabled_Call {
_c.Call.Return(run)
return _c
}
// NewPoolChecker creates a new instance of PoolChecker. 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 NewPoolChecker(t interface {
mock.TestingT
Cleanup(func())
}) *PoolChecker {
mock := &PoolChecker{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}