-
Notifications
You must be signed in to change notification settings - Fork 210
/
mocks.go
320 lines (269 loc) · 10.6 KB
/
mocks.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
// Code generated by MockGen. DO NOT EDIT.
// Source: ./interface.go
//
// Generated by this command:
//
// mockgen -typed -package=eligibility -destination=./mocks.go -source=./interface.go
//
// Package eligibility is a generated GoMock package.
package eligibility
import (
context "context"
reflect "reflect"
types "github.com/spacemeshos/go-spacemesh/common/types"
signing "github.com/spacemeshos/go-spacemesh/signing"
gomock "go.uber.org/mock/gomock"
)
// MockactiveSetCache is a mock of activeSetCache interface.
type MockactiveSetCache struct {
ctrl *gomock.Controller
recorder *MockactiveSetCacheMockRecorder
}
// MockactiveSetCacheMockRecorder is the mock recorder for MockactiveSetCache.
type MockactiveSetCacheMockRecorder struct {
mock *MockactiveSetCache
}
// NewMockactiveSetCache creates a new mock instance.
func NewMockactiveSetCache(ctrl *gomock.Controller) *MockactiveSetCache {
mock := &MockactiveSetCache{ctrl: ctrl}
mock.recorder = &MockactiveSetCacheMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockactiveSetCache) EXPECT() *MockactiveSetCacheMockRecorder {
return m.recorder
}
// Add mocks base method.
func (m *MockactiveSetCache) Add(key types.EpochID, value *cachedActiveSet) bool {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Add", key, value)
ret0, _ := ret[0].(bool)
return ret0
}
// Add indicates an expected call of Add.
func (mr *MockactiveSetCacheMockRecorder) Add(key, value any) *MockactiveSetCacheAddCall {
mr.mock.ctrl.T.Helper()
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Add", reflect.TypeOf((*MockactiveSetCache)(nil).Add), key, value)
return &MockactiveSetCacheAddCall{Call: call}
}
// MockactiveSetCacheAddCall wrap *gomock.Call
type MockactiveSetCacheAddCall struct {
*gomock.Call
}
// Return rewrite *gomock.Call.Return
func (c *MockactiveSetCacheAddCall) Return(evicted bool) *MockactiveSetCacheAddCall {
c.Call = c.Call.Return(evicted)
return c
}
// Do rewrite *gomock.Call.Do
func (c *MockactiveSetCacheAddCall) Do(f func(types.EpochID, *cachedActiveSet) bool) *MockactiveSetCacheAddCall {
c.Call = c.Call.Do(f)
return c
}
// DoAndReturn rewrite *gomock.Call.DoAndReturn
func (c *MockactiveSetCacheAddCall) DoAndReturn(f func(types.EpochID, *cachedActiveSet) bool) *MockactiveSetCacheAddCall {
c.Call = c.Call.DoAndReturn(f)
return c
}
// Get mocks base method.
func (m *MockactiveSetCache) Get(key types.EpochID) (*cachedActiveSet, bool) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Get", key)
ret0, _ := ret[0].(*cachedActiveSet)
ret1, _ := ret[1].(bool)
return ret0, ret1
}
// Get indicates an expected call of Get.
func (mr *MockactiveSetCacheMockRecorder) Get(key any) *MockactiveSetCacheGetCall {
mr.mock.ctrl.T.Helper()
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockactiveSetCache)(nil).Get), key)
return &MockactiveSetCacheGetCall{Call: call}
}
// MockactiveSetCacheGetCall wrap *gomock.Call
type MockactiveSetCacheGetCall struct {
*gomock.Call
}
// Return rewrite *gomock.Call.Return
func (c *MockactiveSetCacheGetCall) Return(value *cachedActiveSet, ok bool) *MockactiveSetCacheGetCall {
c.Call = c.Call.Return(value, ok)
return c
}
// Do rewrite *gomock.Call.Do
func (c *MockactiveSetCacheGetCall) Do(f func(types.EpochID) (*cachedActiveSet, bool)) *MockactiveSetCacheGetCall {
c.Call = c.Call.Do(f)
return c
}
// DoAndReturn rewrite *gomock.Call.DoAndReturn
func (c *MockactiveSetCacheGetCall) DoAndReturn(f func(types.EpochID) (*cachedActiveSet, bool)) *MockactiveSetCacheGetCall {
c.Call = c.Call.DoAndReturn(f)
return c
}
// MockvrfVerifier is a mock of vrfVerifier interface.
type MockvrfVerifier struct {
ctrl *gomock.Controller
recorder *MockvrfVerifierMockRecorder
}
// MockvrfVerifierMockRecorder is the mock recorder for MockvrfVerifier.
type MockvrfVerifierMockRecorder struct {
mock *MockvrfVerifier
}
// NewMockvrfVerifier creates a new mock instance.
func NewMockvrfVerifier(ctrl *gomock.Controller) *MockvrfVerifier {
mock := &MockvrfVerifier{ctrl: ctrl}
mock.recorder = &MockvrfVerifierMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockvrfVerifier) EXPECT() *MockvrfVerifierMockRecorder {
return m.recorder
}
// Verify mocks base method.
func (m *MockvrfVerifier) Verify(nodeID types.NodeID, msg []byte, sig types.VrfSignature) bool {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Verify", nodeID, msg, sig)
ret0, _ := ret[0].(bool)
return ret0
}
// Verify indicates an expected call of Verify.
func (mr *MockvrfVerifierMockRecorder) Verify(nodeID, msg, sig any) *MockvrfVerifierVerifyCall {
mr.mock.ctrl.T.Helper()
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Verify", reflect.TypeOf((*MockvrfVerifier)(nil).Verify), nodeID, msg, sig)
return &MockvrfVerifierVerifyCall{Call: call}
}
// MockvrfVerifierVerifyCall wrap *gomock.Call
type MockvrfVerifierVerifyCall struct {
*gomock.Call
}
// Return rewrite *gomock.Call.Return
func (c *MockvrfVerifierVerifyCall) Return(arg0 bool) *MockvrfVerifierVerifyCall {
c.Call = c.Call.Return(arg0)
return c
}
// Do rewrite *gomock.Call.Do
func (c *MockvrfVerifierVerifyCall) Do(f func(types.NodeID, []byte, types.VrfSignature) bool) *MockvrfVerifierVerifyCall {
c.Call = c.Call.Do(f)
return c
}
// DoAndReturn rewrite *gomock.Call.DoAndReturn
func (c *MockvrfVerifierVerifyCall) DoAndReturn(f func(types.NodeID, []byte, types.VrfSignature) bool) *MockvrfVerifierVerifyCall {
c.Call = c.Call.DoAndReturn(f)
return c
}
// MockRolacle is a mock of Rolacle interface.
type MockRolacle struct {
ctrl *gomock.Controller
recorder *MockRolacleMockRecorder
}
// MockRolacleMockRecorder is the mock recorder for MockRolacle.
type MockRolacleMockRecorder struct {
mock *MockRolacle
}
// NewMockRolacle creates a new mock instance.
func NewMockRolacle(ctrl *gomock.Controller) *MockRolacle {
mock := &MockRolacle{ctrl: ctrl}
mock.recorder = &MockRolacleMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockRolacle) EXPECT() *MockRolacleMockRecorder {
return m.recorder
}
// CalcEligibility mocks base method.
func (m *MockRolacle) CalcEligibility(arg0 context.Context, arg1 types.LayerID, arg2 uint32, arg3 int, arg4 types.NodeID, arg5 types.VrfSignature) (uint16, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "CalcEligibility", arg0, arg1, arg2, arg3, arg4, arg5)
ret0, _ := ret[0].(uint16)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// CalcEligibility indicates an expected call of CalcEligibility.
func (mr *MockRolacleMockRecorder) CalcEligibility(arg0, arg1, arg2, arg3, arg4, arg5 any) *MockRolacleCalcEligibilityCall {
mr.mock.ctrl.T.Helper()
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CalcEligibility", reflect.TypeOf((*MockRolacle)(nil).CalcEligibility), arg0, arg1, arg2, arg3, arg4, arg5)
return &MockRolacleCalcEligibilityCall{Call: call}
}
// MockRolacleCalcEligibilityCall wrap *gomock.Call
type MockRolacleCalcEligibilityCall struct {
*gomock.Call
}
// Return rewrite *gomock.Call.Return
func (c *MockRolacleCalcEligibilityCall) Return(arg0 uint16, arg1 error) *MockRolacleCalcEligibilityCall {
c.Call = c.Call.Return(arg0, arg1)
return c
}
// Do rewrite *gomock.Call.Do
func (c *MockRolacleCalcEligibilityCall) Do(f func(context.Context, types.LayerID, uint32, int, types.NodeID, types.VrfSignature) (uint16, error)) *MockRolacleCalcEligibilityCall {
c.Call = c.Call.Do(f)
return c
}
// DoAndReturn rewrite *gomock.Call.DoAndReturn
func (c *MockRolacleCalcEligibilityCall) DoAndReturn(f func(context.Context, types.LayerID, uint32, int, types.NodeID, types.VrfSignature) (uint16, error)) *MockRolacleCalcEligibilityCall {
c.Call = c.Call.DoAndReturn(f)
return c
}
// Proof mocks base method.
func (m *MockRolacle) Proof(arg0 context.Context, arg1 *signing.VRFSigner, arg2 types.LayerID, arg3 uint32) (types.VrfSignature, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Proof", arg0, arg1, arg2, arg3)
ret0, _ := ret[0].(types.VrfSignature)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Proof indicates an expected call of Proof.
func (mr *MockRolacleMockRecorder) Proof(arg0, arg1, arg2, arg3 any) *MockRolacleProofCall {
mr.mock.ctrl.T.Helper()
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Proof", reflect.TypeOf((*MockRolacle)(nil).Proof), arg0, arg1, arg2, arg3)
return &MockRolacleProofCall{Call: call}
}
// MockRolacleProofCall wrap *gomock.Call
type MockRolacleProofCall struct {
*gomock.Call
}
// Return rewrite *gomock.Call.Return
func (c *MockRolacleProofCall) Return(arg0 types.VrfSignature, arg1 error) *MockRolacleProofCall {
c.Call = c.Call.Return(arg0, arg1)
return c
}
// Do rewrite *gomock.Call.Do
func (c *MockRolacleProofCall) Do(f func(context.Context, *signing.VRFSigner, types.LayerID, uint32) (types.VrfSignature, error)) *MockRolacleProofCall {
c.Call = c.Call.Do(f)
return c
}
// DoAndReturn rewrite *gomock.Call.DoAndReturn
func (c *MockRolacleProofCall) DoAndReturn(f func(context.Context, *signing.VRFSigner, types.LayerID, uint32) (types.VrfSignature, error)) *MockRolacleProofCall {
c.Call = c.Call.DoAndReturn(f)
return c
}
// Validate mocks base method.
func (m *MockRolacle) Validate(arg0 context.Context, arg1 types.LayerID, arg2 uint32, arg3 int, arg4 types.NodeID, arg5 types.VrfSignature, arg6 uint16) (bool, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Validate", arg0, arg1, arg2, arg3, arg4, arg5, arg6)
ret0, _ := ret[0].(bool)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Validate indicates an expected call of Validate.
func (mr *MockRolacleMockRecorder) Validate(arg0, arg1, arg2, arg3, arg4, arg5, arg6 any) *MockRolacleValidateCall {
mr.mock.ctrl.T.Helper()
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Validate", reflect.TypeOf((*MockRolacle)(nil).Validate), arg0, arg1, arg2, arg3, arg4, arg5, arg6)
return &MockRolacleValidateCall{Call: call}
}
// MockRolacleValidateCall wrap *gomock.Call
type MockRolacleValidateCall struct {
*gomock.Call
}
// Return rewrite *gomock.Call.Return
func (c *MockRolacleValidateCall) Return(arg0 bool, arg1 error) *MockRolacleValidateCall {
c.Call = c.Call.Return(arg0, arg1)
return c
}
// Do rewrite *gomock.Call.Do
func (c *MockRolacleValidateCall) Do(f func(context.Context, types.LayerID, uint32, int, types.NodeID, types.VrfSignature, uint16) (bool, error)) *MockRolacleValidateCall {
c.Call = c.Call.Do(f)
return c
}
// DoAndReturn rewrite *gomock.Call.DoAndReturn
func (c *MockRolacleValidateCall) DoAndReturn(f func(context.Context, types.LayerID, uint32, int, types.NodeID, types.VrfSignature, uint16) (bool, error)) *MockRolacleValidateCall {
c.Call = c.Call.DoAndReturn(f)
return c
}