-
Notifications
You must be signed in to change notification settings - Fork 175
/
noop_consumer.go
54 lines (32 loc) · 1.6 KB
/
noop_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
package notifications
import (
"github.com/onflow/flow-go/consensus/hotstuff"
"github.com/onflow/flow-go/consensus/hotstuff/model"
"github.com/onflow/flow-go/model/flow"
)
// NoopConsumer is an implementation of the notifications consumer that
// doesn't do anything.
type NoopConsumer struct{}
var _ hotstuff.Consumer = (*NoopConsumer)(nil)
func NewNoopConsumer() *NoopConsumer {
nc := &NoopConsumer{}
return nc
}
func (*NoopConsumer) OnEventProcessed() {}
func (*NoopConsumer) OnBlockIncorporated(*model.Block) {}
func (*NoopConsumer) OnFinalizedBlock(*model.Block) {}
func (*NoopConsumer) OnDoubleProposeDetected(*model.Block, *model.Block) {}
func (c *NoopConsumer) OnReceiveVote(uint64, *model.Vote) {}
func (c *NoopConsumer) OnReceiveProposal(uint64, *model.Proposal) {}
func (*NoopConsumer) OnEnteringView(uint64, flow.Identifier) {}
func (c *NoopConsumer) OnQcTriggeredViewChange(*flow.QuorumCertificate, uint64) {}
func (c *NoopConsumer) OnProposingBlock(*model.Proposal) {}
func (c *NoopConsumer) OnVoting(*model.Vote) {}
func (c *NoopConsumer) OnQcConstructedFromVotes(curView uint64, qc *flow.QuorumCertificate) {}
func (*NoopConsumer) OnStartingTimeout(*model.TimerInfo) {}
func (*NoopConsumer) OnReachedTimeout(*model.TimerInfo) {}
func (*NoopConsumer) OnQcIncorporated(*flow.QuorumCertificate) {}
func (*NoopConsumer) OnForkChoiceGenerated(uint64, *flow.QuorumCertificate) {}
func (*NoopConsumer) OnDoubleVotingDetected(*model.Vote, *model.Vote) {}
func (*NoopConsumer) OnInvalidVoteDetected(*model.Vote) {}
func (*NoopConsumer) OnVoteForInvalidBlockDetected(*model.Vote, *model.Proposal) {}