Documentation
¶
Index ¶
Constants ¶
View Source
const (
TestEpochSize = 100
)
Utilities for test
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Candidate ¶
type Candidate struct {
Validator validators.Validator
Authorize bool
}
type HeaderGetter ¶
type HeaderGetter interface {
Header() *types.Header
GetHeaderByNumber(uint64) (*types.Header, bool)
}
HeaderGetter is an interface in order each ValidatorStore gets latest header and header by number
type MockBlockchain ¶
type MockBlockchain struct {
HeaderFn func() *types.Header
GetHeaderByNumberFn func(uint64) (*types.Header, bool)
}
func (*MockBlockchain) GetHeaderByNumber ¶
func (m *MockBlockchain) GetHeaderByNumber(height uint64) (*types.Header, bool)
func (*MockBlockchain) Header ¶
func (m *MockBlockchain) Header() *types.Header
type SourceType ¶
type SourceType string
Define the type of the validator set
const ( // For validators saved in-memory Snapshot SourceType = "Snapshot" // For validators managed in contract Contract SourceType = "Contract" )
func (SourceType) String ¶
func (t SourceType) String() string
String is a helper method for casting a SourceType to a string representation
type ValidatorStore ¶
type ValidatorStore interface {
SourceType() SourceType
}
ValidatorStore is an interface that ValidatorStore needs to implement
type ValidatorTypeGetter ¶
type ValidatorTypeGetter func(uint64) (validators.ValidatorType, error)
type Vote ¶
type Vote struct {
Validator types.Address // Voter
Candidate validators.Validator // Candidate
Authorize bool // Add or Remove
}
Vote defines the vote structure
func (*Vote) UnmarshalJSON ¶
UnmarshalJSON is JSON unmarshaler
Click to show internal directories.
Click to hide internal directories.