-
Notifications
You must be signed in to change notification settings - Fork 211
/
fetcher.go
347 lines (292 loc) · 11.5 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
// 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"
)
// 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
}
// FetchAtx mocks base method.
func (m *MockFetcher) FetchAtx(arg0 context.Context, arg1 types.ATXID) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "FetchAtx", arg0, arg1)
ret0, _ := ret[0].(error)
return ret0
}
// FetchAtx indicates an expected call of FetchAtx.
func (mr *MockFetcherMockRecorder) FetchAtx(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchAtx", reflect.TypeOf((*MockFetcher)(nil).FetchAtx), arg0, arg1)
}
// FetchBlock mocks base method.
func (m *MockFetcher) FetchBlock(arg0 context.Context, arg1 types.BlockID) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "FetchBlock", arg0, arg1)
ret0, _ := ret[0].(error)
return ret0
}
// FetchBlock indicates an expected call of FetchBlock.
func (mr *MockFetcherMockRecorder) FetchBlock(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchBlock", reflect.TypeOf((*MockFetcher)(nil).FetchBlock), arg0, arg1)
}
// 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)
}
// 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)
}
// GetTxs mocks base method.
func (m *MockFetcher) GetTxs(arg0 context.Context, arg1 []types.TransactionID) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetTxs", arg0, arg1)
ret0, _ := ret[0].(error)
return ret0
}
// GetTxs indicates an expected call of GetTxs.
func (mr *MockFetcherMockRecorder) GetTxs(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTxs", reflect.TypeOf((*MockFetcher)(nil).GetTxs), arg0, arg1)
}
// 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
}
// FetchBlock mocks base method.
func (m *MockBlockFetcher) FetchBlock(arg0 context.Context, arg1 types.BlockID) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "FetchBlock", arg0, arg1)
ret0, _ := ret[0].(error)
return ret0
}
// FetchBlock indicates an expected call of FetchBlock.
func (mr *MockBlockFetcherMockRecorder) FetchBlock(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchBlock", reflect.TypeOf((*MockBlockFetcher)(nil).FetchBlock), arg0, arg1)
}
// 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
}
// FetchAtx mocks base method.
func (m *MockAtxFetcher) FetchAtx(arg0 context.Context, arg1 types.ATXID) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "FetchAtx", arg0, arg1)
ret0, _ := ret[0].(error)
return ret0
}
// FetchAtx indicates an expected call of FetchAtx.
func (mr *MockAtxFetcherMockRecorder) FetchAtx(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchAtx", reflect.TypeOf((*MockAtxFetcher)(nil).FetchAtx), arg0, arg1)
}
// 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
}
// GetTxs mocks base method.
func (m *MockTxFetcher) GetTxs(arg0 context.Context, arg1 []types.TransactionID) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetTxs", arg0, arg1)
ret0, _ := ret[0].(error)
return ret0
}
// GetTxs indicates an expected call of GetTxs.
func (mr *MockTxFetcherMockRecorder) GetTxs(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTxs", reflect.TypeOf((*MockTxFetcher)(nil).GetTxs), 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)
}