-
Notifications
You must be signed in to change notification settings - Fork 179
/
consumer.go
129 lines (100 loc) · 4.33 KB
/
consumer.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
// Code generated by mockery v2.21.4. DO NOT EDIT.
package mocks
import (
hotstuff "github.com/onflow/flow-go/consensus/hotstuff"
flow "github.com/onflow/flow-go/model/flow"
mock "github.com/stretchr/testify/mock"
model "github.com/onflow/flow-go/consensus/hotstuff/model"
time "time"
)
// Consumer is an autogenerated mock type for the Consumer type
type Consumer struct {
mock.Mock
}
// OnBlockIncorporated provides a mock function with given fields: _a0
func (_m *Consumer) OnBlockIncorporated(_a0 *model.Block) {
_m.Called(_a0)
}
// OnCurrentViewDetails provides a mock function with given fields: currentView, finalizedView, currentLeader
func (_m *Consumer) OnCurrentViewDetails(currentView uint64, finalizedView uint64, currentLeader flow.Identifier) {
_m.Called(currentView, finalizedView, currentLeader)
}
// OnDoubleProposeDetected provides a mock function with given fields: _a0, _a1
func (_m *Consumer) OnDoubleProposeDetected(_a0 *model.Block, _a1 *model.Block) {
_m.Called(_a0, _a1)
}
// OnEventProcessed provides a mock function with given fields:
func (_m *Consumer) OnEventProcessed() {
_m.Called()
}
// OnFinalizedBlock provides a mock function with given fields: _a0
func (_m *Consumer) OnFinalizedBlock(_a0 *model.Block) {
_m.Called(_a0)
}
// OnInvalidBlockDetected provides a mock function with given fields: err
func (_m *Consumer) OnInvalidBlockDetected(err flow.Slashable[model.InvalidProposalError]) {
_m.Called(err)
}
// OnLocalTimeout provides a mock function with given fields: currentView
func (_m *Consumer) OnLocalTimeout(currentView uint64) {
_m.Called(currentView)
}
// OnOwnProposal provides a mock function with given fields: proposal, targetPublicationTime
func (_m *Consumer) OnOwnProposal(proposal *flow.Header, targetPublicationTime time.Time) {
_m.Called(proposal, targetPublicationTime)
}
// OnOwnTimeout provides a mock function with given fields: timeout
func (_m *Consumer) OnOwnTimeout(timeout *model.TimeoutObject) {
_m.Called(timeout)
}
// OnOwnVote provides a mock function with given fields: blockID, view, sigData, recipientID
func (_m *Consumer) OnOwnVote(blockID flow.Identifier, view uint64, sigData []byte, recipientID flow.Identifier) {
_m.Called(blockID, view, sigData, recipientID)
}
// OnPartialTc provides a mock function with given fields: currentView, partialTc
func (_m *Consumer) OnPartialTc(currentView uint64, partialTc *hotstuff.PartialTcCreated) {
_m.Called(currentView, partialTc)
}
// OnQcTriggeredViewChange provides a mock function with given fields: oldView, newView, qc
func (_m *Consumer) OnQcTriggeredViewChange(oldView uint64, newView uint64, qc *flow.QuorumCertificate) {
_m.Called(oldView, newView, qc)
}
// OnReceiveProposal provides a mock function with given fields: currentView, proposal
func (_m *Consumer) OnReceiveProposal(currentView uint64, proposal *model.Proposal) {
_m.Called(currentView, proposal)
}
// OnReceiveQc provides a mock function with given fields: currentView, qc
func (_m *Consumer) OnReceiveQc(currentView uint64, qc *flow.QuorumCertificate) {
_m.Called(currentView, qc)
}
// OnReceiveTc provides a mock function with given fields: currentView, tc
func (_m *Consumer) OnReceiveTc(currentView uint64, tc *flow.TimeoutCertificate) {
_m.Called(currentView, tc)
}
// OnStart provides a mock function with given fields: currentView
func (_m *Consumer) OnStart(currentView uint64) {
_m.Called(currentView)
}
// OnStartingTimeout provides a mock function with given fields: _a0
func (_m *Consumer) OnStartingTimeout(_a0 model.TimerInfo) {
_m.Called(_a0)
}
// OnTcTriggeredViewChange provides a mock function with given fields: oldView, newView, tc
func (_m *Consumer) OnTcTriggeredViewChange(oldView uint64, newView uint64, tc *flow.TimeoutCertificate) {
_m.Called(oldView, newView, tc)
}
// OnViewChange provides a mock function with given fields: oldView, newView
func (_m *Consumer) OnViewChange(oldView uint64, newView uint64) {
_m.Called(oldView, newView)
}
type mockConstructorTestingTNewConsumer interface {
mock.TestingT
Cleanup(func())
}
// NewConsumer creates a new instance of Consumer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewConsumer(t mockConstructorTestingTNewConsumer) *Consumer {
mock := &Consumer{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}