-
Notifications
You must be signed in to change notification settings - Fork 175
/
consumer.go
118 lines (91 loc) · 3.68 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
// Code generated by mockery v2.12.1. DO NOT EDIT.
package mocks
import (
flow "github.com/onflow/flow-go/model/flow"
mock "github.com/stretchr/testify/mock"
model "github.com/onflow/flow-go/consensus/hotstuff/model"
testing "testing"
)
// 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)
}
// OnDoubleProposeDetected provides a mock function with given fields: _a0, _a1
func (_m *Consumer) OnDoubleProposeDetected(_a0 *model.Block, _a1 *model.Block) {
_m.Called(_a0, _a1)
}
// OnDoubleVotingDetected provides a mock function with given fields: _a0, _a1
func (_m *Consumer) OnDoubleVotingDetected(_a0 *model.Vote, _a1 *model.Vote) {
_m.Called(_a0, _a1)
}
// OnEnteringView provides a mock function with given fields: viewNumber, leader
func (_m *Consumer) OnEnteringView(viewNumber uint64, leader flow.Identifier) {
_m.Called(viewNumber, leader)
}
// 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)
}
// OnForkChoiceGenerated provides a mock function with given fields: _a0, _a1
func (_m *Consumer) OnForkChoiceGenerated(_a0 uint64, _a1 *flow.QuorumCertificate) {
_m.Called(_a0, _a1)
}
// OnInvalidVoteDetected provides a mock function with given fields: _a0
func (_m *Consumer) OnInvalidVoteDetected(_a0 *model.Vote) {
_m.Called(_a0)
}
// OnProposingBlock provides a mock function with given fields: proposal
func (_m *Consumer) OnProposingBlock(proposal *model.Proposal) {
_m.Called(proposal)
}
// OnQcConstructedFromVotes provides a mock function with given fields: curView, qc
func (_m *Consumer) OnQcConstructedFromVotes(curView uint64, qc *flow.QuorumCertificate) {
_m.Called(curView, qc)
}
// OnQcIncorporated provides a mock function with given fields: _a0
func (_m *Consumer) OnQcIncorporated(_a0 *flow.QuorumCertificate) {
_m.Called(_a0)
}
// OnQcTriggeredViewChange provides a mock function with given fields: qc, newView
func (_m *Consumer) OnQcTriggeredViewChange(qc *flow.QuorumCertificate, newView uint64) {
_m.Called(qc, newView)
}
// OnReachedTimeout provides a mock function with given fields: timeout
func (_m *Consumer) OnReachedTimeout(timeout *model.TimerInfo) {
_m.Called(timeout)
}
// OnReceiveProposal provides a mock function with given fields: currentView, proposal
func (_m *Consumer) OnReceiveProposal(currentView uint64, proposal *model.Proposal) {
_m.Called(currentView, proposal)
}
// OnReceiveVote provides a mock function with given fields: currentView, vote
func (_m *Consumer) OnReceiveVote(currentView uint64, vote *model.Vote) {
_m.Called(currentView, vote)
}
// OnStartingTimeout provides a mock function with given fields: _a0
func (_m *Consumer) OnStartingTimeout(_a0 *model.TimerInfo) {
_m.Called(_a0)
}
// OnVoteForInvalidBlockDetected provides a mock function with given fields: vote, invalidProposal
func (_m *Consumer) OnVoteForInvalidBlockDetected(vote *model.Vote, invalidProposal *model.Proposal) {
_m.Called(vote, invalidProposal)
}
// OnVoting provides a mock function with given fields: vote
func (_m *Consumer) OnVoting(vote *model.Vote) {
_m.Called(vote)
}
// NewConsumer creates a new instance of Consumer. It also registers the testing.TB interface on the mock and a cleanup function to assert the mocks expectations.
func NewConsumer(t testing.TB) *Consumer {
mock := &Consumer{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}