tendermint: github.com/tendermint/tendermint/behaviour Index | Files

package behaviour

import "github.com/tendermint/tendermint/behaviour"


Package Files

peer_behaviour.go reporter.go

type MockReporter Uses

type MockReporter struct {
    // contains filtered or unexported fields

MockReporter is a concrete implementation of the Reporter interface used in reactor tests to ensure reactors report the correct behaviour in manufactured scenarios.

func NewMockReporter Uses

func NewMockReporter() *MockReporter

NewMockReporter returns a Reporter which records all reported behaviours in memory.

func (*MockReporter) GetBehaviours Uses

func (mpbr *MockReporter) GetBehaviours(peerID p2p.ID) []PeerBehaviour

GetBehaviours returns all behaviours reported on the peer identified by peerID.

func (*MockReporter) Report Uses

func (mpbr *MockReporter) Report(behaviour PeerBehaviour) error

Report stores the PeerBehaviour produced by the peer identified by peerID.

type PeerBehaviour Uses

type PeerBehaviour struct {
    // contains filtered or unexported fields

PeerBehaviour is a struct describing a behaviour a peer performed. `peerID` identifies the peer and reason characterizes the specific behaviour performed by the peer.

func BadMessage Uses

func BadMessage(peerID p2p.ID, explanation string) PeerBehaviour

BadMessage returns a badMessage PeerBehaviour.

func BlockPart Uses

func BlockPart(peerID p2p.ID, explanation string) PeerBehaviour

BlockPart returns blockPart PeerBehaviour.

func ConsensusVote Uses

func ConsensusVote(peerID p2p.ID, explanation string) PeerBehaviour

ConsensusVote returns a consensusVote PeerBehaviour.

func MessageOutOfOrder Uses

func MessageOutOfOrder(peerID p2p.ID, explanation string) PeerBehaviour

MessageOutOfOrder returns a messagOutOfOrder PeerBehaviour.

type Reporter Uses

type Reporter interface {
    Report(behaviour PeerBehaviour) error

Reporter provides an interface for reactors to report the behaviour of peers synchronously to other components.

type SwitchReporter Uses

type SwitchReporter struct {
    // contains filtered or unexported fields

SwitchReporter reports peer behaviour to an internal Switch.

func NewSwitchReporter Uses

func NewSwitchReporter(sw *p2p.Switch) *SwitchReporter

NewSwitchReporter return a new SwitchReporter instance which wraps the Switch.

func (*SwitchReporter) Report Uses

func (spbr *SwitchReporter) Report(behaviour PeerBehaviour) error

Report reports the behaviour of a peer to the Switch.

Package behaviour imports 3 packages (graph) and is imported by 2 packages. Updated 2020-02-22. Refresh now. Tools for package owners.