Documentation
¶
Index ¶
- type ConcreteMediator
- type Config
- type ConfigError
- type Consensus
- type InvalidJustificationError
- type MockConsensus
- func (m *MockConsensus) AddVote(v *vote.Vote)
- func (m *MockConsensus) AllVotes() []*vote.Vote
- func (m *MockConsensus) ConsensusKey() *bls.PublicKey
- func (m *MockConsensus) HandleQueryProposal(_ uint32, _ int16) *proposal.Proposal
- func (m *MockConsensus) HandleQueryVote(_ uint32, _ int16) *vote.Vote
- func (m *MockConsensus) HasVote(h hash.Hash) bool
- func (m *MockConsensus) HeightRound() (uint32, int16)
- func (m *MockConsensus) IsActive() bool
- func (*MockConsensus) IsDeprecated() bool
- func (m *MockConsensus) IsProposer() bool
- func (m *MockConsensus) MoveToNewHeight()
- func (m *MockConsensus) Proposal() *proposal.Proposal
- func (m *MockConsensus) SetActive(active bool)
- func (m *MockConsensus) SetProposal(p *proposal.Proposal)
- func (*MockConsensus) String() string
- type Reader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConcreteMediator ¶
type ConcreteMediator struct {
// contains filtered or unexported fields
}
ConcreteMediator struct.
func (*ConcreteMediator) OnBlockAnnounce ¶
func (m *ConcreteMediator) OnBlockAnnounce(from Consensus)
func (*ConcreteMediator) OnPublishProposal ¶
func (m *ConcreteMediator) OnPublishProposal(from Consensus, prop *proposal.Proposal)
func (*ConcreteMediator) OnPublishVote ¶
func (m *ConcreteMediator) OnPublishVote(from Consensus, vte *vote.Vote)
func (*ConcreteMediator) Register ¶
func (m *ConcreteMediator) Register(cons Consensus)
Register a new Consensus instance to the mediator.
type Config ¶
type Config struct {
ChangeProposerTimeout time.Duration `toml:"-"`
ChangeProposerDelta time.Duration `toml:"-"`
QueryVoteTimeout time.Duration `toml:"-"`
MinimumAvailabilityScore float64 `toml:"-"`
}
func DefaultConfig ¶
func DefaultConfig() *Config
func (*Config) BasicCheck ¶
BasicCheck performs basic checks on the configuration.
type ConfigError ¶
type ConfigError struct {
Reason string
}
ConfigError is returned when the config is not valid with a descriptive Reason message.
func (ConfigError) Error ¶
func (e ConfigError) Error() string
type Consensus ¶
type InvalidJustificationError ¶
type InvalidJustificationError struct {
Reason string
}
InvalidJustificationError is returned when the justification for a change-proposer vote is invalid.
func (InvalidJustificationError) Error ¶
func (e InvalidJustificationError) Error() string
type MockConsensus ¶
type MockConsensus struct {
State *state.MockState
ValKey *bls.ValidatorKey
Votes []*vote.Vote
CurProposal *proposal.Proposal
Active bool
Proposer bool
Height uint32
Round int16
// contains filtered or unexported fields
}
func MockingConsensus ¶
func MockingConsensus(ts *testsuite.TestSuite, state *state.MockState, 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 ¶
func (m *MockConsensus) ConsensusKey() *bls.PublicKey
func (*MockConsensus) HandleQueryProposal ¶
func (m *MockConsensus) HandleQueryProposal(_ uint32, _ int16) *proposal.Proposal
func (*MockConsensus) HandleQueryVote ¶
func (m *MockConsensus) HandleQueryVote(_ uint32, _ int16) *vote.Vote
func (*MockConsensus) HeightRound ¶
func (m *MockConsensus) HeightRound() (uint32, int16)
func (*MockConsensus) IsActive ¶
func (m *MockConsensus) IsActive() bool
func (*MockConsensus) IsDeprecated ¶
func (*MockConsensus) IsDeprecated() bool
func (*MockConsensus) IsProposer ¶
func (m *MockConsensus) IsProposer() bool
func (*MockConsensus) MoveToNewHeight ¶
func (m *MockConsensus) MoveToNewHeight()
func (*MockConsensus) Proposal ¶
func (m *MockConsensus) Proposal() *proposal.Proposal
func (*MockConsensus) SetActive ¶
func (m *MockConsensus) SetActive(active bool)
func (*MockConsensus) SetProposal ¶
func (m *MockConsensus) SetProposal(p *proposal.Proposal)
func (*MockConsensus) String ¶
func (*MockConsensus) String() string
type Reader ¶
type Reader interface {
ConsensusKey() *bls.PublicKey
AllVotes() []*vote.Vote
HandleQueryVote(height uint32, round int16) *vote.Vote
HandleQueryProposal(height uint32, round int16) *proposal.Proposal
Proposal() *proposal.Proposal
HasVote(h hash.Hash) bool
HeightRound() (uint32, int16)
IsActive() bool
IsProposer() bool
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.