Documentation ¶
Index ¶
- func MockingManager(ts *testsuite.TestSuite, valKeys []*bls.ValidatorKey) (Manager, []*MockConsensus)
- type ConcreteMediator
- type Config
- type Consensus
- type Manager
- type ManagerReader
- type MockConsensus
- func (m *MockConsensus) AddVote(v *vote.Vote)
- func (m *MockConsensus) AllVotes() []*vote.Vote
- func (m *MockConsensus) ConsensusKey() *bls.PublicKey
- func (m *MockConsensus) HasVote(h hash.Hash) bool
- func (m *MockConsensus) HeightRound() (uint32, int16)
- func (m *MockConsensus) IsActive() bool
- func (m *MockConsensus) MoveToNewHeight()
- func (m *MockConsensus) PickRandomVote(_ int16) *vote.Vote
- func (m *MockConsensus) Proposal() *proposal.Proposal
- func (m *MockConsensus) SetActive(active bool)
- func (m *MockConsensus) SetProposal(p *proposal.Proposal)
- func (m *MockConsensus) Start()
- func (m *MockConsensus) String() string
- type Reader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MockingManager ¶ added in v0.10.0
func MockingManager(ts *testsuite.TestSuite, valKeys []*bls.ValidatorKey) (Manager, []*MockConsensus)
Types ¶
type ConcreteMediator ¶ added in v0.10.0
type ConcreteMediator struct {
// contains filtered or unexported fields
}
ConcreteMediator struct.
func (*ConcreteMediator) OnBlockAnnounce ¶ added in v0.10.0
func (m *ConcreteMediator) OnBlockAnnounce(from Consensus)
func (*ConcreteMediator) OnPublishProposal ¶ added in v0.10.0
func (m *ConcreteMediator) OnPublishProposal(from Consensus, prop *proposal.Proposal)
func (*ConcreteMediator) OnPublishVote ¶ added in v0.10.0
func (m *ConcreteMediator) OnPublishVote(from Consensus, vte *vote.Vote)
func (*ConcreteMediator) Register ¶ added in v0.10.0
func (m *ConcreteMediator) Register(cons Consensus)
Register a new Consensus instance to the mediator.
type Config ¶
type Config struct { ChangeProposerTimeout time.Duration `toml:"change_proposer_timeout"` ChangeProposerDelta time.Duration `toml:"change_proposer_delta"` }
func DefaultConfig ¶
func DefaultConfig() *Config
func (*Config) BasicCheck ¶ added in v0.15.0
BasicCheck performs basic checks on the configuration.
type Consensus ¶
type Manager ¶ added in v0.10.0
type Manager interface { ManagerReader Start() error Stop() MoveToNewHeight() AddVote(vote *vote.Vote) SetProposal(proposal *proposal.Proposal) }
func NewManager ¶ added in v0.10.0
func NewManager( conf *Config, st state.Facade, valKeys []*bls.ValidatorKey, rewardAddrs []crypto.Address, broadcastCh chan message.Message, ) Manager
NewManager creates a new manager instance that manages a set of consensus instances, each associated with a validator key and a reward address. It is not thread-safe.
type ManagerReader ¶ added in v0.10.0
type MockConsensus ¶
type MockConsensus struct { ValKey *bls.ValidatorKey Votes []*vote.Vote CurProposal *proposal.Proposal Active bool Height uint32 Round int16 // contains filtered or unexported fields }
func MockingConsensus ¶
func MockingConsensus(ts *testsuite.TestSuite, valKey *bls.ValidatorKey) *MockConsensus
func (*MockConsensus) AddVote ¶
func (m *MockConsensus) AddVote(v *vote.Vote)
func (*MockConsensus) AllVotes ¶
func (m *MockConsensus) AllVotes() []*vote.Vote
func (*MockConsensus) ConsensusKey ¶ added in v0.15.0
func (m *MockConsensus) ConsensusKey() *bls.PublicKey
func (*MockConsensus) HeightRound ¶
func (m *MockConsensus) HeightRound() (uint32, int16)
func (*MockConsensus) IsActive ¶ added in v0.10.0
func (m *MockConsensus) IsActive() bool
func (*MockConsensus) MoveToNewHeight ¶
func (m *MockConsensus) MoveToNewHeight()
func (*MockConsensus) PickRandomVote ¶
func (m *MockConsensus) PickRandomVote(_ int16) *vote.Vote
func (*MockConsensus) Proposal ¶
func (m *MockConsensus) Proposal() *proposal.Proposal
func (*MockConsensus) SetActive ¶ added in v0.10.0
func (m *MockConsensus) SetActive(active bool)
func (*MockConsensus) SetProposal ¶
func (m *MockConsensus) SetProposal(p *proposal.Proposal)
func (*MockConsensus) Start ¶
func (m *MockConsensus) Start()
func (*MockConsensus) String ¶ added in v0.15.0
func (m *MockConsensus) String() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.