/
world.go
521 lines (445 loc) · 16.9 KB
/
world.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
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/Ecosystem-Knowledge/go-ecoterium/gossip/emitter (interfaces: External,TxPool,TxSigner,Signer)
// Package mock is a generated GoMock package.
package mock
import (
evmcore "github.com/Ecosystem-Knowledge/go-ecoterium/evmcore"
inter "github.com/Ecosystem-Knowledge/go-ecoterium/inter"
validatorpk "github.com/Ecosystem-Knowledge/go-ecoterium/inter/validatorpk"
opera "github.com/Ecosystem-Knowledge/go-ecoterium/opera"
vecmt "github.com/Ecosystem-Knowledge/go-ecoterium/vecmt"
hash "github.com/Fantom-foundation/lachesis-base/hash"
idx "github.com/Fantom-foundation/lachesis-base/inter/idx"
pos "github.com/Fantom-foundation/lachesis-base/inter/pos"
common "github.com/ethereum/go-ethereum/common"
types "github.com/ethereum/go-ethereum/core/types"
event "github.com/ethereum/go-ethereum/event"
gomock "github.com/golang/mock/gomock"
big "math/big"
reflect "reflect"
)
// MockExternal is a mock of External interface
type MockExternal struct {
ctrl *gomock.Controller
recorder *MockExternalMockRecorder
}
// MockExternalMockRecorder is the mock recorder for MockExternal
type MockExternalMockRecorder struct {
mock *MockExternal
}
// NewMockExternal creates a new mock instance
func NewMockExternal(ctrl *gomock.Controller) *MockExternal {
mock := &MockExternal{ctrl: ctrl}
mock.recorder = &MockExternalMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use
func (m *MockExternal) EXPECT() *MockExternalMockRecorder {
return m.recorder
}
// Broadcast mocks base method
func (m *MockExternal) Broadcast(arg0 *inter.EventPayload) {
m.ctrl.T.Helper()
m.ctrl.Call(m, "Broadcast", arg0)
}
// Broadcast indicates an expected call of Broadcast
func (mr *MockExternalMockRecorder) Broadcast(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Broadcast", reflect.TypeOf((*MockExternal)(nil).Broadcast), arg0)
}
// Build mocks base method
func (m *MockExternal) Build(arg0 *inter.MutableEventPayload, arg1 func()) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Build", arg0, arg1)
ret0, _ := ret[0].(error)
return ret0
}
// Build indicates an expected call of Build
func (mr *MockExternalMockRecorder) Build(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Build", reflect.TypeOf((*MockExternal)(nil).Build), arg0, arg1)
}
// Check mocks base method
func (m *MockExternal) Check(arg0 *inter.EventPayload, arg1 inter.Events) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Check", arg0, arg1)
ret0, _ := ret[0].(error)
return ret0
}
// Check indicates an expected call of Check
func (mr *MockExternalMockRecorder) Check(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Check", reflect.TypeOf((*MockExternal)(nil).Check), arg0, arg1)
}
// DagIndex mocks base method
func (m *MockExternal) DagIndex() *vecmt.Index {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "DagIndex")
ret0, _ := ret[0].(*vecmt.Index)
return ret0
}
// DagIndex indicates an expected call of DagIndex
func (mr *MockExternalMockRecorder) DagIndex() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DagIndex", reflect.TypeOf((*MockExternal)(nil).DagIndex))
}
// GetEpochValidators mocks base method
func (m *MockExternal) GetEpochValidators() (*pos.Validators, idx.Epoch) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetEpochValidators")
ret0, _ := ret[0].(*pos.Validators)
ret1, _ := ret[1].(idx.Epoch)
return ret0, ret1
}
// GetEpochValidators indicates an expected call of GetEpochValidators
func (mr *MockExternalMockRecorder) GetEpochValidators() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetEpochValidators", reflect.TypeOf((*MockExternal)(nil).GetEpochValidators))
}
// GetEvent mocks base method
func (m *MockExternal) GetEvent(arg0 hash.Event) *inter.Event {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetEvent", arg0)
ret0, _ := ret[0].(*inter.Event)
return ret0
}
// GetEvent indicates an expected call of GetEvent
func (mr *MockExternalMockRecorder) GetEvent(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetEvent", reflect.TypeOf((*MockExternal)(nil).GetEvent), arg0)
}
// GetEventPayload mocks base method
func (m *MockExternal) GetEventPayload(arg0 hash.Event) *inter.EventPayload {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetEventPayload", arg0)
ret0, _ := ret[0].(*inter.EventPayload)
return ret0
}
// GetEventPayload indicates an expected call of GetEventPayload
func (mr *MockExternalMockRecorder) GetEventPayload(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetEventPayload", reflect.TypeOf((*MockExternal)(nil).GetEventPayload), arg0)
}
// GetGenesisTime mocks base method
func (m *MockExternal) GetGenesisTime() inter.Timestamp {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetGenesisTime")
ret0, _ := ret[0].(inter.Timestamp)
return ret0
}
// GetGenesisTime indicates an expected call of GetGenesisTime
func (mr *MockExternalMockRecorder) GetGenesisTime() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetGenesisTime", reflect.TypeOf((*MockExternal)(nil).GetGenesisTime))
}
// GetHeads mocks base method
func (m *MockExternal) GetHeads(arg0 idx.Epoch) hash.Events {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetHeads", arg0)
ret0, _ := ret[0].(hash.Events)
return ret0
}
// GetHeads indicates an expected call of GetHeads
func (mr *MockExternalMockRecorder) GetHeads(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetHeads", reflect.TypeOf((*MockExternal)(nil).GetHeads), arg0)
}
// GetLastEvent mocks base method
func (m *MockExternal) GetLastEvent(arg0 idx.Epoch, arg1 idx.ValidatorID) *hash.Event {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetLastEvent", arg0, arg1)
ret0, _ := ret[0].(*hash.Event)
return ret0
}
// GetLastEvent indicates an expected call of GetLastEvent
func (mr *MockExternalMockRecorder) GetLastEvent(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetLastEvent", reflect.TypeOf((*MockExternal)(nil).GetLastEvent), arg0, arg1)
}
// GetLatestBlockIndex mocks base method
func (m *MockExternal) GetLatestBlockIndex() idx.Block {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetLatestBlockIndex")
ret0, _ := ret[0].(idx.Block)
return ret0
}
// GetLatestBlockIndex indicates an expected call of GetLatestBlockIndex
func (mr *MockExternalMockRecorder) GetLatestBlockIndex() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetLatestBlockIndex", reflect.TypeOf((*MockExternal)(nil).GetLatestBlockIndex))
}
// GetRecommendedGasPrice mocks base method
func (m *MockExternal) GetRecommendedGasPrice() *big.Int {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetRecommendedGasPrice")
ret0, _ := ret[0].(*big.Int)
return ret0
}
// GetRecommendedGasPrice indicates an expected call of GetRecommendedGasPrice
func (mr *MockExternalMockRecorder) GetRecommendedGasPrice() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRecommendedGasPrice", reflect.TypeOf((*MockExternal)(nil).GetRecommendedGasPrice))
}
// GetRules mocks base method
func (m *MockExternal) GetRules() opera.Rules {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetRules")
ret0, _ := ret[0].(opera.Rules)
return ret0
}
// GetRules indicates an expected call of GetRules
func (mr *MockExternalMockRecorder) GetRules() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRules", reflect.TypeOf((*MockExternal)(nil).GetRules))
}
// IsBusy mocks base method
func (m *MockExternal) IsBusy() bool {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "IsBusy")
ret0, _ := ret[0].(bool)
return ret0
}
// IsBusy indicates an expected call of IsBusy
func (mr *MockExternalMockRecorder) IsBusy() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsBusy", reflect.TypeOf((*MockExternal)(nil).IsBusy))
}
// IsSynced mocks base method
func (m *MockExternal) IsSynced() bool {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "IsSynced")
ret0, _ := ret[0].(bool)
return ret0
}
// IsSynced indicates an expected call of IsSynced
func (mr *MockExternalMockRecorder) IsSynced() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsSynced", reflect.TypeOf((*MockExternal)(nil).IsSynced))
}
// Lock mocks base method
func (m *MockExternal) Lock() {
m.ctrl.T.Helper()
m.ctrl.Call(m, "Lock")
}
// Lock indicates an expected call of Lock
func (mr *MockExternalMockRecorder) Lock() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Lock", reflect.TypeOf((*MockExternal)(nil).Lock))
}
// PeersNum mocks base method
func (m *MockExternal) PeersNum() int {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "PeersNum")
ret0, _ := ret[0].(int)
return ret0
}
// PeersNum indicates an expected call of PeersNum
func (mr *MockExternalMockRecorder) PeersNum() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PeersNum", reflect.TypeOf((*MockExternal)(nil).PeersNum))
}
// Process mocks base method
func (m *MockExternal) Process(arg0 *inter.EventPayload) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Process", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// Process indicates an expected call of Process
func (mr *MockExternalMockRecorder) Process(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Process", reflect.TypeOf((*MockExternal)(nil).Process), arg0)
}
// Unlock mocks base method
func (m *MockExternal) Unlock() {
m.ctrl.T.Helper()
m.ctrl.Call(m, "Unlock")
}
// Unlock indicates an expected call of Unlock
func (mr *MockExternalMockRecorder) Unlock() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Unlock", reflect.TypeOf((*MockExternal)(nil).Unlock))
}
// MockTxPool is a mock of TxPool interface
type MockTxPool struct {
ctrl *gomock.Controller
recorder *MockTxPoolMockRecorder
}
// MockTxPoolMockRecorder is the mock recorder for MockTxPool
type MockTxPoolMockRecorder struct {
mock *MockTxPool
}
// NewMockTxPool creates a new mock instance
func NewMockTxPool(ctrl *gomock.Controller) *MockTxPool {
mock := &MockTxPool{ctrl: ctrl}
mock.recorder = &MockTxPoolMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use
func (m *MockTxPool) EXPECT() *MockTxPoolMockRecorder {
return m.recorder
}
// Count mocks base method
func (m *MockTxPool) Count() int {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Count")
ret0, _ := ret[0].(int)
return ret0
}
// Count indicates an expected call of Count
func (mr *MockTxPoolMockRecorder) Count() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Count", reflect.TypeOf((*MockTxPool)(nil).Count))
}
// Has mocks base method
func (m *MockTxPool) Has(arg0 common.Hash) bool {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Has", arg0)
ret0, _ := ret[0].(bool)
return ret0
}
// Has indicates an expected call of Has
func (mr *MockTxPoolMockRecorder) Has(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Has", reflect.TypeOf((*MockTxPool)(nil).Has), arg0)
}
// Pending mocks base method
func (m *MockTxPool) Pending() (map[common.Address]types.Transactions, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Pending")
ret0, _ := ret[0].(map[common.Address]types.Transactions)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Pending indicates an expected call of Pending
func (mr *MockTxPoolMockRecorder) Pending() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Pending", reflect.TypeOf((*MockTxPool)(nil).Pending))
}
// SubscribeNewTxsNotify mocks base method
func (m *MockTxPool) SubscribeNewTxsNotify(arg0 chan<- evmcore.NewTxsNotify) event.Subscription {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SubscribeNewTxsNotify", arg0)
ret0, _ := ret[0].(event.Subscription)
return ret0
}
// SubscribeNewTxsNotify indicates an expected call of SubscribeNewTxsNotify
func (mr *MockTxPoolMockRecorder) SubscribeNewTxsNotify(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SubscribeNewTxsNotify", reflect.TypeOf((*MockTxPool)(nil).SubscribeNewTxsNotify), arg0)
}
// MockTxSigner is a mock of TxSigner interface
type MockTxSigner struct {
ctrl *gomock.Controller
recorder *MockTxSignerMockRecorder
}
// MockTxSignerMockRecorder is the mock recorder for MockTxSigner
type MockTxSignerMockRecorder struct {
mock *MockTxSigner
}
// NewMockTxSigner creates a new mock instance
func NewMockTxSigner(ctrl *gomock.Controller) *MockTxSigner {
mock := &MockTxSigner{ctrl: ctrl}
mock.recorder = &MockTxSignerMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use
func (m *MockTxSigner) EXPECT() *MockTxSignerMockRecorder {
return m.recorder
}
// ChainID mocks base method
func (m *MockTxSigner) ChainID() *big.Int {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ChainID")
ret0, _ := ret[0].(*big.Int)
return ret0
}
// ChainID indicates an expected call of ChainID
func (mr *MockTxSignerMockRecorder) ChainID() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainID", reflect.TypeOf((*MockTxSigner)(nil).ChainID))
}
// Equal mocks base method
func (m *MockTxSigner) Equal(arg0 types.Signer) bool {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Equal", arg0)
ret0, _ := ret[0].(bool)
return ret0
}
// Equal indicates an expected call of Equal
func (mr *MockTxSignerMockRecorder) Equal(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Equal", reflect.TypeOf((*MockTxSigner)(nil).Equal), arg0)
}
// Hash mocks base method
func (m *MockTxSigner) Hash(arg0 *types.Transaction) common.Hash {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Hash", arg0)
ret0, _ := ret[0].(common.Hash)
return ret0
}
// Hash indicates an expected call of Hash
func (mr *MockTxSignerMockRecorder) Hash(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Hash", reflect.TypeOf((*MockTxSigner)(nil).Hash), arg0)
}
// Sender mocks base method
func (m *MockTxSigner) Sender(arg0 *types.Transaction) (common.Address, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Sender", arg0)
ret0, _ := ret[0].(common.Address)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Sender indicates an expected call of Sender
func (mr *MockTxSignerMockRecorder) Sender(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Sender", reflect.TypeOf((*MockTxSigner)(nil).Sender), arg0)
}
// SignatureValues mocks base method
func (m *MockTxSigner) SignatureValues(arg0 *types.Transaction, arg1 []byte) (*big.Int, *big.Int, *big.Int, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SignatureValues", arg0, arg1)
ret0, _ := ret[0].(*big.Int)
ret1, _ := ret[1].(*big.Int)
ret2, _ := ret[2].(*big.Int)
ret3, _ := ret[3].(error)
return ret0, ret1, ret2, ret3
}
// SignatureValues indicates an expected call of SignatureValues
func (mr *MockTxSignerMockRecorder) SignatureValues(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SignatureValues", reflect.TypeOf((*MockTxSigner)(nil).SignatureValues), arg0, arg1)
}
// MockSigner is a mock of Signer interface
type MockSigner struct {
ctrl *gomock.Controller
recorder *MockSignerMockRecorder
}
// MockSignerMockRecorder is the mock recorder for MockSigner
type MockSignerMockRecorder struct {
mock *MockSigner
}
// NewMockSigner creates a new mock instance
func NewMockSigner(ctrl *gomock.Controller) *MockSigner {
mock := &MockSigner{ctrl: ctrl}
mock.recorder = &MockSignerMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use
func (m *MockSigner) EXPECT() *MockSignerMockRecorder {
return m.recorder
}
// Sign mocks base method
func (m *MockSigner) Sign(arg0 validatorpk.PubKey, arg1 []byte) ([]byte, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Sign", arg0, arg1)
ret0, _ := ret[0].([]byte)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Sign indicates an expected call of Sign
func (mr *MockSignerMockRecorder) Sign(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Sign", reflect.TypeOf((*MockSigner)(nil).Sign), arg0, arg1)
}