-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
bhs.go
130 lines (101 loc) · 2.98 KB
/
bhs.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
// Code generated by mockery v2.38.0. DO NOT EDIT.
package mocks
import (
context "context"
common "github.com/ethereum/go-ethereum/common"
mock "github.com/stretchr/testify/mock"
)
// BHS is an autogenerated mock type for the BHS type
type BHS struct {
mock.Mock
}
// IsStored provides a mock function with given fields: ctx, blockNum
func (_m *BHS) IsStored(ctx context.Context, blockNum uint64) (bool, error) {
ret := _m.Called(ctx, blockNum)
if len(ret) == 0 {
panic("no return value specified for IsStored")
}
var r0 bool
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, uint64) (bool, error)); ok {
return rf(ctx, blockNum)
}
if rf, ok := ret.Get(0).(func(context.Context, uint64) bool); ok {
r0 = rf(ctx, blockNum)
} else {
r0 = ret.Get(0).(bool)
}
if rf, ok := ret.Get(1).(func(context.Context, uint64) error); ok {
r1 = rf(ctx, blockNum)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// IsTrusted provides a mock function with given fields:
func (_m *BHS) IsTrusted() bool {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for IsTrusted")
}
var r0 bool
if rf, ok := ret.Get(0).(func() bool); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(bool)
}
return r0
}
// Store provides a mock function with given fields: ctx, blockNum
func (_m *BHS) Store(ctx context.Context, blockNum uint64) error {
ret := _m.Called(ctx, blockNum)
if len(ret) == 0 {
panic("no return value specified for Store")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, uint64) error); ok {
r0 = rf(ctx, blockNum)
} else {
r0 = ret.Error(0)
}
return r0
}
// StoreEarliest provides a mock function with given fields: ctx
func (_m *BHS) StoreEarliest(ctx context.Context) error {
ret := _m.Called(ctx)
if len(ret) == 0 {
panic("no return value specified for StoreEarliest")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context) error); ok {
r0 = rf(ctx)
} else {
r0 = ret.Error(0)
}
return r0
}
// StoreTrusted provides a mock function with given fields: ctx, blockNums, blockhashes, recentBlock, recentBlockhash
func (_m *BHS) StoreTrusted(ctx context.Context, blockNums []uint64, blockhashes []common.Hash, recentBlock uint64, recentBlockhash common.Hash) error {
ret := _m.Called(ctx, blockNums, blockhashes, recentBlock, recentBlockhash)
if len(ret) == 0 {
panic("no return value specified for StoreTrusted")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, []uint64, []common.Hash, uint64, common.Hash) error); ok {
r0 = rf(ctx, blockNums, blockhashes, recentBlock, recentBlockhash)
} else {
r0 = ret.Error(0)
}
return r0
}
// NewBHS creates a new instance of BHS. 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 NewBHS(t interface {
mock.TestingT
Cleanup(func())
}) *BHS {
mock := &BHS{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}