-
Notifications
You must be signed in to change notification settings - Fork 175
/
sync_core.go
98 lines (77 loc) · 2.38 KB
/
sync_core.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
// Code generated by mockery v2.13.1. DO NOT EDIT.
package mock
import (
chainsync "github.com/onflow/flow-go/model/chainsync"
flow "github.com/onflow/flow-go/model/flow"
mock "github.com/stretchr/testify/mock"
)
// SyncCore is an autogenerated mock type for the SyncCore type
type SyncCore struct {
mock.Mock
}
// BatchRequested provides a mock function with given fields: batch
func (_m *SyncCore) BatchRequested(batch chainsync.Batch) {
_m.Called(batch)
}
// HandleBlock provides a mock function with given fields: header
func (_m *SyncCore) HandleBlock(header *flow.Header) bool {
ret := _m.Called(header)
var r0 bool
if rf, ok := ret.Get(0).(func(*flow.Header) bool); ok {
r0 = rf(header)
} else {
r0 = ret.Get(0).(bool)
}
return r0
}
// HandleHeight provides a mock function with given fields: final, height
func (_m *SyncCore) HandleHeight(final *flow.Header, height uint64) {
_m.Called(final, height)
}
// RangeRequested provides a mock function with given fields: ran
func (_m *SyncCore) RangeRequested(ran chainsync.Range) {
_m.Called(ran)
}
// ScanPending provides a mock function with given fields: final
func (_m *SyncCore) ScanPending(final *flow.Header) ([]chainsync.Range, []chainsync.Batch) {
ret := _m.Called(final)
var r0 []chainsync.Range
if rf, ok := ret.Get(0).(func(*flow.Header) []chainsync.Range); ok {
r0 = rf(final)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]chainsync.Range)
}
}
var r1 []chainsync.Batch
if rf, ok := ret.Get(1).(func(*flow.Header) []chainsync.Batch); ok {
r1 = rf(final)
} else {
if ret.Get(1) != nil {
r1 = ret.Get(1).([]chainsync.Batch)
}
}
return r0, r1
}
// WithinTolerance provides a mock function with given fields: final, height
func (_m *SyncCore) WithinTolerance(final *flow.Header, height uint64) bool {
ret := _m.Called(final, height)
var r0 bool
if rf, ok := ret.Get(0).(func(*flow.Header, uint64) bool); ok {
r0 = rf(final, height)
} else {
r0 = ret.Get(0).(bool)
}
return r0
}
type mockConstructorTestingTNewSyncCore interface {
mock.TestingT
Cleanup(func())
}
// NewSyncCore creates a new instance of SyncCore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewSyncCore(t mockConstructorTestingTNewSyncCore) *SyncCore {
mock := &SyncCore{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}