-
Notifications
You must be signed in to change notification settings - Fork 114
/
expected_keepers.go
345 lines (320 loc) · 11.9 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
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
// Code generated by moq; DO NOT EDIT.
// github.com/matryer/moq
package mock
import (
multisig "github.com/axelarnetwork/axelar-core/x/multisig/exported"
github_com_axelarnetwork_axelar_core_x_nexus_exported "github.com/axelarnetwork/axelar-core/x/nexus/exported"
"github.com/axelarnetwork/axelar-core/x/tss/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 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{
// 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 {
// 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 {
// 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
}
}
lockValidator sync.RWMutex
}
// 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 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{
// GetOperatorFunc: func(ctx github_com_cosmos_cosmos_sdk_types.Context, proxy github_com_cosmos_cosmos_sdk_types.AccAddress) github_com_cosmos_cosmos_sdk_types.ValAddress {
// panic("mock out the GetOperator method")
// },
// }
//
// // use mockedSnapshotter in code that requires types.Snapshotter
// // and then make assertions.
//
// }
type SnapshotterMock struct {
// GetOperatorFunc mocks the GetOperator method.
GetOperatorFunc func(ctx github_com_cosmos_cosmos_sdk_types.Context, proxy github_com_cosmos_cosmos_sdk_types.AccAddress) github_com_cosmos_cosmos_sdk_types.ValAddress
// calls tracks calls to the methods.
calls struct {
// GetOperator holds details about calls to the GetOperator method.
GetOperator []struct {
// Ctx is the ctx argument value.
Ctx github_com_cosmos_cosmos_sdk_types.Context
// Proxy is the proxy argument value.
Proxy github_com_cosmos_cosmos_sdk_types.AccAddress
}
}
lockGetOperator sync.RWMutex
}
// GetOperator calls GetOperatorFunc.
func (mock *SnapshotterMock) GetOperator(ctx github_com_cosmos_cosmos_sdk_types.Context, proxy github_com_cosmos_cosmos_sdk_types.AccAddress) github_com_cosmos_cosmos_sdk_types.ValAddress {
if mock.GetOperatorFunc == nil {
panic("SnapshotterMock.GetOperatorFunc: method is nil but Snapshotter.GetOperator was just called")
}
callInfo := struct {
Ctx github_com_cosmos_cosmos_sdk_types.Context
Proxy github_com_cosmos_cosmos_sdk_types.AccAddress
}{
Ctx: ctx,
Proxy: proxy,
}
mock.lockGetOperator.Lock()
mock.calls.GetOperator = append(mock.calls.GetOperator, callInfo)
mock.lockGetOperator.Unlock()
return mock.GetOperatorFunc(ctx, proxy)
}
// GetOperatorCalls gets all the calls that were made to GetOperator.
// Check the length with:
//
// len(mockedSnapshotter.GetOperatorCalls())
func (mock *SnapshotterMock) GetOperatorCalls() []struct {
Ctx github_com_cosmos_cosmos_sdk_types.Context
Proxy github_com_cosmos_cosmos_sdk_types.AccAddress
} {
var calls []struct {
Ctx github_com_cosmos_cosmos_sdk_types.Context
Proxy github_com_cosmos_cosmos_sdk_types.AccAddress
}
mock.lockGetOperator.RLock()
calls = mock.calls.GetOperator
mock.lockGetOperator.RUnlock()
return calls
}
// Ensure, that NexusMock does implement types.Nexus.
// If this is not the case, regenerate this file with moq.
var _ types.Nexus = &NexusMock{}
// NexusMock is a mock implementation of types.Nexus.
//
// func TestSomethingThatUsesNexus(t *testing.T) {
//
// // make and configure a mocked types.Nexus
// mockedNexus := &NexusMock{
// GetChainsFunc: func(ctx github_com_cosmos_cosmos_sdk_types.Context) []github_com_axelarnetwork_axelar_core_x_nexus_exported.Chain {
// panic("mock out the GetChains method")
// },
// }
//
// // use mockedNexus in code that requires types.Nexus
// // and then make assertions.
//
// }
type NexusMock struct {
// GetChainsFunc mocks the GetChains method.
GetChainsFunc func(ctx github_com_cosmos_cosmos_sdk_types.Context) []github_com_axelarnetwork_axelar_core_x_nexus_exported.Chain
// calls tracks calls to the methods.
calls struct {
// GetChains holds details about calls to the GetChains method.
GetChains []struct {
// Ctx is the ctx argument value.
Ctx github_com_cosmos_cosmos_sdk_types.Context
}
}
lockGetChains sync.RWMutex
}
// GetChains calls GetChainsFunc.
func (mock *NexusMock) GetChains(ctx github_com_cosmos_cosmos_sdk_types.Context) []github_com_axelarnetwork_axelar_core_x_nexus_exported.Chain {
if mock.GetChainsFunc == nil {
panic("NexusMock.GetChainsFunc: method is nil but Nexus.GetChains was just called")
}
callInfo := struct {
Ctx github_com_cosmos_cosmos_sdk_types.Context
}{
Ctx: ctx,
}
mock.lockGetChains.Lock()
mock.calls.GetChains = append(mock.calls.GetChains, callInfo)
mock.lockGetChains.Unlock()
return mock.GetChainsFunc(ctx)
}
// GetChainsCalls gets all the calls that were made to GetChains.
// Check the length with:
//
// len(mockedNexus.GetChainsCalls())
func (mock *NexusMock) GetChainsCalls() []struct {
Ctx github_com_cosmos_cosmos_sdk_types.Context
} {
var calls []struct {
Ctx github_com_cosmos_cosmos_sdk_types.Context
}
mock.lockGetChains.RLock()
calls = mock.calls.GetChains
mock.lockGetChains.RUnlock()
return calls
}
// Ensure, that MultiSigKeeperMock does implement types.MultiSigKeeper.
// If this is not the case, regenerate this file with moq.
var _ types.MultiSigKeeper = &MultiSigKeeperMock{}
// MultiSigKeeperMock is a mock implementation of types.MultiSigKeeper.
//
// func TestSomethingThatUsesMultiSigKeeper(t *testing.T) {
//
// // make and configure a mocked types.MultiSigKeeper
// mockedMultiSigKeeper := &MultiSigKeeperMock{
// GetActiveKeyIDsFunc: func(ctx github_com_cosmos_cosmos_sdk_types.Context, chainName github_com_axelarnetwork_axelar_core_x_nexus_exported.ChainName) []multisig.KeyID {
// panic("mock out the GetActiveKeyIDs method")
// },
// GetKeyFunc: func(ctx github_com_cosmos_cosmos_sdk_types.Context, keyID multisig.KeyID) (multisig.Key, bool) {
// panic("mock out the GetKey method")
// },
// }
//
// // use mockedMultiSigKeeper in code that requires types.MultiSigKeeper
// // and then make assertions.
//
// }
type MultiSigKeeperMock struct {
// GetActiveKeyIDsFunc mocks the GetActiveKeyIDs method.
GetActiveKeyIDsFunc func(ctx github_com_cosmos_cosmos_sdk_types.Context, chainName github_com_axelarnetwork_axelar_core_x_nexus_exported.ChainName) []multisig.KeyID
// GetKeyFunc mocks the GetKey method.
GetKeyFunc func(ctx github_com_cosmos_cosmos_sdk_types.Context, keyID multisig.KeyID) (multisig.Key, bool)
// calls tracks calls to the methods.
calls struct {
// GetActiveKeyIDs holds details about calls to the GetActiveKeyIDs method.
GetActiveKeyIDs []struct {
// Ctx is the ctx argument value.
Ctx github_com_cosmos_cosmos_sdk_types.Context
// ChainName is the chainName argument value.
ChainName github_com_axelarnetwork_axelar_core_x_nexus_exported.ChainName
}
// GetKey holds details about calls to the GetKey method.
GetKey []struct {
// Ctx is the ctx argument value.
Ctx github_com_cosmos_cosmos_sdk_types.Context
// KeyID is the keyID argument value.
KeyID multisig.KeyID
}
}
lockGetActiveKeyIDs sync.RWMutex
lockGetKey sync.RWMutex
}
// GetActiveKeyIDs calls GetActiveKeyIDsFunc.
func (mock *MultiSigKeeperMock) GetActiveKeyIDs(ctx github_com_cosmos_cosmos_sdk_types.Context, chainName github_com_axelarnetwork_axelar_core_x_nexus_exported.ChainName) []multisig.KeyID {
if mock.GetActiveKeyIDsFunc == nil {
panic("MultiSigKeeperMock.GetActiveKeyIDsFunc: method is nil but MultiSigKeeper.GetActiveKeyIDs was just called")
}
callInfo := struct {
Ctx github_com_cosmos_cosmos_sdk_types.Context
ChainName github_com_axelarnetwork_axelar_core_x_nexus_exported.ChainName
}{
Ctx: ctx,
ChainName: chainName,
}
mock.lockGetActiveKeyIDs.Lock()
mock.calls.GetActiveKeyIDs = append(mock.calls.GetActiveKeyIDs, callInfo)
mock.lockGetActiveKeyIDs.Unlock()
return mock.GetActiveKeyIDsFunc(ctx, chainName)
}
// GetActiveKeyIDsCalls gets all the calls that were made to GetActiveKeyIDs.
// Check the length with:
//
// len(mockedMultiSigKeeper.GetActiveKeyIDsCalls())
func (mock *MultiSigKeeperMock) GetActiveKeyIDsCalls() []struct {
Ctx github_com_cosmos_cosmos_sdk_types.Context
ChainName github_com_axelarnetwork_axelar_core_x_nexus_exported.ChainName
} {
var calls []struct {
Ctx github_com_cosmos_cosmos_sdk_types.Context
ChainName github_com_axelarnetwork_axelar_core_x_nexus_exported.ChainName
}
mock.lockGetActiveKeyIDs.RLock()
calls = mock.calls.GetActiveKeyIDs
mock.lockGetActiveKeyIDs.RUnlock()
return calls
}
// GetKey calls GetKeyFunc.
func (mock *MultiSigKeeperMock) GetKey(ctx github_com_cosmos_cosmos_sdk_types.Context, keyID multisig.KeyID) (multisig.Key, bool) {
if mock.GetKeyFunc == nil {
panic("MultiSigKeeperMock.GetKeyFunc: method is nil but MultiSigKeeper.GetKey was just called")
}
callInfo := struct {
Ctx github_com_cosmos_cosmos_sdk_types.Context
KeyID multisig.KeyID
}{
Ctx: ctx,
KeyID: keyID,
}
mock.lockGetKey.Lock()
mock.calls.GetKey = append(mock.calls.GetKey, callInfo)
mock.lockGetKey.Unlock()
return mock.GetKeyFunc(ctx, keyID)
}
// GetKeyCalls gets all the calls that were made to GetKey.
// Check the length with:
//
// len(mockedMultiSigKeeper.GetKeyCalls())
func (mock *MultiSigKeeperMock) GetKeyCalls() []struct {
Ctx github_com_cosmos_cosmos_sdk_types.Context
KeyID multisig.KeyID
} {
var calls []struct {
Ctx github_com_cosmos_cosmos_sdk_types.Context
KeyID multisig.KeyID
}
mock.lockGetKey.RLock()
calls = mock.calls.GetKey
mock.lockGetKey.RUnlock()
return calls
}