-
Notifications
You must be signed in to change notification settings - Fork 114
/
expected_keepers.go
312 lines (289 loc) · 10.6 KB
/
expected_keepers.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
// Code generated by moq; DO NOT EDIT.
// github.com/matryer/moq
package mock
import (
reward "github.com/axelarnetwork/axelar-core/x/reward/exported"
snapshot "github.com/axelarnetwork/axelar-core/x/snapshot/exported"
"github.com/axelarnetwork/axelar-core/x/vote/types"
github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
"sync"
)
// Ensure, that SnapshotterMock does implement types.Snapshotter.
// If this is not the case, regenerate this file with moq.
var _ types.Snapshotter = &SnapshotterMock{}
// SnapshotterMock is a mock implementation of types.Snapshotter.
//
// func TestSomethingThatUsesSnapshotter(t *testing.T) {
//
// // make and configure a mocked types.Snapshotter
// mockedSnapshotter := &SnapshotterMock{
// GetSnapshotFunc: func(context github_com_cosmos_cosmos_sdk_types.Context, n int64) (snapshot.Snapshot, bool) {
// panic("mock out the GetSnapshot method")
// },
// }
//
// // use mockedSnapshotter in code that requires types.Snapshotter
// // and then make assertions.
//
// }
type SnapshotterMock struct {
// GetSnapshotFunc mocks the GetSnapshot method.
GetSnapshotFunc func(context github_com_cosmos_cosmos_sdk_types.Context, n int64) (snapshot.Snapshot, bool)
// calls tracks calls to the methods.
calls struct {
// GetSnapshot holds details about calls to the GetSnapshot method.
GetSnapshot []struct {
// Context is the context argument value.
Context github_com_cosmos_cosmos_sdk_types.Context
// N is the n argument value.
N int64
}
}
lockGetSnapshot sync.RWMutex
}
// GetSnapshot calls GetSnapshotFunc.
func (mock *SnapshotterMock) GetSnapshot(context github_com_cosmos_cosmos_sdk_types.Context, n int64) (snapshot.Snapshot, bool) {
if mock.GetSnapshotFunc == nil {
panic("SnapshotterMock.GetSnapshotFunc: method is nil but Snapshotter.GetSnapshot was just called")
}
callInfo := struct {
Context github_com_cosmos_cosmos_sdk_types.Context
N int64
}{
Context: context,
N: n,
}
mock.lockGetSnapshot.Lock()
mock.calls.GetSnapshot = append(mock.calls.GetSnapshot, callInfo)
mock.lockGetSnapshot.Unlock()
return mock.GetSnapshotFunc(context, n)
}
// GetSnapshotCalls gets all the calls that were made to GetSnapshot.
// Check the length with:
// len(mockedSnapshotter.GetSnapshotCalls())
func (mock *SnapshotterMock) GetSnapshotCalls() []struct {
Context github_com_cosmos_cosmos_sdk_types.Context
N int64
} {
var calls []struct {
Context github_com_cosmos_cosmos_sdk_types.Context
N int64
}
mock.lockGetSnapshot.RLock()
calls = mock.calls.GetSnapshot
mock.lockGetSnapshot.RUnlock()
return calls
}
// Ensure, that StakingKeeperMock does implement types.StakingKeeper.
// If this is not the case, regenerate this file with moq.
var _ types.StakingKeeper = &StakingKeeperMock{}
// StakingKeeperMock is a mock implementation of types.StakingKeeper.
//
// func TestSomethingThatUsesStakingKeeper(t *testing.T) {
//
// // make and configure a mocked types.StakingKeeper
// mockedStakingKeeper := &StakingKeeperMock{
// GetLastTotalPowerFunc: func(context github_com_cosmos_cosmos_sdk_types.Context) github_com_cosmos_cosmos_sdk_types.Int {
// panic("mock out the GetLastTotalPower method")
// },
// PowerReductionFunc: func(context github_com_cosmos_cosmos_sdk_types.Context) github_com_cosmos_cosmos_sdk_types.Int {
// panic("mock out the PowerReduction method")
// },
// ValidatorFunc: func(ctx github_com_cosmos_cosmos_sdk_types.Context, addr github_com_cosmos_cosmos_sdk_types.ValAddress) stakingtypes.ValidatorI {
// panic("mock out the Validator method")
// },
// }
//
// // use mockedStakingKeeper in code that requires types.StakingKeeper
// // and then make assertions.
//
// }
type StakingKeeperMock struct {
// GetLastTotalPowerFunc mocks the GetLastTotalPower method.
GetLastTotalPowerFunc func(context github_com_cosmos_cosmos_sdk_types.Context) github_com_cosmos_cosmos_sdk_types.Int
// PowerReductionFunc mocks the PowerReduction method.
PowerReductionFunc func(context github_com_cosmos_cosmos_sdk_types.Context) github_com_cosmos_cosmos_sdk_types.Int
// ValidatorFunc mocks the Validator method.
ValidatorFunc func(ctx github_com_cosmos_cosmos_sdk_types.Context, addr github_com_cosmos_cosmos_sdk_types.ValAddress) stakingtypes.ValidatorI
// calls tracks calls to the methods.
calls struct {
// GetLastTotalPower holds details about calls to the GetLastTotalPower method.
GetLastTotalPower []struct {
// Context is the context argument value.
Context github_com_cosmos_cosmos_sdk_types.Context
}
// PowerReduction holds details about calls to the PowerReduction method.
PowerReduction []struct {
// Context is the context argument value.
Context github_com_cosmos_cosmos_sdk_types.Context
}
// Validator holds details about calls to the Validator method.
Validator []struct {
// Ctx is the ctx argument value.
Ctx github_com_cosmos_cosmos_sdk_types.Context
// Addr is the addr argument value.
Addr github_com_cosmos_cosmos_sdk_types.ValAddress
}
}
lockGetLastTotalPower sync.RWMutex
lockPowerReduction sync.RWMutex
lockValidator sync.RWMutex
}
// GetLastTotalPower calls GetLastTotalPowerFunc.
func (mock *StakingKeeperMock) GetLastTotalPower(context github_com_cosmos_cosmos_sdk_types.Context) github_com_cosmos_cosmos_sdk_types.Int {
if mock.GetLastTotalPowerFunc == nil {
panic("StakingKeeperMock.GetLastTotalPowerFunc: method is nil but StakingKeeper.GetLastTotalPower was just called")
}
callInfo := struct {
Context github_com_cosmos_cosmos_sdk_types.Context
}{
Context: context,
}
mock.lockGetLastTotalPower.Lock()
mock.calls.GetLastTotalPower = append(mock.calls.GetLastTotalPower, callInfo)
mock.lockGetLastTotalPower.Unlock()
return mock.GetLastTotalPowerFunc(context)
}
// GetLastTotalPowerCalls gets all the calls that were made to GetLastTotalPower.
// Check the length with:
// len(mockedStakingKeeper.GetLastTotalPowerCalls())
func (mock *StakingKeeperMock) GetLastTotalPowerCalls() []struct {
Context github_com_cosmos_cosmos_sdk_types.Context
} {
var calls []struct {
Context github_com_cosmos_cosmos_sdk_types.Context
}
mock.lockGetLastTotalPower.RLock()
calls = mock.calls.GetLastTotalPower
mock.lockGetLastTotalPower.RUnlock()
return calls
}
// PowerReduction calls PowerReductionFunc.
func (mock *StakingKeeperMock) PowerReduction(context github_com_cosmos_cosmos_sdk_types.Context) github_com_cosmos_cosmos_sdk_types.Int {
if mock.PowerReductionFunc == nil {
panic("StakingKeeperMock.PowerReductionFunc: method is nil but StakingKeeper.PowerReduction was just called")
}
callInfo := struct {
Context github_com_cosmos_cosmos_sdk_types.Context
}{
Context: context,
}
mock.lockPowerReduction.Lock()
mock.calls.PowerReduction = append(mock.calls.PowerReduction, callInfo)
mock.lockPowerReduction.Unlock()
return mock.PowerReductionFunc(context)
}
// PowerReductionCalls gets all the calls that were made to PowerReduction.
// Check the length with:
// len(mockedStakingKeeper.PowerReductionCalls())
func (mock *StakingKeeperMock) PowerReductionCalls() []struct {
Context github_com_cosmos_cosmos_sdk_types.Context
} {
var calls []struct {
Context github_com_cosmos_cosmos_sdk_types.Context
}
mock.lockPowerReduction.RLock()
calls = mock.calls.PowerReduction
mock.lockPowerReduction.RUnlock()
return calls
}
// Validator calls ValidatorFunc.
func (mock *StakingKeeperMock) Validator(ctx github_com_cosmos_cosmos_sdk_types.Context, addr github_com_cosmos_cosmos_sdk_types.ValAddress) stakingtypes.ValidatorI {
if mock.ValidatorFunc == nil {
panic("StakingKeeperMock.ValidatorFunc: method is nil but StakingKeeper.Validator was just called")
}
callInfo := struct {
Ctx github_com_cosmos_cosmos_sdk_types.Context
Addr github_com_cosmos_cosmos_sdk_types.ValAddress
}{
Ctx: ctx,
Addr: addr,
}
mock.lockValidator.Lock()
mock.calls.Validator = append(mock.calls.Validator, callInfo)
mock.lockValidator.Unlock()
return mock.ValidatorFunc(ctx, addr)
}
// ValidatorCalls gets all the calls that were made to Validator.
// Check the length with:
// len(mockedStakingKeeper.ValidatorCalls())
func (mock *StakingKeeperMock) ValidatorCalls() []struct {
Ctx github_com_cosmos_cosmos_sdk_types.Context
Addr github_com_cosmos_cosmos_sdk_types.ValAddress
} {
var calls []struct {
Ctx github_com_cosmos_cosmos_sdk_types.Context
Addr github_com_cosmos_cosmos_sdk_types.ValAddress
}
mock.lockValidator.RLock()
calls = mock.calls.Validator
mock.lockValidator.RUnlock()
return calls
}
// Ensure, that RewarderMock does implement types.Rewarder.
// If this is not the case, regenerate this file with moq.
var _ types.Rewarder = &RewarderMock{}
// RewarderMock is a mock implementation of types.Rewarder.
//
// func TestSomethingThatUsesRewarder(t *testing.T) {
//
// // make and configure a mocked types.Rewarder
// mockedRewarder := &RewarderMock{
// GetPoolFunc: func(ctx github_com_cosmos_cosmos_sdk_types.Context, name string) reward.RewardPool {
// panic("mock out the GetPool method")
// },
// }
//
// // use mockedRewarder in code that requires types.Rewarder
// // and then make assertions.
//
// }
type RewarderMock struct {
// GetPoolFunc mocks the GetPool method.
GetPoolFunc func(ctx github_com_cosmos_cosmos_sdk_types.Context, name string) reward.RewardPool
// calls tracks calls to the methods.
calls struct {
// GetPool holds details about calls to the GetPool method.
GetPool []struct {
// Ctx is the ctx argument value.
Ctx github_com_cosmos_cosmos_sdk_types.Context
// Name is the name argument value.
Name string
}
}
lockGetPool sync.RWMutex
}
// GetPool calls GetPoolFunc.
func (mock *RewarderMock) GetPool(ctx github_com_cosmos_cosmos_sdk_types.Context, name string) reward.RewardPool {
if mock.GetPoolFunc == nil {
panic("RewarderMock.GetPoolFunc: method is nil but Rewarder.GetPool was just called")
}
callInfo := struct {
Ctx github_com_cosmos_cosmos_sdk_types.Context
Name string
}{
Ctx: ctx,
Name: name,
}
mock.lockGetPool.Lock()
mock.calls.GetPool = append(mock.calls.GetPool, callInfo)
mock.lockGetPool.Unlock()
return mock.GetPoolFunc(ctx, name)
}
// GetPoolCalls gets all the calls that were made to GetPool.
// Check the length with:
// len(mockedRewarder.GetPoolCalls())
func (mock *RewarderMock) GetPoolCalls() []struct {
Ctx github_com_cosmos_cosmos_sdk_types.Context
Name string
} {
var calls []struct {
Ctx github_com_cosmos_cosmos_sdk_types.Context
Name string
}
mock.lockGetPool.RLock()
calls = mock.calls.GetPool
mock.lockGetPool.RUnlock()
return calls
}