-
Notifications
You must be signed in to change notification settings - Fork 661
/
mock_chain_vm.go
364 lines (313 loc) · 13.8 KB
/
mock_chain_vm.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
// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/ava-labs/avalanchego/snow/engine/snowman/block (interfaces: ChainVM)
//
// Generated by this command:
//
// mockgen -package=block -destination=snow/engine/snowman/block/mock_chain_vm.go github.com/ava-labs/avalanchego/snow/engine/snowman/block ChainVM
//
// Package block is a generated GoMock package.
package block
import (
context "context"
http "net/http"
reflect "reflect"
time "time"
database "github.com/ava-labs/avalanchego/database"
ids "github.com/ava-labs/avalanchego/ids"
snow "github.com/ava-labs/avalanchego/snow"
snowman "github.com/ava-labs/avalanchego/snow/consensus/snowman"
common "github.com/ava-labs/avalanchego/snow/engine/common"
version "github.com/ava-labs/avalanchego/version"
gomock "go.uber.org/mock/gomock"
)
// MockChainVM is a mock of ChainVM interface.
type MockChainVM struct {
ctrl *gomock.Controller
recorder *MockChainVMMockRecorder
}
// MockChainVMMockRecorder is the mock recorder for MockChainVM.
type MockChainVMMockRecorder struct {
mock *MockChainVM
}
// NewMockChainVM creates a new mock instance.
func NewMockChainVM(ctrl *gomock.Controller) *MockChainVM {
mock := &MockChainVM{ctrl: ctrl}
mock.recorder = &MockChainVMMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockChainVM) EXPECT() *MockChainVMMockRecorder {
return m.recorder
}
// AppGossip mocks base method.
func (m *MockChainVM) AppGossip(arg0 context.Context, arg1 ids.NodeID, arg2 []byte) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "AppGossip", arg0, arg1, arg2)
ret0, _ := ret[0].(error)
return ret0
}
// AppGossip indicates an expected call of AppGossip.
func (mr *MockChainVMMockRecorder) AppGossip(arg0, arg1, arg2 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AppGossip", reflect.TypeOf((*MockChainVM)(nil).AppGossip), arg0, arg1, arg2)
}
// AppRequest mocks base method.
func (m *MockChainVM) AppRequest(arg0 context.Context, arg1 ids.NodeID, arg2 uint32, arg3 time.Time, arg4 []byte) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "AppRequest", arg0, arg1, arg2, arg3, arg4)
ret0, _ := ret[0].(error)
return ret0
}
// AppRequest indicates an expected call of AppRequest.
func (mr *MockChainVMMockRecorder) AppRequest(arg0, arg1, arg2, arg3, arg4 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AppRequest", reflect.TypeOf((*MockChainVM)(nil).AppRequest), arg0, arg1, arg2, arg3, arg4)
}
// AppRequestFailed mocks base method.
func (m *MockChainVM) AppRequestFailed(arg0 context.Context, arg1 ids.NodeID, arg2 uint32, arg3 *common.AppError) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "AppRequestFailed", arg0, arg1, arg2, arg3)
ret0, _ := ret[0].(error)
return ret0
}
// AppRequestFailed indicates an expected call of AppRequestFailed.
func (mr *MockChainVMMockRecorder) AppRequestFailed(arg0, arg1, arg2, arg3 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AppRequestFailed", reflect.TypeOf((*MockChainVM)(nil).AppRequestFailed), arg0, arg1, arg2, arg3)
}
// AppResponse mocks base method.
func (m *MockChainVM) AppResponse(arg0 context.Context, arg1 ids.NodeID, arg2 uint32, arg3 []byte) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "AppResponse", arg0, arg1, arg2, arg3)
ret0, _ := ret[0].(error)
return ret0
}
// AppResponse indicates an expected call of AppResponse.
func (mr *MockChainVMMockRecorder) AppResponse(arg0, arg1, arg2, arg3 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AppResponse", reflect.TypeOf((*MockChainVM)(nil).AppResponse), arg0, arg1, arg2, arg3)
}
// BuildBlock mocks base method.
func (m *MockChainVM) BuildBlock(arg0 context.Context) (snowman.Block, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "BuildBlock", arg0)
ret0, _ := ret[0].(snowman.Block)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// BuildBlock indicates an expected call of BuildBlock.
func (mr *MockChainVMMockRecorder) BuildBlock(arg0 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BuildBlock", reflect.TypeOf((*MockChainVM)(nil).BuildBlock), arg0)
}
// Connected mocks base method.
func (m *MockChainVM) Connected(arg0 context.Context, arg1 ids.NodeID, arg2 *version.Application) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Connected", arg0, arg1, arg2)
ret0, _ := ret[0].(error)
return ret0
}
// Connected indicates an expected call of Connected.
func (mr *MockChainVMMockRecorder) Connected(arg0, arg1, arg2 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Connected", reflect.TypeOf((*MockChainVM)(nil).Connected), arg0, arg1, arg2)
}
// CreateHandlers mocks base method.
func (m *MockChainVM) CreateHandlers(arg0 context.Context) (map[string]http.Handler, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "CreateHandlers", arg0)
ret0, _ := ret[0].(map[string]http.Handler)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// CreateHandlers indicates an expected call of CreateHandlers.
func (mr *MockChainVMMockRecorder) CreateHandlers(arg0 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateHandlers", reflect.TypeOf((*MockChainVM)(nil).CreateHandlers), arg0)
}
// CrossChainAppRequest mocks base method.
func (m *MockChainVM) CrossChainAppRequest(arg0 context.Context, arg1 ids.ID, arg2 uint32, arg3 time.Time, arg4 []byte) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "CrossChainAppRequest", arg0, arg1, arg2, arg3, arg4)
ret0, _ := ret[0].(error)
return ret0
}
// CrossChainAppRequest indicates an expected call of CrossChainAppRequest.
func (mr *MockChainVMMockRecorder) CrossChainAppRequest(arg0, arg1, arg2, arg3, arg4 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CrossChainAppRequest", reflect.TypeOf((*MockChainVM)(nil).CrossChainAppRequest), arg0, arg1, arg2, arg3, arg4)
}
// CrossChainAppRequestFailed mocks base method.
func (m *MockChainVM) CrossChainAppRequestFailed(arg0 context.Context, arg1 ids.ID, arg2 uint32, arg3 *common.AppError) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "CrossChainAppRequestFailed", arg0, arg1, arg2, arg3)
ret0, _ := ret[0].(error)
return ret0
}
// CrossChainAppRequestFailed indicates an expected call of CrossChainAppRequestFailed.
func (mr *MockChainVMMockRecorder) CrossChainAppRequestFailed(arg0, arg1, arg2, arg3 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CrossChainAppRequestFailed", reflect.TypeOf((*MockChainVM)(nil).CrossChainAppRequestFailed), arg0, arg1, arg2, arg3)
}
// CrossChainAppResponse mocks base method.
func (m *MockChainVM) CrossChainAppResponse(arg0 context.Context, arg1 ids.ID, arg2 uint32, arg3 []byte) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "CrossChainAppResponse", arg0, arg1, arg2, arg3)
ret0, _ := ret[0].(error)
return ret0
}
// CrossChainAppResponse indicates an expected call of CrossChainAppResponse.
func (mr *MockChainVMMockRecorder) CrossChainAppResponse(arg0, arg1, arg2, arg3 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CrossChainAppResponse", reflect.TypeOf((*MockChainVM)(nil).CrossChainAppResponse), arg0, arg1, arg2, arg3)
}
// Disconnected mocks base method.
func (m *MockChainVM) Disconnected(arg0 context.Context, arg1 ids.NodeID) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Disconnected", arg0, arg1)
ret0, _ := ret[0].(error)
return ret0
}
// Disconnected indicates an expected call of Disconnected.
func (mr *MockChainVMMockRecorder) Disconnected(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Disconnected", reflect.TypeOf((*MockChainVM)(nil).Disconnected), arg0, arg1)
}
// GetBlock mocks base method.
func (m *MockChainVM) GetBlock(arg0 context.Context, arg1 ids.ID) (snowman.Block, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetBlock", arg0, arg1)
ret0, _ := ret[0].(snowman.Block)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetBlock indicates an expected call of GetBlock.
func (mr *MockChainVMMockRecorder) GetBlock(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBlock", reflect.TypeOf((*MockChainVM)(nil).GetBlock), arg0, arg1)
}
// GetBlockIDAtHeight mocks base method.
func (m *MockChainVM) GetBlockIDAtHeight(arg0 context.Context, arg1 uint64) (ids.ID, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetBlockIDAtHeight", arg0, arg1)
ret0, _ := ret[0].(ids.ID)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetBlockIDAtHeight indicates an expected call of GetBlockIDAtHeight.
func (mr *MockChainVMMockRecorder) GetBlockIDAtHeight(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBlockIDAtHeight", reflect.TypeOf((*MockChainVM)(nil).GetBlockIDAtHeight), arg0, arg1)
}
// HealthCheck mocks base method.
func (m *MockChainVM) HealthCheck(arg0 context.Context) (any, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "HealthCheck", arg0)
ret0, _ := ret[0].(any)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// HealthCheck indicates an expected call of HealthCheck.
func (mr *MockChainVMMockRecorder) HealthCheck(arg0 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HealthCheck", reflect.TypeOf((*MockChainVM)(nil).HealthCheck), arg0)
}
// Initialize mocks base method.
func (m *MockChainVM) Initialize(arg0 context.Context, arg1 *snow.Context, arg2 database.Database, arg3, arg4, arg5 []byte, arg6 chan<- common.Message, arg7 []*common.Fx, arg8 common.AppSender) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Initialize", arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)
ret0, _ := ret[0].(error)
return ret0
}
// Initialize indicates an expected call of Initialize.
func (mr *MockChainVMMockRecorder) Initialize(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Initialize", reflect.TypeOf((*MockChainVM)(nil).Initialize), arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)
}
// LastAccepted mocks base method.
func (m *MockChainVM) LastAccepted(arg0 context.Context) (ids.ID, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "LastAccepted", arg0)
ret0, _ := ret[0].(ids.ID)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// LastAccepted indicates an expected call of LastAccepted.
func (mr *MockChainVMMockRecorder) LastAccepted(arg0 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LastAccepted", reflect.TypeOf((*MockChainVM)(nil).LastAccepted), arg0)
}
// ParseBlock mocks base method.
func (m *MockChainVM) ParseBlock(arg0 context.Context, arg1 []byte) (snowman.Block, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ParseBlock", arg0, arg1)
ret0, _ := ret[0].(snowman.Block)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// ParseBlock indicates an expected call of ParseBlock.
func (mr *MockChainVMMockRecorder) ParseBlock(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ParseBlock", reflect.TypeOf((*MockChainVM)(nil).ParseBlock), arg0, arg1)
}
// SetPreference mocks base method.
func (m *MockChainVM) SetPreference(arg0 context.Context, arg1 ids.ID) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SetPreference", arg0, arg1)
ret0, _ := ret[0].(error)
return ret0
}
// SetPreference indicates an expected call of SetPreference.
func (mr *MockChainVMMockRecorder) SetPreference(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetPreference", reflect.TypeOf((*MockChainVM)(nil).SetPreference), arg0, arg1)
}
// SetState mocks base method.
func (m *MockChainVM) SetState(arg0 context.Context, arg1 snow.State) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SetState", arg0, arg1)
ret0, _ := ret[0].(error)
return ret0
}
// SetState indicates an expected call of SetState.
func (mr *MockChainVMMockRecorder) SetState(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetState", reflect.TypeOf((*MockChainVM)(nil).SetState), arg0, arg1)
}
// Shutdown mocks base method.
func (m *MockChainVM) Shutdown(arg0 context.Context) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Shutdown", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// Shutdown indicates an expected call of Shutdown.
func (mr *MockChainVMMockRecorder) Shutdown(arg0 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Shutdown", reflect.TypeOf((*MockChainVM)(nil).Shutdown), arg0)
}
// VerifyHeightIndex mocks base method.
func (m *MockChainVM) VerifyHeightIndex(arg0 context.Context) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "VerifyHeightIndex", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// VerifyHeightIndex indicates an expected call of VerifyHeightIndex.
func (mr *MockChainVMMockRecorder) VerifyHeightIndex(arg0 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "VerifyHeightIndex", reflect.TypeOf((*MockChainVM)(nil).VerifyHeightIndex), arg0)
}
// Version mocks base method.
func (m *MockChainVM) Version(arg0 context.Context) (string, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Version", arg0)
ret0, _ := ret[0].(string)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Version indicates an expected call of Version.
func (mr *MockChainVMMockRecorder) Version(arg0 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Version", reflect.TypeOf((*MockChainVM)(nil).Version), arg0)
}