committee

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 2, 2020 License: GPL-3.0, GPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package committee is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var ErrEmptyCommitteeSet = errors.New("committee set can't be empty")

Functions

func NewSet

func NewSet(members types.Committee, policy config.ProposerPolicy, lastProposer common.Address) (*defaultSet, error)

Types

type MockSet

type MockSet struct {
	// contains filtered or unexported fields
}

MockSet is a mock of Set interface

func NewMockSet

func NewMockSet(ctrl *gomock.Controller) *MockSet

NewMockSet creates a new mock instance

func (*MockSet) Committee

func (m *MockSet) Committee() types.Committee

Committee mocks base method

func (*MockSet) Copy

func (m *MockSet) Copy() Set

Copy mocks base method

func (*MockSet) EXPECT

func (m *MockSet) EXPECT() *MockSetMockRecorder

EXPECT returns an object that allows the caller to indicate expected use

func (*MockSet) F

func (m *MockSet) F() uint64

F mocks base method

func (*MockSet) GetByAddress

func (m *MockSet) GetByAddress(addr common.Address) (int, types.CommitteeMember, error)

GetByAddress mocks base method

func (*MockSet) GetByIndex

func (m *MockSet) GetByIndex(i int) (types.CommitteeMember, error)

GetByIndex mocks base method

func (*MockSet) GetProposer

func (m *MockSet) GetProposer(round int64) types.CommitteeMember

GetProposer mocks base method

func (*MockSet) IsProposer

func (m *MockSet) IsProposer(round int64, address common.Address) bool

IsProposer mocks base method

func (*MockSet) Quorum

func (m *MockSet) Quorum() uint64

Quorum mocks base method

func (*MockSet) Size

func (m *MockSet) Size() int

Size mocks base method

type MockSetMockRecorder

type MockSetMockRecorder struct {
	// contains filtered or unexported fields
}

MockSetMockRecorder is the mock recorder for MockSet

func (*MockSetMockRecorder) Committee

func (mr *MockSetMockRecorder) Committee() *gomock.Call

Committee indicates an expected call of Committee

func (*MockSetMockRecorder) Copy

func (mr *MockSetMockRecorder) Copy() *gomock.Call

Copy indicates an expected call of Copy

func (*MockSetMockRecorder) F

func (mr *MockSetMockRecorder) F() *gomock.Call

F indicates an expected call of F

func (*MockSetMockRecorder) GetByAddress

func (mr *MockSetMockRecorder) GetByAddress(addr interface{}) *gomock.Call

GetByAddress indicates an expected call of GetByAddress

func (*MockSetMockRecorder) GetByIndex

func (mr *MockSetMockRecorder) GetByIndex(i interface{}) *gomock.Call

GetByIndex indicates an expected call of GetByIndex

func (*MockSetMockRecorder) GetProposer

func (mr *MockSetMockRecorder) GetProposer(round interface{}) *gomock.Call

GetProposer indicates an expected call of GetProposer

func (*MockSetMockRecorder) IsProposer

func (mr *MockSetMockRecorder) IsProposer(round, address interface{}) *gomock.Call

IsProposer indicates an expected call of IsProposer

func (*MockSetMockRecorder) Quorum

func (mr *MockSetMockRecorder) Quorum() *gomock.Call

Quorum indicates an expected call of Quorum

func (*MockSetMockRecorder) Size

func (mr *MockSetMockRecorder) Size() *gomock.Call

Size indicates an expected call of Size

type ProposalSelector

type ProposalSelector func(Set, common.Address, int64) types.CommitteeMember

type Set

type Set interface {
	// Return the validator size
	Size() int
	// Return the underlying types.Committee
	Committee() types.Committee
	// Get validator by index
	GetByIndex(i int) (types.CommitteeMember, error)
	// Get validator by given address
	GetByAddress(addr common.Address) (int, types.CommitteeMember, error)
	// Get the round proposer
	GetProposer(round int64) types.CommitteeMember
	// Check whether the validator with given address is the round proposer
	IsProposer(round int64, address common.Address) bool
	// Copy validator set
	Copy() Set
	// Get the maximum number of faulty nodes
	F() uint64
	// Get the optimal quorum size
	Quorum() uint64
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL