Documentation
¶
Overview ¶
Package validator is a generated GoMock package.
Index ¶
- func ExtractValidators(extraData []byte) []common.Address
- func New(addr common.Address) *defaultValidator
- func NewSet(addrs []common.Address, policy config.ProposerPolicy) *defaultSet
- type MockSet
- func (m *MockSet) AddValidator(address common.Address) bool
- func (m *MockSet) CalcProposer(lastProposer common.Address, round uint64)
- func (m *MockSet) Copy() Set
- func (m *MockSet) EXPECT() *MockSetMockRecorder
- func (m *MockSet) F() int
- func (m *MockSet) GetByAddress(addr common.Address) (int, Validator)
- func (m *MockSet) GetByIndex(i uint64) Validator
- func (m *MockSet) GetProposer() Validator
- func (m *MockSet) IsProposer(address common.Address) bool
- func (m *MockSet) List() []Validator
- func (m *MockSet) Policy() config.ProposerPolicy
- func (m *MockSet) RemoveValidator(address common.Address) bool
- func (m *MockSet) Size() int
- type MockSetMockRecorder
- func (mr *MockSetMockRecorder) AddValidator(address interface{}) *gomock.Call
- func (mr *MockSetMockRecorder) CalcProposer(lastProposer, round interface{}) *gomock.Call
- func (mr *MockSetMockRecorder) Copy() *gomock.Call
- func (mr *MockSetMockRecorder) F() *gomock.Call
- func (mr *MockSetMockRecorder) GetByAddress(addr interface{}) *gomock.Call
- func (mr *MockSetMockRecorder) GetByIndex(i interface{}) *gomock.Call
- func (mr *MockSetMockRecorder) GetProposer() *gomock.Call
- func (mr *MockSetMockRecorder) IsProposer(address interface{}) *gomock.Call
- func (mr *MockSetMockRecorder) List() *gomock.Call
- func (mr *MockSetMockRecorder) Policy() *gomock.Call
- func (mr *MockSetMockRecorder) RemoveValidator(address interface{}) *gomock.Call
- func (mr *MockSetMockRecorder) Size() *gomock.Call
- type MockValidator
- type MockValidatorMockRecorder
- type ProposalSelector
- type Set
- type Validator
- type Validators
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractValidators ¶
Types ¶
type MockSet ¶ added in v0.1.6
type MockSet struct {
// contains filtered or unexported fields
}
MockSet is a mock of Set interface
func NewMockSet ¶ added in v0.1.6
func NewMockSet(ctrl *gomock.Controller) *MockSet
NewMockSet creates a new mock instance
func (*MockSet) AddValidator ¶ added in v0.1.6
AddValidator mocks base method
func (*MockSet) CalcProposer ¶ added in v0.1.6
CalcProposer mocks base method
func (*MockSet) EXPECT ¶ added in v0.1.6
func (m *MockSet) EXPECT() *MockSetMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockSet) GetByAddress ¶ added in v0.1.6
GetByAddress mocks base method
func (*MockSet) GetByIndex ¶ added in v0.1.6
GetByIndex mocks base method
func (*MockSet) GetProposer ¶ added in v0.1.6
GetProposer mocks base method
func (*MockSet) IsProposer ¶ added in v0.1.6
IsProposer mocks base method
func (*MockSet) Policy ¶ added in v0.1.6
func (m *MockSet) Policy() config.ProposerPolicy
Policy mocks base method
func (*MockSet) RemoveValidator ¶ added in v0.1.6
RemoveValidator mocks base method
type MockSetMockRecorder ¶ added in v0.1.6
type MockSetMockRecorder struct {
// contains filtered or unexported fields
}
MockSetMockRecorder is the mock recorder for MockSet
func (*MockSetMockRecorder) AddValidator ¶ added in v0.1.6
func (mr *MockSetMockRecorder) AddValidator(address interface{}) *gomock.Call
AddValidator indicates an expected call of AddValidator
func (*MockSetMockRecorder) CalcProposer ¶ added in v0.1.6
func (mr *MockSetMockRecorder) CalcProposer(lastProposer, round interface{}) *gomock.Call
CalcProposer indicates an expected call of CalcProposer
func (*MockSetMockRecorder) Copy ¶ added in v0.1.6
func (mr *MockSetMockRecorder) Copy() *gomock.Call
Copy indicates an expected call of Copy
func (*MockSetMockRecorder) F ¶ added in v0.1.6
func (mr *MockSetMockRecorder) F() *gomock.Call
F indicates an expected call of F
func (*MockSetMockRecorder) GetByAddress ¶ added in v0.1.6
func (mr *MockSetMockRecorder) GetByAddress(addr interface{}) *gomock.Call
GetByAddress indicates an expected call of GetByAddress
func (*MockSetMockRecorder) GetByIndex ¶ added in v0.1.6
func (mr *MockSetMockRecorder) GetByIndex(i interface{}) *gomock.Call
GetByIndex indicates an expected call of GetByIndex
func (*MockSetMockRecorder) GetProposer ¶ added in v0.1.6
func (mr *MockSetMockRecorder) GetProposer() *gomock.Call
GetProposer indicates an expected call of GetProposer
func (*MockSetMockRecorder) IsProposer ¶ added in v0.1.6
func (mr *MockSetMockRecorder) IsProposer(address interface{}) *gomock.Call
IsProposer indicates an expected call of IsProposer
func (*MockSetMockRecorder) List ¶ added in v0.1.6
func (mr *MockSetMockRecorder) List() *gomock.Call
List indicates an expected call of List
func (*MockSetMockRecorder) Policy ¶ added in v0.1.6
func (mr *MockSetMockRecorder) Policy() *gomock.Call
Policy indicates an expected call of Policy
func (*MockSetMockRecorder) RemoveValidator ¶ added in v0.1.6
func (mr *MockSetMockRecorder) RemoveValidator(address interface{}) *gomock.Call
RemoveValidator indicates an expected call of RemoveValidator
func (*MockSetMockRecorder) Size ¶ added in v0.1.6
func (mr *MockSetMockRecorder) Size() *gomock.Call
Size indicates an expected call of Size
type MockValidator ¶ added in v0.1.6
type MockValidator struct {
// contains filtered or unexported fields
}
MockValidator is a mock of Validator interface
func NewMockValidator ¶ added in v0.1.6
func NewMockValidator(ctrl *gomock.Controller) *MockValidator
NewMockValidator creates a new mock instance
func (*MockValidator) Address ¶ added in v0.1.6
func (m *MockValidator) Address() common.Address
Address mocks base method
func (*MockValidator) EXPECT ¶ added in v0.1.6
func (m *MockValidator) EXPECT() *MockValidatorMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockValidator) String ¶ added in v0.1.6
func (m *MockValidator) String() string
String mocks base method
type MockValidatorMockRecorder ¶ added in v0.1.6
type MockValidatorMockRecorder struct {
// contains filtered or unexported fields
}
MockValidatorMockRecorder is the mock recorder for MockValidator
func (*MockValidatorMockRecorder) Address ¶ added in v0.1.6
func (mr *MockValidatorMockRecorder) Address() *gomock.Call
Address indicates an expected call of Address
func (*MockValidatorMockRecorder) String ¶ added in v0.1.6
func (mr *MockValidatorMockRecorder) String() *gomock.Call
String indicates an expected call of String
type ProposalSelector ¶ added in v0.1.6
type Set ¶ added in v0.1.6
type Set interface { // Calculate the proposer CalcProposer(lastProposer common.Address, round uint64) // Return the validator size Size() int // Return the validator array List() []Validator // Get validator by index GetByIndex(i uint64) Validator // Get validator by given address GetByAddress(addr common.Address) (int, Validator) // Get current proposer GetProposer() Validator // Check whether the validator with given address is a proposer IsProposer(address common.Address) bool // Add validator AddValidator(address common.Address) bool // Remove validator RemoveValidator(address common.Address) bool // Copy validator set Copy() Set // Get the maximum number of faulty nodes F() int // Get proposer policy Policy() config.ProposerPolicy }
type Validators ¶ added in v0.1.6
type Validators []Validator
func (Validators) Len ¶ added in v0.1.6
func (slice Validators) Len() int
func (Validators) Less ¶ added in v0.1.6
func (slice Validators) Less(i, j int) bool
func (Validators) Swap ¶ added in v0.1.6
func (slice Validators) Swap(i, j int)