-
Notifications
You must be signed in to change notification settings - Fork 119
/
bank_keeper.go
346 lines (282 loc) · 12.2 KB
/
bank_keeper.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
// Code generated by mockery v2.32.4. DO NOT EDIT.
package mocks
import (
types "github.com/cosmos/cosmos-sdk/types"
mock "github.com/stretchr/testify/mock"
)
// BankKeeper is an autogenerated mock type for the BankKeeper type
type BankKeeper struct {
mock.Mock
}
type BankKeeper_Expecter struct {
mock *mock.Mock
}
func (_m *BankKeeper) EXPECT() *BankKeeper_Expecter {
return &BankKeeper_Expecter{mock: &_m.Mock}
}
// BurnCoins provides a mock function with given fields: ctx, name, amt
func (_m *BankKeeper) BurnCoins(ctx types.Context, name string, amt types.Coins) error {
ret := _m.Called(ctx, name, amt)
var r0 error
if rf, ok := ret.Get(0).(func(types.Context, string, types.Coins) error); ok {
r0 = rf(ctx, name, amt)
} else {
r0 = ret.Error(0)
}
return r0
}
// BankKeeper_BurnCoins_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BurnCoins'
type BankKeeper_BurnCoins_Call struct {
*mock.Call
}
// BurnCoins is a helper method to define mock.On call
// - ctx types.Context
// - name string
// - amt types.Coins
func (_e *BankKeeper_Expecter) BurnCoins(ctx interface{}, name interface{}, amt interface{}) *BankKeeper_BurnCoins_Call {
return &BankKeeper_BurnCoins_Call{Call: _e.mock.On("BurnCoins", ctx, name, amt)}
}
func (_c *BankKeeper_BurnCoins_Call) Run(run func(ctx types.Context, name string, amt types.Coins)) *BankKeeper_BurnCoins_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(types.Context), args[1].(string), args[2].(types.Coins))
})
return _c
}
func (_c *BankKeeper_BurnCoins_Call) Return(_a0 error) *BankKeeper_BurnCoins_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *BankKeeper_BurnCoins_Call) RunAndReturn(run func(types.Context, string, types.Coins) error) *BankKeeper_BurnCoins_Call {
_c.Call.Return(run)
return _c
}
// GetBalance provides a mock function with given fields: ctx, addr, denom
func (_m *BankKeeper) GetBalance(ctx types.Context, addr types.AccAddress, denom string) types.Coin {
ret := _m.Called(ctx, addr, denom)
var r0 types.Coin
if rf, ok := ret.Get(0).(func(types.Context, types.AccAddress, string) types.Coin); ok {
r0 = rf(ctx, addr, denom)
} else {
r0 = ret.Get(0).(types.Coin)
}
return r0
}
// BankKeeper_GetBalance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBalance'
type BankKeeper_GetBalance_Call struct {
*mock.Call
}
// GetBalance is a helper method to define mock.On call
// - ctx types.Context
// - addr types.AccAddress
// - denom string
func (_e *BankKeeper_Expecter) GetBalance(ctx interface{}, addr interface{}, denom interface{}) *BankKeeper_GetBalance_Call {
return &BankKeeper_GetBalance_Call{Call: _e.mock.On("GetBalance", ctx, addr, denom)}
}
func (_c *BankKeeper_GetBalance_Call) Run(run func(ctx types.Context, addr types.AccAddress, denom string)) *BankKeeper_GetBalance_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(types.Context), args[1].(types.AccAddress), args[2].(string))
})
return _c
}
func (_c *BankKeeper_GetBalance_Call) Return(_a0 types.Coin) *BankKeeper_GetBalance_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *BankKeeper_GetBalance_Call) RunAndReturn(run func(types.Context, types.AccAddress, string) types.Coin) *BankKeeper_GetBalance_Call {
_c.Call.Return(run)
return _c
}
// HasBalance provides a mock function with given fields: ctx, addr, amt
func (_m *BankKeeper) HasBalance(ctx types.Context, addr types.AccAddress, amt types.Coin) bool {
ret := _m.Called(ctx, addr, amt)
var r0 bool
if rf, ok := ret.Get(0).(func(types.Context, types.AccAddress, types.Coin) bool); ok {
r0 = rf(ctx, addr, amt)
} else {
r0 = ret.Get(0).(bool)
}
return r0
}
// BankKeeper_HasBalance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HasBalance'
type BankKeeper_HasBalance_Call struct {
*mock.Call
}
// HasBalance is a helper method to define mock.On call
// - ctx types.Context
// - addr types.AccAddress
// - amt types.Coin
func (_e *BankKeeper_Expecter) HasBalance(ctx interface{}, addr interface{}, amt interface{}) *BankKeeper_HasBalance_Call {
return &BankKeeper_HasBalance_Call{Call: _e.mock.On("HasBalance", ctx, addr, amt)}
}
func (_c *BankKeeper_HasBalance_Call) Run(run func(ctx types.Context, addr types.AccAddress, amt types.Coin)) *BankKeeper_HasBalance_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(types.Context), args[1].(types.AccAddress), args[2].(types.Coin))
})
return _c
}
func (_c *BankKeeper_HasBalance_Call) Return(_a0 bool) *BankKeeper_HasBalance_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *BankKeeper_HasBalance_Call) RunAndReturn(run func(types.Context, types.AccAddress, types.Coin) bool) *BankKeeper_HasBalance_Call {
_c.Call.Return(run)
return _c
}
// MintCoins provides a mock function with given fields: ctx, name, amt
func (_m *BankKeeper) MintCoins(ctx types.Context, name string, amt types.Coins) error {
ret := _m.Called(ctx, name, amt)
var r0 error
if rf, ok := ret.Get(0).(func(types.Context, string, types.Coins) error); ok {
r0 = rf(ctx, name, amt)
} else {
r0 = ret.Error(0)
}
return r0
}
// BankKeeper_MintCoins_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MintCoins'
type BankKeeper_MintCoins_Call struct {
*mock.Call
}
// MintCoins is a helper method to define mock.On call
// - ctx types.Context
// - name string
// - amt types.Coins
func (_e *BankKeeper_Expecter) MintCoins(ctx interface{}, name interface{}, amt interface{}) *BankKeeper_MintCoins_Call {
return &BankKeeper_MintCoins_Call{Call: _e.mock.On("MintCoins", ctx, name, amt)}
}
func (_c *BankKeeper_MintCoins_Call) Run(run func(ctx types.Context, name string, amt types.Coins)) *BankKeeper_MintCoins_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(types.Context), args[1].(string), args[2].(types.Coins))
})
return _c
}
func (_c *BankKeeper_MintCoins_Call) Return(_a0 error) *BankKeeper_MintCoins_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *BankKeeper_MintCoins_Call) RunAndReturn(run func(types.Context, string, types.Coins) error) *BankKeeper_MintCoins_Call {
_c.Call.Return(run)
return _c
}
// SendCoins provides a mock function with given fields: ctx, fromAddr, toAddr, amt
func (_m *BankKeeper) SendCoins(ctx types.Context, fromAddr types.AccAddress, toAddr types.AccAddress, amt types.Coins) error {
ret := _m.Called(ctx, fromAddr, toAddr, amt)
var r0 error
if rf, ok := ret.Get(0).(func(types.Context, types.AccAddress, types.AccAddress, types.Coins) error); ok {
r0 = rf(ctx, fromAddr, toAddr, amt)
} else {
r0 = ret.Error(0)
}
return r0
}
// BankKeeper_SendCoins_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendCoins'
type BankKeeper_SendCoins_Call struct {
*mock.Call
}
// SendCoins is a helper method to define mock.On call
// - ctx types.Context
// - fromAddr types.AccAddress
// - toAddr types.AccAddress
// - amt types.Coins
func (_e *BankKeeper_Expecter) SendCoins(ctx interface{}, fromAddr interface{}, toAddr interface{}, amt interface{}) *BankKeeper_SendCoins_Call {
return &BankKeeper_SendCoins_Call{Call: _e.mock.On("SendCoins", ctx, fromAddr, toAddr, amt)}
}
func (_c *BankKeeper_SendCoins_Call) Run(run func(ctx types.Context, fromAddr types.AccAddress, toAddr types.AccAddress, amt types.Coins)) *BankKeeper_SendCoins_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(types.Context), args[1].(types.AccAddress), args[2].(types.AccAddress), args[3].(types.Coins))
})
return _c
}
func (_c *BankKeeper_SendCoins_Call) Return(_a0 error) *BankKeeper_SendCoins_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *BankKeeper_SendCoins_Call) RunAndReturn(run func(types.Context, types.AccAddress, types.AccAddress, types.Coins) error) *BankKeeper_SendCoins_Call {
_c.Call.Return(run)
return _c
}
// SendCoinsFromAccountToModule provides a mock function with given fields: ctx, senderAddr, recipientModule, amt
func (_m *BankKeeper) SendCoinsFromAccountToModule(ctx types.Context, senderAddr types.AccAddress, recipientModule string, amt types.Coins) error {
ret := _m.Called(ctx, senderAddr, recipientModule, amt)
var r0 error
if rf, ok := ret.Get(0).(func(types.Context, types.AccAddress, string, types.Coins) error); ok {
r0 = rf(ctx, senderAddr, recipientModule, amt)
} else {
r0 = ret.Error(0)
}
return r0
}
// BankKeeper_SendCoinsFromAccountToModule_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendCoinsFromAccountToModule'
type BankKeeper_SendCoinsFromAccountToModule_Call struct {
*mock.Call
}
// SendCoinsFromAccountToModule is a helper method to define mock.On call
// - ctx types.Context
// - senderAddr types.AccAddress
// - recipientModule string
// - amt types.Coins
func (_e *BankKeeper_Expecter) SendCoinsFromAccountToModule(ctx interface{}, senderAddr interface{}, recipientModule interface{}, amt interface{}) *BankKeeper_SendCoinsFromAccountToModule_Call {
return &BankKeeper_SendCoinsFromAccountToModule_Call{Call: _e.mock.On("SendCoinsFromAccountToModule", ctx, senderAddr, recipientModule, amt)}
}
func (_c *BankKeeper_SendCoinsFromAccountToModule_Call) Run(run func(ctx types.Context, senderAddr types.AccAddress, recipientModule string, amt types.Coins)) *BankKeeper_SendCoinsFromAccountToModule_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(types.Context), args[1].(types.AccAddress), args[2].(string), args[3].(types.Coins))
})
return _c
}
func (_c *BankKeeper_SendCoinsFromAccountToModule_Call) Return(_a0 error) *BankKeeper_SendCoinsFromAccountToModule_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *BankKeeper_SendCoinsFromAccountToModule_Call) RunAndReturn(run func(types.Context, types.AccAddress, string, types.Coins) error) *BankKeeper_SendCoinsFromAccountToModule_Call {
_c.Call.Return(run)
return _c
}
// SendCoinsFromModuleToAccount provides a mock function with given fields: ctx, senderModule, recipientAddr, amt
func (_m *BankKeeper) SendCoinsFromModuleToAccount(ctx types.Context, senderModule string, recipientAddr types.AccAddress, amt types.Coins) error {
ret := _m.Called(ctx, senderModule, recipientAddr, amt)
var r0 error
if rf, ok := ret.Get(0).(func(types.Context, string, types.AccAddress, types.Coins) error); ok {
r0 = rf(ctx, senderModule, recipientAddr, amt)
} else {
r0 = ret.Error(0)
}
return r0
}
// BankKeeper_SendCoinsFromModuleToAccount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendCoinsFromModuleToAccount'
type BankKeeper_SendCoinsFromModuleToAccount_Call struct {
*mock.Call
}
// SendCoinsFromModuleToAccount is a helper method to define mock.On call
// - ctx types.Context
// - senderModule string
// - recipientAddr types.AccAddress
// - amt types.Coins
func (_e *BankKeeper_Expecter) SendCoinsFromModuleToAccount(ctx interface{}, senderModule interface{}, recipientAddr interface{}, amt interface{}) *BankKeeper_SendCoinsFromModuleToAccount_Call {
return &BankKeeper_SendCoinsFromModuleToAccount_Call{Call: _e.mock.On("SendCoinsFromModuleToAccount", ctx, senderModule, recipientAddr, amt)}
}
func (_c *BankKeeper_SendCoinsFromModuleToAccount_Call) Run(run func(ctx types.Context, senderModule string, recipientAddr types.AccAddress, amt types.Coins)) *BankKeeper_SendCoinsFromModuleToAccount_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(types.Context), args[1].(string), args[2].(types.AccAddress), args[3].(types.Coins))
})
return _c
}
func (_c *BankKeeper_SendCoinsFromModuleToAccount_Call) Return(_a0 error) *BankKeeper_SendCoinsFromModuleToAccount_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *BankKeeper_SendCoinsFromModuleToAccount_Call) RunAndReturn(run func(types.Context, string, types.AccAddress, types.Coins) error) *BankKeeper_SendCoinsFromModuleToAccount_Call {
_c.Call.Return(run)
return _c
}
// NewBankKeeper creates a new instance of BankKeeper. 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 NewBankKeeper(t interface {
mock.TestingT
Cleanup(func())
}) *BankKeeper {
mock := &BankKeeper{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}