This repository has been archived by the owner on Jun 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
/
ValidatorKeeper.go
312 lines (250 loc) · 8.5 KB
/
ValidatorKeeper.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 mockery v1.0.0. DO NOT EDIT.
package mocks
import (
amino "github.com/tendermint/go-amino"
abcitypes "github.com/tendermint/tendermint/abci/types"
crypto "github.com/tendermint/tendermint/crypto"
linotypes "github.com/lino-network/lino/types"
manager "github.com/lino-network/lino/x/validator/manager"
mock "github.com/stretchr/testify/mock"
model "github.com/lino-network/lino/x/validator/model"
types "github.com/cosmos/cosmos-sdk/types"
)
// ValidatorKeeper is an autogenerated mock type for the ValidatorKeeper type
type ValidatorKeeper struct {
mock.Mock
}
// DistributeInflationToValidator provides a mock function with given fields: ctx
func (_m *ValidatorKeeper) DistributeInflationToValidator(ctx types.Context) types.Error {
ret := _m.Called(ctx)
var r0 types.Error
if rf, ok := ret.Get(0).(func(types.Context) types.Error); ok {
r0 = rf(ctx)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(types.Error)
}
}
return r0
}
// ExportToFile provides a mock function with given fields: ctx, cdc, filepath
func (_m *ValidatorKeeper) ExportToFile(ctx types.Context, cdc *amino.Codec, filepath string) error {
ret := _m.Called(ctx, cdc, filepath)
var r0 error
if rf, ok := ret.Get(0).(func(types.Context, *amino.Codec, string) error); ok {
r0 = rf(ctx, cdc, filepath)
} else {
r0 = ret.Error(0)
}
return r0
}
// GetCommittingValidatorVoteStatus provides a mock function with given fields: ctx
func (_m *ValidatorKeeper) GetCommittingValidatorVoteStatus(ctx types.Context) []model.ReceivedVotesStatus {
ret := _m.Called(ctx)
var r0 []model.ReceivedVotesStatus
if rf, ok := ret.Get(0).(func(types.Context) []model.ReceivedVotesStatus); ok {
r0 = rf(ctx)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]model.ReceivedVotesStatus)
}
}
return r0
}
// GetCommittingValidators provides a mock function with given fields: ctx
func (_m *ValidatorKeeper) GetCommittingValidators(ctx types.Context) []linotypes.AccountKey {
ret := _m.Called(ctx)
var r0 []linotypes.AccountKey
if rf, ok := ret.Get(0).(func(types.Context) []linotypes.AccountKey); ok {
r0 = rf(ctx)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]linotypes.AccountKey)
}
}
return r0
}
// GetElectionVoteList provides a mock function with given fields: ctx, accKey
func (_m *ValidatorKeeper) GetElectionVoteList(ctx types.Context, accKey linotypes.AccountKey) *model.ElectionVoteList {
ret := _m.Called(ctx, accKey)
var r0 *model.ElectionVoteList
if rf, ok := ret.Get(0).(func(types.Context, linotypes.AccountKey) *model.ElectionVoteList); ok {
r0 = rf(ctx, accKey)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*model.ElectionVoteList)
}
}
return r0
}
// GetInitValidators provides a mock function with given fields: ctx
func (_m *ValidatorKeeper) GetInitValidators(ctx types.Context) ([]abcitypes.ValidatorUpdate, types.Error) {
ret := _m.Called(ctx)
var r0 []abcitypes.ValidatorUpdate
if rf, ok := ret.Get(0).(func(types.Context) []abcitypes.ValidatorUpdate); ok {
r0 = rf(ctx)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]abcitypes.ValidatorUpdate)
}
}
var r1 types.Error
if rf, ok := ret.Get(1).(func(types.Context) types.Error); ok {
r1 = rf(ctx)
} else {
if ret.Get(1) != nil {
r1 = ret.Get(1).(types.Error)
}
}
return r0, r1
}
// GetValidator provides a mock function with given fields: ctx, username
func (_m *ValidatorKeeper) GetValidator(ctx types.Context, username linotypes.AccountKey) (*model.Validator, types.Error) {
ret := _m.Called(ctx, username)
var r0 *model.Validator
if rf, ok := ret.Get(0).(func(types.Context, linotypes.AccountKey) *model.Validator); ok {
r0 = rf(ctx, username)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*model.Validator)
}
}
var r1 types.Error
if rf, ok := ret.Get(1).(func(types.Context, linotypes.AccountKey) types.Error); ok {
r1 = rf(ctx, username)
} else {
if ret.Get(1) != nil {
r1 = ret.Get(1).(types.Error)
}
}
return r0, r1
}
// GetValidatorList provides a mock function with given fields: ctx
func (_m *ValidatorKeeper) GetValidatorList(ctx types.Context) *model.ValidatorList {
ret := _m.Called(ctx)
var r0 *model.ValidatorList
if rf, ok := ret.Get(0).(func(types.Context) *model.ValidatorList); ok {
r0 = rf(ctx)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*model.ValidatorList)
}
}
return r0
}
// GetValidatorUpdates provides a mock function with given fields: ctx
func (_m *ValidatorKeeper) GetValidatorUpdates(ctx types.Context) ([]abcitypes.ValidatorUpdate, types.Error) {
ret := _m.Called(ctx)
var r0 []abcitypes.ValidatorUpdate
if rf, ok := ret.Get(0).(func(types.Context) []abcitypes.ValidatorUpdate); ok {
r0 = rf(ctx)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]abcitypes.ValidatorUpdate)
}
}
var r1 types.Error
if rf, ok := ret.Get(1).(func(types.Context) types.Error); ok {
r1 = rf(ctx)
} else {
if ret.Get(1) != nil {
r1 = ret.Get(1).(types.Error)
}
}
return r0, r1
}
// Hooks provides a mock function with given fields:
func (_m *ValidatorKeeper) Hooks() manager.Hooks {
ret := _m.Called()
var r0 manager.Hooks
if rf, ok := ret.Get(0).(func() manager.Hooks); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(manager.Hooks)
}
return r0
}
// ImportFromFile provides a mock function with given fields: ctx, cdc, filepath
func (_m *ValidatorKeeper) ImportFromFile(ctx types.Context, cdc *amino.Codec, filepath string) error {
ret := _m.Called(ctx, cdc, filepath)
var r0 error
if rf, ok := ret.Get(0).(func(types.Context, *amino.Codec, string) error); ok {
r0 = rf(ctx, cdc, filepath)
} else {
r0 = ret.Error(0)
}
return r0
}
// InitGenesis provides a mock function with given fields: ctx
func (_m *ValidatorKeeper) InitGenesis(ctx types.Context) {
_m.Called(ctx)
}
// OnBeginBlock provides a mock function with given fields: ctx, req
func (_m *ValidatorKeeper) OnBeginBlock(ctx types.Context, req abcitypes.RequestBeginBlock) {
_m.Called(ctx, req)
}
// PunishCommittingValidator provides a mock function with given fields: ctx, username, penalty, punishType
func (_m *ValidatorKeeper) PunishCommittingValidator(ctx types.Context, username linotypes.AccountKey, penalty linotypes.Coin, punishType linotypes.PunishType) types.Error {
ret := _m.Called(ctx, username, penalty, punishType)
var r0 types.Error
if rf, ok := ret.Get(0).(func(types.Context, linotypes.AccountKey, linotypes.Coin, linotypes.PunishType) types.Error); ok {
r0 = rf(ctx, username, penalty, punishType)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(types.Error)
}
}
return r0
}
// RegisterValidator provides a mock function with given fields: ctx, username, valPubKey, link
func (_m *ValidatorKeeper) RegisterValidator(ctx types.Context, username linotypes.AccountKey, valPubKey crypto.PubKey, link string) types.Error {
ret := _m.Called(ctx, username, valPubKey, link)
var r0 types.Error
if rf, ok := ret.Get(0).(func(types.Context, linotypes.AccountKey, crypto.PubKey, string) types.Error); ok {
r0 = rf(ctx, username, valPubKey, link)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(types.Error)
}
}
return r0
}
// RevokeValidator provides a mock function with given fields: ctx, username
func (_m *ValidatorKeeper) RevokeValidator(ctx types.Context, username linotypes.AccountKey) types.Error {
ret := _m.Called(ctx, username)
var r0 types.Error
if rf, ok := ret.Get(0).(func(types.Context, linotypes.AccountKey) types.Error); ok {
r0 = rf(ctx, username)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(types.Error)
}
}
return r0
}
// UpdateValidator provides a mock function with given fields: ctx, username, link
func (_m *ValidatorKeeper) UpdateValidator(ctx types.Context, username linotypes.AccountKey, link string) types.Error {
ret := _m.Called(ctx, username, link)
var r0 types.Error
if rf, ok := ret.Get(0).(func(types.Context, linotypes.AccountKey, string) types.Error); ok {
r0 = rf(ctx, username, link)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(types.Error)
}
}
return r0
}
// VoteValidator provides a mock function with given fields: ctx, username, votedValidators
func (_m *ValidatorKeeper) VoteValidator(ctx types.Context, username linotypes.AccountKey, votedValidators []linotypes.AccountKey) types.Error {
ret := _m.Called(ctx, username, votedValidators)
var r0 types.Error
if rf, ok := ret.Get(0).(func(types.Context, linotypes.AccountKey, []linotypes.AccountKey) types.Error); ok {
r0 = rf(ctx, username, votedValidators)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(types.Error)
}
}
return r0
}