-
Notifications
You must be signed in to change notification settings - Fork 51
/
bank_keeper.go
436 lines (355 loc) · 15.4 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
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
// Code generated by mockery v2.32.4. DO NOT EDIT.
package mocks
import (
mock "github.com/stretchr/testify/mock"
types "github.com/cosmos/cosmos-sdk/types"
)
// 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}
}
// BlockedAddr provides a mock function with given fields: addr
func (_m *BankKeeper) BlockedAddr(addr types.AccAddress) bool {
ret := _m.Called(addr)
var r0 bool
if rf, ok := ret.Get(0).(func(types.AccAddress) bool); ok {
r0 = rf(addr)
} else {
r0 = ret.Get(0).(bool)
}
return r0
}
// BankKeeper_BlockedAddr_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BlockedAddr'
type BankKeeper_BlockedAddr_Call struct {
*mock.Call
}
// BlockedAddr is a helper method to define mock.On call
// - addr types.AccAddress
func (_e *BankKeeper_Expecter) BlockedAddr(addr interface{}) *BankKeeper_BlockedAddr_Call {
return &BankKeeper_BlockedAddr_Call{Call: _e.mock.On("BlockedAddr", addr)}
}
func (_c *BankKeeper_BlockedAddr_Call) Run(run func(addr types.AccAddress)) *BankKeeper_BlockedAddr_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(types.AccAddress))
})
return _c
}
func (_c *BankKeeper_BlockedAddr_Call) Return(_a0 bool) *BankKeeper_BlockedAddr_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *BankKeeper_BlockedAddr_Call) RunAndReturn(run func(types.AccAddress) bool) *BankKeeper_BlockedAddr_Call {
_c.Call.Return(run)
return _c
}
// GetAllBalances provides a mock function with given fields: ctx, addr
func (_m *BankKeeper) GetAllBalances(ctx types.Context, addr types.AccAddress) types.Coins {
ret := _m.Called(ctx, addr)
var r0 types.Coins
if rf, ok := ret.Get(0).(func(types.Context, types.AccAddress) types.Coins); ok {
r0 = rf(ctx, addr)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(types.Coins)
}
}
return r0
}
// BankKeeper_GetAllBalances_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllBalances'
type BankKeeper_GetAllBalances_Call struct {
*mock.Call
}
// GetAllBalances is a helper method to define mock.On call
// - ctx types.Context
// - addr types.AccAddress
func (_e *BankKeeper_Expecter) GetAllBalances(ctx interface{}, addr interface{}) *BankKeeper_GetAllBalances_Call {
return &BankKeeper_GetAllBalances_Call{Call: _e.mock.On("GetAllBalances", ctx, addr)}
}
func (_c *BankKeeper_GetAllBalances_Call) Run(run func(ctx types.Context, addr types.AccAddress)) *BankKeeper_GetAllBalances_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(types.Context), args[1].(types.AccAddress))
})
return _c
}
func (_c *BankKeeper_GetAllBalances_Call) Return(_a0 types.Coins) *BankKeeper_GetAllBalances_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *BankKeeper_GetAllBalances_Call) RunAndReturn(run func(types.Context, types.AccAddress) types.Coins) *BankKeeper_GetAllBalances_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
}
// 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
}
// SendCoinsFromModuleToModule provides a mock function with given fields: ctx, senderModule, recipientModule, amt
func (_m *BankKeeper) SendCoinsFromModuleToModule(ctx types.Context, senderModule string, recipientModule string, amt types.Coins) error {
ret := _m.Called(ctx, senderModule, recipientModule, amt)
var r0 error
if rf, ok := ret.Get(0).(func(types.Context, string, string, types.Coins) error); ok {
r0 = rf(ctx, senderModule, recipientModule, amt)
} else {
r0 = ret.Error(0)
}
return r0
}
// BankKeeper_SendCoinsFromModuleToModule_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendCoinsFromModuleToModule'
type BankKeeper_SendCoinsFromModuleToModule_Call struct {
*mock.Call
}
// SendCoinsFromModuleToModule is a helper method to define mock.On call
// - ctx types.Context
// - senderModule string
// - recipientModule string
// - amt types.Coins
func (_e *BankKeeper_Expecter) SendCoinsFromModuleToModule(ctx interface{}, senderModule interface{}, recipientModule interface{}, amt interface{}) *BankKeeper_SendCoinsFromModuleToModule_Call {
return &BankKeeper_SendCoinsFromModuleToModule_Call{Call: _e.mock.On("SendCoinsFromModuleToModule", ctx, senderModule, recipientModule, amt)}
}
func (_c *BankKeeper_SendCoinsFromModuleToModule_Call) Run(run func(ctx types.Context, senderModule string, recipientModule string, amt types.Coins)) *BankKeeper_SendCoinsFromModuleToModule_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(types.Context), args[1].(string), args[2].(string), args[3].(types.Coins))
})
return _c
}
func (_c *BankKeeper_SendCoinsFromModuleToModule_Call) Return(_a0 error) *BankKeeper_SendCoinsFromModuleToModule_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *BankKeeper_SendCoinsFromModuleToModule_Call) RunAndReturn(run func(types.Context, string, string, types.Coins) error) *BankKeeper_SendCoinsFromModuleToModule_Call {
_c.Call.Return(run)
return _c
}
// SpendableCoins provides a mock function with given fields: ctx, addr
func (_m *BankKeeper) SpendableCoins(ctx types.Context, addr types.AccAddress) types.Coins {
ret := _m.Called(ctx, addr)
var r0 types.Coins
if rf, ok := ret.Get(0).(func(types.Context, types.AccAddress) types.Coins); ok {
r0 = rf(ctx, addr)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(types.Coins)
}
}
return r0
}
// BankKeeper_SpendableCoins_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SpendableCoins'
type BankKeeper_SpendableCoins_Call struct {
*mock.Call
}
// SpendableCoins is a helper method to define mock.On call
// - ctx types.Context
// - addr types.AccAddress
func (_e *BankKeeper_Expecter) SpendableCoins(ctx interface{}, addr interface{}) *BankKeeper_SpendableCoins_Call {
return &BankKeeper_SpendableCoins_Call{Call: _e.mock.On("SpendableCoins", ctx, addr)}
}
func (_c *BankKeeper_SpendableCoins_Call) Run(run func(ctx types.Context, addr types.AccAddress)) *BankKeeper_SpendableCoins_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(types.Context), args[1].(types.AccAddress))
})
return _c
}
func (_c *BankKeeper_SpendableCoins_Call) Return(_a0 types.Coins) *BankKeeper_SpendableCoins_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *BankKeeper_SpendableCoins_Call) RunAndReturn(run func(types.Context, types.AccAddress) types.Coins) *BankKeeper_SpendableCoins_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
}