-
Notifications
You must be signed in to change notification settings - Fork 210
/
mocks.go
394 lines (332 loc) · 13.2 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
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
// Code generated by MockGen. DO NOT EDIT.
// Source: ./interface.go
//
// Generated by this command:
//
// mockgen -typed -package=mocks -destination=./mocks/mocks.go -source=./interface.go
//
// Package mocks is a generated GoMock package.
package mocks
import (
context "context"
reflect "reflect"
types "github.com/spacemeshos/go-spacemesh/common/types"
vm "github.com/spacemeshos/go-spacemesh/genvm"
gomock "go.uber.org/mock/gomock"
)
// MockconservativeState is a mock of conservativeState interface.
type MockconservativeState struct {
ctrl *gomock.Controller
recorder *MockconservativeStateMockRecorder
}
// MockconservativeStateMockRecorder is the mock recorder for MockconservativeState.
type MockconservativeStateMockRecorder struct {
mock *MockconservativeState
}
// NewMockconservativeState creates a new mock instance.
func NewMockconservativeState(ctrl *gomock.Controller) *MockconservativeState {
mock := &MockconservativeState{ctrl: ctrl}
mock.recorder = &MockconservativeStateMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockconservativeState) EXPECT() *MockconservativeStateMockRecorder {
return m.recorder
}
// LinkTXsWithBlock mocks base method.
func (m *MockconservativeState) LinkTXsWithBlock(arg0 types.LayerID, arg1 types.BlockID, arg2 []types.TransactionID) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "LinkTXsWithBlock", arg0, arg1, arg2)
ret0, _ := ret[0].(error)
return ret0
}
// LinkTXsWithBlock indicates an expected call of LinkTXsWithBlock.
func (mr *MockconservativeStateMockRecorder) LinkTXsWithBlock(arg0, arg1, arg2 any) *conservativeStateLinkTXsWithBlockCall {
mr.mock.ctrl.T.Helper()
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LinkTXsWithBlock", reflect.TypeOf((*MockconservativeState)(nil).LinkTXsWithBlock), arg0, arg1, arg2)
return &conservativeStateLinkTXsWithBlockCall{Call: call}
}
// conservativeStateLinkTXsWithBlockCall wrap *gomock.Call
type conservativeStateLinkTXsWithBlockCall struct {
*gomock.Call
}
// Return rewrite *gomock.Call.Return
func (c *conservativeStateLinkTXsWithBlockCall) Return(arg0 error) *conservativeStateLinkTXsWithBlockCall {
c.Call = c.Call.Return(arg0)
return c
}
// Do rewrite *gomock.Call.Do
func (c *conservativeStateLinkTXsWithBlockCall) Do(f func(types.LayerID, types.BlockID, []types.TransactionID) error) *conservativeStateLinkTXsWithBlockCall {
c.Call = c.Call.Do(f)
return c
}
// DoAndReturn rewrite *gomock.Call.DoAndReturn
func (c *conservativeStateLinkTXsWithBlockCall) DoAndReturn(f func(types.LayerID, types.BlockID, []types.TransactionID) error) *conservativeStateLinkTXsWithBlockCall {
c.Call = c.Call.DoAndReturn(f)
return c
}
// LinkTXsWithProposal mocks base method.
func (m *MockconservativeState) LinkTXsWithProposal(arg0 types.LayerID, arg1 types.ProposalID, arg2 []types.TransactionID) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "LinkTXsWithProposal", arg0, arg1, arg2)
ret0, _ := ret[0].(error)
return ret0
}
// LinkTXsWithProposal indicates an expected call of LinkTXsWithProposal.
func (mr *MockconservativeStateMockRecorder) LinkTXsWithProposal(arg0, arg1, arg2 any) *conservativeStateLinkTXsWithProposalCall {
mr.mock.ctrl.T.Helper()
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LinkTXsWithProposal", reflect.TypeOf((*MockconservativeState)(nil).LinkTXsWithProposal), arg0, arg1, arg2)
return &conservativeStateLinkTXsWithProposalCall{Call: call}
}
// conservativeStateLinkTXsWithProposalCall wrap *gomock.Call
type conservativeStateLinkTXsWithProposalCall struct {
*gomock.Call
}
// Return rewrite *gomock.Call.Return
func (c *conservativeStateLinkTXsWithProposalCall) Return(arg0 error) *conservativeStateLinkTXsWithProposalCall {
c.Call = c.Call.Return(arg0)
return c
}
// Do rewrite *gomock.Call.Do
func (c *conservativeStateLinkTXsWithProposalCall) Do(f func(types.LayerID, types.ProposalID, []types.TransactionID) error) *conservativeStateLinkTXsWithProposalCall {
c.Call = c.Call.Do(f)
return c
}
// DoAndReturn rewrite *gomock.Call.DoAndReturn
func (c *conservativeStateLinkTXsWithProposalCall) DoAndReturn(f func(types.LayerID, types.ProposalID, []types.TransactionID) error) *conservativeStateLinkTXsWithProposalCall {
c.Call = c.Call.DoAndReturn(f)
return c
}
// RevertCache mocks base method.
func (m *MockconservativeState) RevertCache(arg0 types.LayerID) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "RevertCache", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// RevertCache indicates an expected call of RevertCache.
func (mr *MockconservativeStateMockRecorder) RevertCache(arg0 any) *conservativeStateRevertCacheCall {
mr.mock.ctrl.T.Helper()
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RevertCache", reflect.TypeOf((*MockconservativeState)(nil).RevertCache), arg0)
return &conservativeStateRevertCacheCall{Call: call}
}
// conservativeStateRevertCacheCall wrap *gomock.Call
type conservativeStateRevertCacheCall struct {
*gomock.Call
}
// Return rewrite *gomock.Call.Return
func (c *conservativeStateRevertCacheCall) Return(arg0 error) *conservativeStateRevertCacheCall {
c.Call = c.Call.Return(arg0)
return c
}
// Do rewrite *gomock.Call.Do
func (c *conservativeStateRevertCacheCall) Do(f func(types.LayerID) error) *conservativeStateRevertCacheCall {
c.Call = c.Call.Do(f)
return c
}
// DoAndReturn rewrite *gomock.Call.DoAndReturn
func (c *conservativeStateRevertCacheCall) DoAndReturn(f func(types.LayerID) error) *conservativeStateRevertCacheCall {
c.Call = c.Call.DoAndReturn(f)
return c
}
// UpdateCache mocks base method.
func (m *MockconservativeState) UpdateCache(arg0 context.Context, arg1 types.LayerID, arg2 types.BlockID, arg3 []types.TransactionWithResult, arg4 []types.Transaction) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "UpdateCache", arg0, arg1, arg2, arg3, arg4)
ret0, _ := ret[0].(error)
return ret0
}
// UpdateCache indicates an expected call of UpdateCache.
func (mr *MockconservativeStateMockRecorder) UpdateCache(arg0, arg1, arg2, arg3, arg4 any) *conservativeStateUpdateCacheCall {
mr.mock.ctrl.T.Helper()
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateCache", reflect.TypeOf((*MockconservativeState)(nil).UpdateCache), arg0, arg1, arg2, arg3, arg4)
return &conservativeStateUpdateCacheCall{Call: call}
}
// conservativeStateUpdateCacheCall wrap *gomock.Call
type conservativeStateUpdateCacheCall struct {
*gomock.Call
}
// Return rewrite *gomock.Call.Return
func (c *conservativeStateUpdateCacheCall) Return(arg0 error) *conservativeStateUpdateCacheCall {
c.Call = c.Call.Return(arg0)
return c
}
// Do rewrite *gomock.Call.Do
func (c *conservativeStateUpdateCacheCall) Do(f func(context.Context, types.LayerID, types.BlockID, []types.TransactionWithResult, []types.Transaction) error) *conservativeStateUpdateCacheCall {
c.Call = c.Call.Do(f)
return c
}
// DoAndReturn rewrite *gomock.Call.DoAndReturn
func (c *conservativeStateUpdateCacheCall) DoAndReturn(f func(context.Context, types.LayerID, types.BlockID, []types.TransactionWithResult, []types.Transaction) error) *conservativeStateUpdateCacheCall {
c.Call = c.Call.DoAndReturn(f)
return c
}
// MockvmState is a mock of vmState interface.
type MockvmState struct {
ctrl *gomock.Controller
recorder *MockvmStateMockRecorder
}
// MockvmStateMockRecorder is the mock recorder for MockvmState.
type MockvmStateMockRecorder struct {
mock *MockvmState
}
// NewMockvmState creates a new mock instance.
func NewMockvmState(ctrl *gomock.Controller) *MockvmState {
mock := &MockvmState{ctrl: ctrl}
mock.recorder = &MockvmStateMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockvmState) EXPECT() *MockvmStateMockRecorder {
return m.recorder
}
// Apply mocks base method.
func (m *MockvmState) Apply(arg0 vm.ApplyContext, arg1 []types.Transaction, arg2 []types.CoinbaseReward) ([]types.Transaction, []types.TransactionWithResult, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Apply", arg0, arg1, arg2)
ret0, _ := ret[0].([]types.Transaction)
ret1, _ := ret[1].([]types.TransactionWithResult)
ret2, _ := ret[2].(error)
return ret0, ret1, ret2
}
// Apply indicates an expected call of Apply.
func (mr *MockvmStateMockRecorder) Apply(arg0, arg1, arg2 any) *vmStateApplyCall {
mr.mock.ctrl.T.Helper()
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Apply", reflect.TypeOf((*MockvmState)(nil).Apply), arg0, arg1, arg2)
return &vmStateApplyCall{Call: call}
}
// vmStateApplyCall wrap *gomock.Call
type vmStateApplyCall struct {
*gomock.Call
}
// Return rewrite *gomock.Call.Return
func (c *vmStateApplyCall) Return(arg0 []types.Transaction, arg1 []types.TransactionWithResult, arg2 error) *vmStateApplyCall {
c.Call = c.Call.Return(arg0, arg1, arg2)
return c
}
// Do rewrite *gomock.Call.Do
func (c *vmStateApplyCall) Do(f func(vm.ApplyContext, []types.Transaction, []types.CoinbaseReward) ([]types.Transaction, []types.TransactionWithResult, error)) *vmStateApplyCall {
c.Call = c.Call.Do(f)
return c
}
// DoAndReturn rewrite *gomock.Call.DoAndReturn
func (c *vmStateApplyCall) DoAndReturn(f func(vm.ApplyContext, []types.Transaction, []types.CoinbaseReward) ([]types.Transaction, []types.TransactionWithResult, error)) *vmStateApplyCall {
c.Call = c.Call.DoAndReturn(f)
return c
}
// GetStateRoot mocks base method.
func (m *MockvmState) GetStateRoot() (types.Hash32, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetStateRoot")
ret0, _ := ret[0].(types.Hash32)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetStateRoot indicates an expected call of GetStateRoot.
func (mr *MockvmStateMockRecorder) GetStateRoot() *vmStateGetStateRootCall {
mr.mock.ctrl.T.Helper()
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStateRoot", reflect.TypeOf((*MockvmState)(nil).GetStateRoot))
return &vmStateGetStateRootCall{Call: call}
}
// vmStateGetStateRootCall wrap *gomock.Call
type vmStateGetStateRootCall struct {
*gomock.Call
}
// Return rewrite *gomock.Call.Return
func (c *vmStateGetStateRootCall) Return(arg0 types.Hash32, arg1 error) *vmStateGetStateRootCall {
c.Call = c.Call.Return(arg0, arg1)
return c
}
// Do rewrite *gomock.Call.Do
func (c *vmStateGetStateRootCall) Do(f func() (types.Hash32, error)) *vmStateGetStateRootCall {
c.Call = c.Call.Do(f)
return c
}
// DoAndReturn rewrite *gomock.Call.DoAndReturn
func (c *vmStateGetStateRootCall) DoAndReturn(f func() (types.Hash32, error)) *vmStateGetStateRootCall {
c.Call = c.Call.DoAndReturn(f)
return c
}
// Revert mocks base method.
func (m *MockvmState) Revert(arg0 types.LayerID) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Revert", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// Revert indicates an expected call of Revert.
func (mr *MockvmStateMockRecorder) Revert(arg0 any) *vmStateRevertCall {
mr.mock.ctrl.T.Helper()
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Revert", reflect.TypeOf((*MockvmState)(nil).Revert), arg0)
return &vmStateRevertCall{Call: call}
}
// vmStateRevertCall wrap *gomock.Call
type vmStateRevertCall struct {
*gomock.Call
}
// Return rewrite *gomock.Call.Return
func (c *vmStateRevertCall) Return(arg0 error) *vmStateRevertCall {
c.Call = c.Call.Return(arg0)
return c
}
// Do rewrite *gomock.Call.Do
func (c *vmStateRevertCall) Do(f func(types.LayerID) error) *vmStateRevertCall {
c.Call = c.Call.Do(f)
return c
}
// DoAndReturn rewrite *gomock.Call.DoAndReturn
func (c *vmStateRevertCall) DoAndReturn(f func(types.LayerID) error) *vmStateRevertCall {
c.Call = c.Call.DoAndReturn(f)
return c
}
// MocklayerClock is a mock of layerClock interface.
type MocklayerClock struct {
ctrl *gomock.Controller
recorder *MocklayerClockMockRecorder
}
// MocklayerClockMockRecorder is the mock recorder for MocklayerClock.
type MocklayerClockMockRecorder struct {
mock *MocklayerClock
}
// NewMocklayerClock creates a new mock instance.
func NewMocklayerClock(ctrl *gomock.Controller) *MocklayerClock {
mock := &MocklayerClock{ctrl: ctrl}
mock.recorder = &MocklayerClockMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MocklayerClock) EXPECT() *MocklayerClockMockRecorder {
return m.recorder
}
// CurrentLayer mocks base method.
func (m *MocklayerClock) CurrentLayer() types.LayerID {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "CurrentLayer")
ret0, _ := ret[0].(types.LayerID)
return ret0
}
// CurrentLayer indicates an expected call of CurrentLayer.
func (mr *MocklayerClockMockRecorder) CurrentLayer() *layerClockCurrentLayerCall {
mr.mock.ctrl.T.Helper()
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CurrentLayer", reflect.TypeOf((*MocklayerClock)(nil).CurrentLayer))
return &layerClockCurrentLayerCall{Call: call}
}
// layerClockCurrentLayerCall wrap *gomock.Call
type layerClockCurrentLayerCall struct {
*gomock.Call
}
// Return rewrite *gomock.Call.Return
func (c *layerClockCurrentLayerCall) Return(arg0 types.LayerID) *layerClockCurrentLayerCall {
c.Call = c.Call.Return(arg0)
return c
}
// Do rewrite *gomock.Call.Do
func (c *layerClockCurrentLayerCall) Do(f func() types.LayerID) *layerClockCurrentLayerCall {
c.Call = c.Call.Do(f)
return c
}
// DoAndReturn rewrite *gomock.Call.DoAndReturn
func (c *layerClockCurrentLayerCall) DoAndReturn(f func() types.LayerID) *layerClockCurrentLayerCall {
c.Call = c.Call.DoAndReturn(f)
return c
}