-
Notifications
You must be signed in to change notification settings - Fork 211
/
fetcher.go
418 lines (351 loc) · 14.2 KB
/
fetcher.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
// Code generated by MockGen. DO NOT EDIT.
// Source: ./fetcher.go
// Package mocks is a generated GoMock package.
package mocks
import (
context "context"
reflect "reflect"
gomock "github.com/golang/mock/gomock"
types "github.com/spacemeshos/go-spacemesh/common/types"
p2p "github.com/spacemeshos/go-spacemesh/p2p"
)
// MockFetcher is a mock of Fetcher interface.
type MockFetcher struct {
ctrl *gomock.Controller
recorder *MockFetcherMockRecorder
}
// MockFetcherMockRecorder is the mock recorder for MockFetcher.
type MockFetcherMockRecorder struct {
mock *MockFetcher
}
// NewMockFetcher creates a new mock instance.
func NewMockFetcher(ctrl *gomock.Controller) *MockFetcher {
mock := &MockFetcher{ctrl: ctrl}
mock.recorder = &MockFetcherMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockFetcher) EXPECT() *MockFetcherMockRecorder {
return m.recorder
}
// GetAtxs mocks base method.
func (m *MockFetcher) GetAtxs(arg0 context.Context, arg1 []types.ATXID) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetAtxs", arg0, arg1)
ret0, _ := ret[0].(error)
return ret0
}
// GetAtxs indicates an expected call of GetAtxs.
func (mr *MockFetcherMockRecorder) GetAtxs(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAtxs", reflect.TypeOf((*MockFetcher)(nil).GetAtxs), arg0, arg1)
}
// GetBallots mocks base method.
func (m *MockFetcher) GetBallots(arg0 context.Context, arg1 []types.BallotID) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetBallots", arg0, arg1)
ret0, _ := ret[0].(error)
return ret0
}
// GetBallots indicates an expected call of GetBallots.
func (mr *MockFetcherMockRecorder) GetBallots(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBallots", reflect.TypeOf((*MockFetcher)(nil).GetBallots), arg0, arg1)
}
// GetBlockTxs mocks base method.
func (m *MockFetcher) GetBlockTxs(arg0 context.Context, arg1 []types.TransactionID) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetBlockTxs", arg0, arg1)
ret0, _ := ret[0].(error)
return ret0
}
// GetBlockTxs indicates an expected call of GetBlockTxs.
func (mr *MockFetcherMockRecorder) GetBlockTxs(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBlockTxs", reflect.TypeOf((*MockFetcher)(nil).GetBlockTxs), arg0, arg1)
}
// GetBlocks mocks base method.
func (m *MockFetcher) GetBlocks(arg0 context.Context, arg1 []types.BlockID) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetBlocks", arg0, arg1)
ret0, _ := ret[0].(error)
return ret0
}
// GetBlocks indicates an expected call of GetBlocks.
func (mr *MockFetcherMockRecorder) GetBlocks(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBlocks", reflect.TypeOf((*MockFetcher)(nil).GetBlocks), arg0, arg1)
}
// GetPoetProof mocks base method.
func (m *MockFetcher) GetPoetProof(arg0 context.Context, arg1 types.Hash32) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetPoetProof", arg0, arg1)
ret0, _ := ret[0].(error)
return ret0
}
// GetPoetProof indicates an expected call of GetPoetProof.
func (mr *MockFetcherMockRecorder) GetPoetProof(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPoetProof", reflect.TypeOf((*MockFetcher)(nil).GetPoetProof), arg0, arg1)
}
// GetProposalTxs mocks base method.
func (m *MockFetcher) GetProposalTxs(arg0 context.Context, arg1 []types.TransactionID) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetProposalTxs", arg0, arg1)
ret0, _ := ret[0].(error)
return ret0
}
// GetProposalTxs indicates an expected call of GetProposalTxs.
func (mr *MockFetcherMockRecorder) GetProposalTxs(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetProposalTxs", reflect.TypeOf((*MockFetcher)(nil).GetProposalTxs), arg0, arg1)
}
// GetProposals mocks base method.
func (m *MockFetcher) GetProposals(arg0 context.Context, arg1 []types.ProposalID) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetProposals", arg0, arg1)
ret0, _ := ret[0].(error)
return ret0
}
// GetProposals indicates an expected call of GetProposals.
func (mr *MockFetcherMockRecorder) GetProposals(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetProposals", reflect.TypeOf((*MockFetcher)(nil).GetProposals), arg0, arg1)
}
// RegisterPeerHashes mocks base method.
func (m *MockFetcher) RegisterPeerHashes(peer p2p.Peer, hashes []types.Hash32) {
m.ctrl.T.Helper()
m.ctrl.Call(m, "RegisterPeerHashes", peer, hashes)
}
// RegisterPeerHashes indicates an expected call of RegisterPeerHashes.
func (mr *MockFetcherMockRecorder) RegisterPeerHashes(peer, hashes interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterPeerHashes", reflect.TypeOf((*MockFetcher)(nil).RegisterPeerHashes), peer, hashes)
}
// MockBlockFetcher is a mock of BlockFetcher interface.
type MockBlockFetcher struct {
ctrl *gomock.Controller
recorder *MockBlockFetcherMockRecorder
}
// MockBlockFetcherMockRecorder is the mock recorder for MockBlockFetcher.
type MockBlockFetcherMockRecorder struct {
mock *MockBlockFetcher
}
// NewMockBlockFetcher creates a new mock instance.
func NewMockBlockFetcher(ctrl *gomock.Controller) *MockBlockFetcher {
mock := &MockBlockFetcher{ctrl: ctrl}
mock.recorder = &MockBlockFetcherMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockBlockFetcher) EXPECT() *MockBlockFetcherMockRecorder {
return m.recorder
}
// GetBlocks mocks base method.
func (m *MockBlockFetcher) GetBlocks(arg0 context.Context, arg1 []types.BlockID) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetBlocks", arg0, arg1)
ret0, _ := ret[0].(error)
return ret0
}
// GetBlocks indicates an expected call of GetBlocks.
func (mr *MockBlockFetcherMockRecorder) GetBlocks(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBlocks", reflect.TypeOf((*MockBlockFetcher)(nil).GetBlocks), arg0, arg1)
}
// MockAtxFetcher is a mock of AtxFetcher interface.
type MockAtxFetcher struct {
ctrl *gomock.Controller
recorder *MockAtxFetcherMockRecorder
}
// MockAtxFetcherMockRecorder is the mock recorder for MockAtxFetcher.
type MockAtxFetcherMockRecorder struct {
mock *MockAtxFetcher
}
// NewMockAtxFetcher creates a new mock instance.
func NewMockAtxFetcher(ctrl *gomock.Controller) *MockAtxFetcher {
mock := &MockAtxFetcher{ctrl: ctrl}
mock.recorder = &MockAtxFetcherMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockAtxFetcher) EXPECT() *MockAtxFetcherMockRecorder {
return m.recorder
}
// GetAtxs mocks base method.
func (m *MockAtxFetcher) GetAtxs(arg0 context.Context, arg1 []types.ATXID) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetAtxs", arg0, arg1)
ret0, _ := ret[0].(error)
return ret0
}
// GetAtxs indicates an expected call of GetAtxs.
func (mr *MockAtxFetcherMockRecorder) GetAtxs(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAtxs", reflect.TypeOf((*MockAtxFetcher)(nil).GetAtxs), arg0, arg1)
}
// MockTxFetcher is a mock of TxFetcher interface.
type MockTxFetcher struct {
ctrl *gomock.Controller
recorder *MockTxFetcherMockRecorder
}
// MockTxFetcherMockRecorder is the mock recorder for MockTxFetcher.
type MockTxFetcherMockRecorder struct {
mock *MockTxFetcher
}
// NewMockTxFetcher creates a new mock instance.
func NewMockTxFetcher(ctrl *gomock.Controller) *MockTxFetcher {
mock := &MockTxFetcher{ctrl: ctrl}
mock.recorder = &MockTxFetcherMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockTxFetcher) EXPECT() *MockTxFetcherMockRecorder {
return m.recorder
}
// GetBlockTxs mocks base method.
func (m *MockTxFetcher) GetBlockTxs(arg0 context.Context, arg1 []types.TransactionID) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetBlockTxs", arg0, arg1)
ret0, _ := ret[0].(error)
return ret0
}
// GetBlockTxs indicates an expected call of GetBlockTxs.
func (mr *MockTxFetcherMockRecorder) GetBlockTxs(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBlockTxs", reflect.TypeOf((*MockTxFetcher)(nil).GetBlockTxs), arg0, arg1)
}
// GetProposalTxs mocks base method.
func (m *MockTxFetcher) GetProposalTxs(arg0 context.Context, arg1 []types.TransactionID) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetProposalTxs", arg0, arg1)
ret0, _ := ret[0].(error)
return ret0
}
// GetProposalTxs indicates an expected call of GetProposalTxs.
func (mr *MockTxFetcherMockRecorder) GetProposalTxs(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetProposalTxs", reflect.TypeOf((*MockTxFetcher)(nil).GetProposalTxs), arg0, arg1)
}
// MockPoetProofFetcher is a mock of PoetProofFetcher interface.
type MockPoetProofFetcher struct {
ctrl *gomock.Controller
recorder *MockPoetProofFetcherMockRecorder
}
// MockPoetProofFetcherMockRecorder is the mock recorder for MockPoetProofFetcher.
type MockPoetProofFetcherMockRecorder struct {
mock *MockPoetProofFetcher
}
// NewMockPoetProofFetcher creates a new mock instance.
func NewMockPoetProofFetcher(ctrl *gomock.Controller) *MockPoetProofFetcher {
mock := &MockPoetProofFetcher{ctrl: ctrl}
mock.recorder = &MockPoetProofFetcherMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockPoetProofFetcher) EXPECT() *MockPoetProofFetcherMockRecorder {
return m.recorder
}
// GetPoetProof mocks base method.
func (m *MockPoetProofFetcher) GetPoetProof(arg0 context.Context, arg1 types.Hash32) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetPoetProof", arg0, arg1)
ret0, _ := ret[0].(error)
return ret0
}
// GetPoetProof indicates an expected call of GetPoetProof.
func (mr *MockPoetProofFetcherMockRecorder) GetPoetProof(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPoetProof", reflect.TypeOf((*MockPoetProofFetcher)(nil).GetPoetProof), arg0, arg1)
}
// MockBallotFetcher is a mock of BallotFetcher interface.
type MockBallotFetcher struct {
ctrl *gomock.Controller
recorder *MockBallotFetcherMockRecorder
}
// MockBallotFetcherMockRecorder is the mock recorder for MockBallotFetcher.
type MockBallotFetcherMockRecorder struct {
mock *MockBallotFetcher
}
// NewMockBallotFetcher creates a new mock instance.
func NewMockBallotFetcher(ctrl *gomock.Controller) *MockBallotFetcher {
mock := &MockBallotFetcher{ctrl: ctrl}
mock.recorder = &MockBallotFetcherMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockBallotFetcher) EXPECT() *MockBallotFetcherMockRecorder {
return m.recorder
}
// GetBallots mocks base method.
func (m *MockBallotFetcher) GetBallots(arg0 context.Context, arg1 []types.BallotID) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetBallots", arg0, arg1)
ret0, _ := ret[0].(error)
return ret0
}
// GetBallots indicates an expected call of GetBallots.
func (mr *MockBallotFetcherMockRecorder) GetBallots(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBallots", reflect.TypeOf((*MockBallotFetcher)(nil).GetBallots), arg0, arg1)
}
// MockProposalFetcher is a mock of ProposalFetcher interface.
type MockProposalFetcher struct {
ctrl *gomock.Controller
recorder *MockProposalFetcherMockRecorder
}
// MockProposalFetcherMockRecorder is the mock recorder for MockProposalFetcher.
type MockProposalFetcherMockRecorder struct {
mock *MockProposalFetcher
}
// NewMockProposalFetcher creates a new mock instance.
func NewMockProposalFetcher(ctrl *gomock.Controller) *MockProposalFetcher {
mock := &MockProposalFetcher{ctrl: ctrl}
mock.recorder = &MockProposalFetcherMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockProposalFetcher) EXPECT() *MockProposalFetcherMockRecorder {
return m.recorder
}
// GetProposals mocks base method.
func (m *MockProposalFetcher) GetProposals(arg0 context.Context, arg1 []types.ProposalID) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetProposals", arg0, arg1)
ret0, _ := ret[0].(error)
return ret0
}
// GetProposals indicates an expected call of GetProposals.
func (mr *MockProposalFetcherMockRecorder) GetProposals(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetProposals", reflect.TypeOf((*MockProposalFetcher)(nil).GetProposals), arg0, arg1)
}
// MockPeerTracker is a mock of PeerTracker interface.
type MockPeerTracker struct {
ctrl *gomock.Controller
recorder *MockPeerTrackerMockRecorder
}
// MockPeerTrackerMockRecorder is the mock recorder for MockPeerTracker.
type MockPeerTrackerMockRecorder struct {
mock *MockPeerTracker
}
// NewMockPeerTracker creates a new mock instance.
func NewMockPeerTracker(ctrl *gomock.Controller) *MockPeerTracker {
mock := &MockPeerTracker{ctrl: ctrl}
mock.recorder = &MockPeerTrackerMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockPeerTracker) EXPECT() *MockPeerTrackerMockRecorder {
return m.recorder
}
// RegisterPeerHashes mocks base method.
func (m *MockPeerTracker) RegisterPeerHashes(peer p2p.Peer, hashes []types.Hash32) {
m.ctrl.T.Helper()
m.ctrl.Call(m, "RegisterPeerHashes", peer, hashes)
}
// RegisterPeerHashes indicates an expected call of RegisterPeerHashes.
func (mr *MockPeerTrackerMockRecorder) RegisterPeerHashes(peer, hashes interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterPeerHashes", reflect.TypeOf((*MockPeerTracker)(nil).RegisterPeerHashes), peer, hashes)
}