/
mock_workers_interface.go
435 lines (350 loc) · 14.4 KB
/
mock_workers_interface.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
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
// Code generated by mockery. DO NOT EDIT.
package l1_parallel_sync
import (
context "context"
time "time"
mock "github.com/stretchr/testify/mock"
)
// workersInterfaceMock is an autogenerated mock type for the workersInterface type
type workersInterfaceMock struct {
mock.Mock
}
type workersInterfaceMock_Expecter struct {
mock *mock.Mock
}
func (_m *workersInterfaceMock) EXPECT() *workersInterfaceMock_Expecter {
return &workersInterfaceMock_Expecter{mock: &_m.Mock}
}
// String provides a mock function with given fields:
func (_m *workersInterfaceMock) String() string {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for String")
}
var r0 string
if rf, ok := ret.Get(0).(func() string); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(string)
}
return r0
}
// workersInterfaceMock_String_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'String'
type workersInterfaceMock_String_Call struct {
*mock.Call
}
// String is a helper method to define mock.On call
func (_e *workersInterfaceMock_Expecter) String() *workersInterfaceMock_String_Call {
return &workersInterfaceMock_String_Call{Call: _e.mock.On("String")}
}
func (_c *workersInterfaceMock_String_Call) Run(run func()) *workersInterfaceMock_String_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *workersInterfaceMock_String_Call) Return(_a0 string) *workersInterfaceMock_String_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *workersInterfaceMock_String_Call) RunAndReturn(run func() string) *workersInterfaceMock_String_Call {
_c.Call.Return(run)
return _c
}
// ToStringBrief provides a mock function with given fields:
func (_m *workersInterfaceMock) ToStringBrief() string {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for ToStringBrief")
}
var r0 string
if rf, ok := ret.Get(0).(func() string); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(string)
}
return r0
}
// workersInterfaceMock_ToStringBrief_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ToStringBrief'
type workersInterfaceMock_ToStringBrief_Call struct {
*mock.Call
}
// ToStringBrief is a helper method to define mock.On call
func (_e *workersInterfaceMock_Expecter) ToStringBrief() *workersInterfaceMock_ToStringBrief_Call {
return &workersInterfaceMock_ToStringBrief_Call{Call: _e.mock.On("ToStringBrief")}
}
func (_c *workersInterfaceMock_ToStringBrief_Call) Run(run func()) *workersInterfaceMock_ToStringBrief_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *workersInterfaceMock_ToStringBrief_Call) Return(_a0 string) *workersInterfaceMock_ToStringBrief_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *workersInterfaceMock_ToStringBrief_Call) RunAndReturn(run func() string) *workersInterfaceMock_ToStringBrief_Call {
_c.Call.Return(run)
return _c
}
// asyncRequestRollupInfoByBlockRange provides a mock function with given fields: ctx, request
func (_m *workersInterfaceMock) asyncRequestRollupInfoByBlockRange(ctx context.Context, request requestRollupInfoByBlockRange) (chan responseRollupInfoByBlockRange, error) {
ret := _m.Called(ctx, request)
if len(ret) == 0 {
panic("no return value specified for asyncRequestRollupInfoByBlockRange")
}
var r0 chan responseRollupInfoByBlockRange
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, requestRollupInfoByBlockRange) (chan responseRollupInfoByBlockRange, error)); ok {
return rf(ctx, request)
}
if rf, ok := ret.Get(0).(func(context.Context, requestRollupInfoByBlockRange) chan responseRollupInfoByBlockRange); ok {
r0 = rf(ctx, request)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(chan responseRollupInfoByBlockRange)
}
}
if rf, ok := ret.Get(1).(func(context.Context, requestRollupInfoByBlockRange) error); ok {
r1 = rf(ctx, request)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// workersInterfaceMock_asyncRequestRollupInfoByBlockRange_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'asyncRequestRollupInfoByBlockRange'
type workersInterfaceMock_asyncRequestRollupInfoByBlockRange_Call struct {
*mock.Call
}
// asyncRequestRollupInfoByBlockRange is a helper method to define mock.On call
// - ctx context.Context
// - request requestRollupInfoByBlockRange
func (_e *workersInterfaceMock_Expecter) asyncRequestRollupInfoByBlockRange(ctx interface{}, request interface{}) *workersInterfaceMock_asyncRequestRollupInfoByBlockRange_Call {
return &workersInterfaceMock_asyncRequestRollupInfoByBlockRange_Call{Call: _e.mock.On("asyncRequestRollupInfoByBlockRange", ctx, request)}
}
func (_c *workersInterfaceMock_asyncRequestRollupInfoByBlockRange_Call) Run(run func(ctx context.Context, request requestRollupInfoByBlockRange)) *workersInterfaceMock_asyncRequestRollupInfoByBlockRange_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(requestRollupInfoByBlockRange))
})
return _c
}
func (_c *workersInterfaceMock_asyncRequestRollupInfoByBlockRange_Call) Return(_a0 chan responseRollupInfoByBlockRange, _a1 error) *workersInterfaceMock_asyncRequestRollupInfoByBlockRange_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *workersInterfaceMock_asyncRequestRollupInfoByBlockRange_Call) RunAndReturn(run func(context.Context, requestRollupInfoByBlockRange) (chan responseRollupInfoByBlockRange, error)) *workersInterfaceMock_asyncRequestRollupInfoByBlockRange_Call {
_c.Call.Return(run)
return _c
}
// getResponseChannelForRollupInfo provides a mock function with given fields:
func (_m *workersInterfaceMock) getResponseChannelForRollupInfo() chan responseRollupInfoByBlockRange {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for getResponseChannelForRollupInfo")
}
var r0 chan responseRollupInfoByBlockRange
if rf, ok := ret.Get(0).(func() chan responseRollupInfoByBlockRange); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(chan responseRollupInfoByBlockRange)
}
}
return r0
}
// workersInterfaceMock_getResponseChannelForRollupInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'getResponseChannelForRollupInfo'
type workersInterfaceMock_getResponseChannelForRollupInfo_Call struct {
*mock.Call
}
// getResponseChannelForRollupInfo is a helper method to define mock.On call
func (_e *workersInterfaceMock_Expecter) getResponseChannelForRollupInfo() *workersInterfaceMock_getResponseChannelForRollupInfo_Call {
return &workersInterfaceMock_getResponseChannelForRollupInfo_Call{Call: _e.mock.On("getResponseChannelForRollupInfo")}
}
func (_c *workersInterfaceMock_getResponseChannelForRollupInfo_Call) Run(run func()) *workersInterfaceMock_getResponseChannelForRollupInfo_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *workersInterfaceMock_getResponseChannelForRollupInfo_Call) Return(_a0 chan responseRollupInfoByBlockRange) *workersInterfaceMock_getResponseChannelForRollupInfo_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *workersInterfaceMock_getResponseChannelForRollupInfo_Call) RunAndReturn(run func() chan responseRollupInfoByBlockRange) *workersInterfaceMock_getResponseChannelForRollupInfo_Call {
_c.Call.Return(run)
return _c
}
// howManyRunningWorkers provides a mock function with given fields:
func (_m *workersInterfaceMock) howManyRunningWorkers() int {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for howManyRunningWorkers")
}
var r0 int
if rf, ok := ret.Get(0).(func() int); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(int)
}
return r0
}
// workersInterfaceMock_howManyRunningWorkers_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'howManyRunningWorkers'
type workersInterfaceMock_howManyRunningWorkers_Call struct {
*mock.Call
}
// howManyRunningWorkers is a helper method to define mock.On call
func (_e *workersInterfaceMock_Expecter) howManyRunningWorkers() *workersInterfaceMock_howManyRunningWorkers_Call {
return &workersInterfaceMock_howManyRunningWorkers_Call{Call: _e.mock.On("howManyRunningWorkers")}
}
func (_c *workersInterfaceMock_howManyRunningWorkers_Call) Run(run func()) *workersInterfaceMock_howManyRunningWorkers_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *workersInterfaceMock_howManyRunningWorkers_Call) Return(_a0 int) *workersInterfaceMock_howManyRunningWorkers_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *workersInterfaceMock_howManyRunningWorkers_Call) RunAndReturn(run func() int) *workersInterfaceMock_howManyRunningWorkers_Call {
_c.Call.Return(run)
return _c
}
// initialize provides a mock function with given fields:
func (_m *workersInterfaceMock) initialize() error {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for initialize")
}
var r0 error
if rf, ok := ret.Get(0).(func() error); ok {
r0 = rf()
} else {
r0 = ret.Error(0)
}
return r0
}
// workersInterfaceMock_initialize_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'initialize'
type workersInterfaceMock_initialize_Call struct {
*mock.Call
}
// initialize is a helper method to define mock.On call
func (_e *workersInterfaceMock_Expecter) initialize() *workersInterfaceMock_initialize_Call {
return &workersInterfaceMock_initialize_Call{Call: _e.mock.On("initialize")}
}
func (_c *workersInterfaceMock_initialize_Call) Run(run func()) *workersInterfaceMock_initialize_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *workersInterfaceMock_initialize_Call) Return(_a0 error) *workersInterfaceMock_initialize_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *workersInterfaceMock_initialize_Call) RunAndReturn(run func() error) *workersInterfaceMock_initialize_Call {
_c.Call.Return(run)
return _c
}
// requestLastBlockWithRetries provides a mock function with given fields: ctx, timeout, maxPermittedRetries
func (_m *workersInterfaceMock) requestLastBlockWithRetries(ctx context.Context, timeout time.Duration, maxPermittedRetries int) responseL1LastBlock {
ret := _m.Called(ctx, timeout, maxPermittedRetries)
if len(ret) == 0 {
panic("no return value specified for requestLastBlockWithRetries")
}
var r0 responseL1LastBlock
if rf, ok := ret.Get(0).(func(context.Context, time.Duration, int) responseL1LastBlock); ok {
r0 = rf(ctx, timeout, maxPermittedRetries)
} else {
r0 = ret.Get(0).(responseL1LastBlock)
}
return r0
}
// workersInterfaceMock_requestLastBlockWithRetries_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'requestLastBlockWithRetries'
type workersInterfaceMock_requestLastBlockWithRetries_Call struct {
*mock.Call
}
// requestLastBlockWithRetries is a helper method to define mock.On call
// - ctx context.Context
// - timeout time.Duration
// - maxPermittedRetries int
func (_e *workersInterfaceMock_Expecter) requestLastBlockWithRetries(ctx interface{}, timeout interface{}, maxPermittedRetries interface{}) *workersInterfaceMock_requestLastBlockWithRetries_Call {
return &workersInterfaceMock_requestLastBlockWithRetries_Call{Call: _e.mock.On("requestLastBlockWithRetries", ctx, timeout, maxPermittedRetries)}
}
func (_c *workersInterfaceMock_requestLastBlockWithRetries_Call) Run(run func(ctx context.Context, timeout time.Duration, maxPermittedRetries int)) *workersInterfaceMock_requestLastBlockWithRetries_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(time.Duration), args[2].(int))
})
return _c
}
func (_c *workersInterfaceMock_requestLastBlockWithRetries_Call) Return(_a0 responseL1LastBlock) *workersInterfaceMock_requestLastBlockWithRetries_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *workersInterfaceMock_requestLastBlockWithRetries_Call) RunAndReturn(run func(context.Context, time.Duration, int) responseL1LastBlock) *workersInterfaceMock_requestLastBlockWithRetries_Call {
_c.Call.Return(run)
return _c
}
// stop provides a mock function with given fields:
func (_m *workersInterfaceMock) stop() {
_m.Called()
}
// workersInterfaceMock_stop_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'stop'
type workersInterfaceMock_stop_Call struct {
*mock.Call
}
// stop is a helper method to define mock.On call
func (_e *workersInterfaceMock_Expecter) stop() *workersInterfaceMock_stop_Call {
return &workersInterfaceMock_stop_Call{Call: _e.mock.On("stop")}
}
func (_c *workersInterfaceMock_stop_Call) Run(run func()) *workersInterfaceMock_stop_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *workersInterfaceMock_stop_Call) Return() *workersInterfaceMock_stop_Call {
_c.Call.Return()
return _c
}
func (_c *workersInterfaceMock_stop_Call) RunAndReturn(run func()) *workersInterfaceMock_stop_Call {
_c.Call.Return(run)
return _c
}
// waitFinishAllWorkers provides a mock function with given fields:
func (_m *workersInterfaceMock) waitFinishAllWorkers() {
_m.Called()
}
// workersInterfaceMock_waitFinishAllWorkers_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'waitFinishAllWorkers'
type workersInterfaceMock_waitFinishAllWorkers_Call struct {
*mock.Call
}
// waitFinishAllWorkers is a helper method to define mock.On call
func (_e *workersInterfaceMock_Expecter) waitFinishAllWorkers() *workersInterfaceMock_waitFinishAllWorkers_Call {
return &workersInterfaceMock_waitFinishAllWorkers_Call{Call: _e.mock.On("waitFinishAllWorkers")}
}
func (_c *workersInterfaceMock_waitFinishAllWorkers_Call) Run(run func()) *workersInterfaceMock_waitFinishAllWorkers_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *workersInterfaceMock_waitFinishAllWorkers_Call) Return() *workersInterfaceMock_waitFinishAllWorkers_Call {
_c.Call.Return()
return _c
}
func (_c *workersInterfaceMock_waitFinishAllWorkers_Call) RunAndReturn(run func()) *workersInterfaceMock_waitFinishAllWorkers_Call {
_c.Call.Return(run)
return _c
}
// newWorkersInterfaceMock creates a new instance of workersInterfaceMock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func newWorkersInterfaceMock(t interface {
mock.TestingT
Cleanup(func())
}) *workersInterfaceMock {
mock := &workersInterfaceMock{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}