Documentation ¶
Overview ¶
Package core is a generated GoMock package.
Index ¶
- Constants
- Variables
- func Encode(val interface{}) ([]byte, error)
- func New(backend Backend, config *config.Config) *core
- func NewRoundMessages() *roundMessages
- func PrepareCommittedSeal(hash common.Hash, round int64, height *big.Int) []byte
- type Backend
- type ConsensusMsg
- type Message
- func (m *Message) Decode(val interface{}) error
- func (m *Message) DecodeRLP(s *rlp.Stream) error
- func (m *Message) EncodeRLP(w io.Writer) error
- func (m *Message) FromPayload(b []byte, previousHeader *types.Header, ...) (*types.CommitteeMember, error)
- func (m *Message) GetCode() uint64
- func (m *Message) GetPower() uint64
- func (m *Message) GetSignature() []byte
- func (m *Message) Height() (*big.Int, error)
- func (m *Message) Payload() ([]byte, error)
- func (m *Message) PayloadNoSig() ([]byte, error)
- func (m *Message) Round() (int64, error)
- func (m *Message) String() string
- type MockBackend
- func (m *MockBackend) AddSeal(block *types.Block) (*types.Block, error)
- func (m *MockBackend) Address() common.Address
- func (m *MockBackend) AskSync(header *types.Header)
- func (m *MockBackend) BlockChain() *ethcore.BlockChain
- func (m *MockBackend) Broadcast(ctx context.Context, committee types.Committee, payload []byte) error
- func (m *MockBackend) Commit(proposalBlock *types.Block, round int64, seals [][]byte) error
- func (m *MockBackend) EXPECT() *MockBackendMockRecorder
- func (m *MockBackend) GetContractABI() string
- func (m *MockBackend) Gossip(ctx context.Context, committee types.Committee, payload []byte)
- func (m *MockBackend) HandleUnhandledMsgs(ctx context.Context)
- func (m *MockBackend) LastCommittedProposal() (*types.Block, common.Address)
- func (m *MockBackend) Post(ev interface{})
- func (m *MockBackend) SetBlockchain(bc *ethcore.BlockChain)
- func (m *MockBackend) SetProposedBlockHash(hash common.Hash)
- func (m *MockBackend) Sign(arg0 []byte) ([]byte, error)
- func (m *MockBackend) Subscribe(types ...interface{}) *event.TypeMuxSubscription
- func (m *MockBackend) SyncPeer(address common.Address)
- func (m *MockBackend) VerifyProposal(arg0 types.Block) (time.Duration, error)
- func (m *MockBackend) WhiteList() []string
- type MockBackendMockRecorder
- func (mr *MockBackendMockRecorder) AddSeal(block interface{}) *gomock.Call
- func (mr *MockBackendMockRecorder) Address() *gomock.Call
- func (mr *MockBackendMockRecorder) AskSync(header interface{}) *gomock.Call
- func (mr *MockBackendMockRecorder) BlockChain() *gomock.Call
- func (mr *MockBackendMockRecorder) Broadcast(ctx, committee, payload interface{}) *gomock.Call
- func (mr *MockBackendMockRecorder) Commit(proposalBlock, round, seals interface{}) *gomock.Call
- func (mr *MockBackendMockRecorder) GetContractABI() *gomock.Call
- func (mr *MockBackendMockRecorder) Gossip(ctx, committee, payload interface{}) *gomock.Call
- func (mr *MockBackendMockRecorder) HandleUnhandledMsgs(ctx interface{}) *gomock.Call
- func (mr *MockBackendMockRecorder) LastCommittedProposal() *gomock.Call
- func (mr *MockBackendMockRecorder) Post(ev interface{}) *gomock.Call
- func (mr *MockBackendMockRecorder) SetBlockchain(bc interface{}) *gomock.Call
- func (mr *MockBackendMockRecorder) SetProposedBlockHash(hash interface{}) *gomock.Call
- func (mr *MockBackendMockRecorder) Sign(arg0 interface{}) *gomock.Call
- func (mr *MockBackendMockRecorder) Subscribe(types ...interface{}) *gomock.Call
- func (mr *MockBackendMockRecorder) SyncPeer(address interface{}) *gomock.Call
- func (mr *MockBackendMockRecorder) VerifyProposal(arg0 interface{}) *gomock.Call
- func (mr *MockBackendMockRecorder) WhiteList() *gomock.Call
- type MockTendermint
- type MockTendermintMockRecorder
- type Proposal
- type Step
- type Tendermint
- type TimeoutEvent
- type Vote
Constants ¶
const (
MaxRound = 99 // consequence of backlog priority
)
Variables ¶
var ErrEmptyCommitteeSet = errors.New("committee set can't be empty")
Functions ¶
func NewRoundMessages ¶ added in v0.4.0
func NewRoundMessages() *roundMessages
NewRoundMessages creates a new messages instance with the given view and validatorSet we need to keep a reference of proposal in order to propose locked proposal when there is a lock and itself is the proposer
Types ¶
type Backend ¶ added in v0.1.6
type Backend interface { Address() common.Address AddSeal(block *types.Block) (*types.Block, error) AskSync(header *types.Header) // Broadcast sends a message to all validators (include self) Broadcast(ctx context.Context, committee types.Committee, payload []byte) error // Commit delivers an approved proposal to backend. // The delivered proposal will be put into blockchain. Commit(proposalBlock *types.Block, round int64, seals [][]byte) error GetContractABI() string // Gossip sends a message to all validators (exclude self) Gossip(ctx context.Context, committee types.Committee, payload []byte) HandleUnhandledMsgs(ctx context.Context) // LastCommittedProposal retrieves latest committed proposal and the address of proposer LastCommittedProposal() (*types.Block, common.Address) Post(ev interface{}) // Setter for proposed block hash SetProposedBlockHash(hash common.Hash) // Sign signs input data with the backend's private key Sign([]byte) ([]byte, error) Subscribe(types ...interface{}) *event.TypeMuxSubscription SyncPeer(address common.Address) // VerifyProposal verifies the proposal. If a consensus.ErrFutureBlock error is returned, // the time difference of the proposal and current time is also returned. VerifyProposal(types.Block) (time.Duration, error) WhiteList() []string BlockChain() *ethcore.BlockChain //Used to set the blockchain on this SetBlockchain(bc *ethcore.BlockChain) }
Backend provides application specific functions for Istanbul core
type ConsensusMsg ¶ added in v0.4.0
type Message ¶ added in v0.1.6
type Message struct { Code uint64 Msg []byte Address common.Address Signature []byte CommittedSeal []byte // contains filtered or unexported fields }
func (*Message) DecodeRLP ¶ added in v0.1.6
DecodeRLP implements rlp.Decoder, and load the consensus fields from a RLP stream.
func (*Message) FromPayload ¶ added in v0.1.6
func (*Message) GetSignature ¶ added in v0.1.6
func (*Message) PayloadNoSig ¶ added in v0.1.6
type MockBackend ¶ added in v0.1.6
type MockBackend struct {
// contains filtered or unexported fields
}
MockBackend is a mock of Backend interface
func NewMockBackend ¶ added in v0.1.6
func NewMockBackend(ctrl *gomock.Controller) *MockBackend
NewMockBackend creates a new mock instance
func (*MockBackend) Address ¶ added in v0.1.6
func (m *MockBackend) Address() common.Address
Address mocks base method
func (*MockBackend) AskSync ¶ added in v0.3.0
func (m *MockBackend) AskSync(header *types.Header)
AskSync mocks base method
func (*MockBackend) BlockChain ¶ added in v0.5.0
func (m *MockBackend) BlockChain() *ethcore.BlockChain
BlockChain mocks base method
func (*MockBackend) Broadcast ¶ added in v0.1.6
func (m *MockBackend) Broadcast(ctx context.Context, committee types.Committee, payload []byte) error
Broadcast mocks base method
func (*MockBackend) EXPECT ¶ added in v0.1.6
func (m *MockBackend) EXPECT() *MockBackendMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockBackend) GetContractABI ¶ added in v0.3.0
func (m *MockBackend) GetContractABI() string
GetContractABI mocks base method
func (*MockBackend) HandleUnhandledMsgs ¶ added in v0.3.0
func (m *MockBackend) HandleUnhandledMsgs(ctx context.Context)
HandleUnhandledMsgs mocks base method
func (*MockBackend) LastCommittedProposal ¶ added in v0.1.6
func (m *MockBackend) LastCommittedProposal() (*types.Block, common.Address)
LastCommittedProposal mocks base method
func (*MockBackend) Post ¶ added in v0.1.6
func (m *MockBackend) Post(ev interface{})
Post mocks base method
func (*MockBackend) SetBlockchain ¶ added in v0.5.0
func (m *MockBackend) SetBlockchain(bc *ethcore.BlockChain)
SetBlockchain mocks base method
func (*MockBackend) SetProposedBlockHash ¶ added in v0.1.6
func (m *MockBackend) SetProposedBlockHash(hash common.Hash)
SetProposedBlockHash mocks base method
func (*MockBackend) Sign ¶ added in v0.1.6
func (m *MockBackend) Sign(arg0 []byte) ([]byte, error)
Sign mocks base method
func (*MockBackend) Subscribe ¶ added in v0.1.6
func (m *MockBackend) Subscribe(types ...interface{}) *event.TypeMuxSubscription
Subscribe mocks base method
func (*MockBackend) SyncPeer ¶ added in v0.1.6
func (m *MockBackend) SyncPeer(address common.Address)
SyncPeer mocks base method
func (*MockBackend) VerifyProposal ¶ added in v0.1.6
VerifyProposal mocks base method
func (*MockBackend) WhiteList ¶ added in v0.3.0
func (m *MockBackend) WhiteList() []string
WhiteList mocks base method
type MockBackendMockRecorder ¶ added in v0.1.6
type MockBackendMockRecorder struct {
// contains filtered or unexported fields
}
MockBackendMockRecorder is the mock recorder for MockBackend
func (*MockBackendMockRecorder) AddSeal ¶ added in v0.4.0
func (mr *MockBackendMockRecorder) AddSeal(block interface{}) *gomock.Call
AddSeal indicates an expected call of AddSeal
func (*MockBackendMockRecorder) Address ¶ added in v0.1.6
func (mr *MockBackendMockRecorder) Address() *gomock.Call
Address indicates an expected call of Address
func (*MockBackendMockRecorder) AskSync ¶ added in v0.3.0
func (mr *MockBackendMockRecorder) AskSync(header interface{}) *gomock.Call
AskSync indicates an expected call of AskSync
func (*MockBackendMockRecorder) BlockChain ¶ added in v0.5.0
func (mr *MockBackendMockRecorder) BlockChain() *gomock.Call
BlockChain indicates an expected call of BlockChain
func (*MockBackendMockRecorder) Broadcast ¶ added in v0.1.6
func (mr *MockBackendMockRecorder) Broadcast(ctx, committee, payload interface{}) *gomock.Call
Broadcast indicates an expected call of Broadcast
func (*MockBackendMockRecorder) Commit ¶ added in v0.1.6
func (mr *MockBackendMockRecorder) Commit(proposalBlock, round, seals interface{}) *gomock.Call
Commit indicates an expected call of Commit
func (*MockBackendMockRecorder) GetContractABI ¶ added in v0.3.0
func (mr *MockBackendMockRecorder) GetContractABI() *gomock.Call
GetContractABI indicates an expected call of GetContractABI
func (*MockBackendMockRecorder) Gossip ¶ added in v0.1.6
func (mr *MockBackendMockRecorder) Gossip(ctx, committee, payload interface{}) *gomock.Call
Gossip indicates an expected call of Gossip
func (*MockBackendMockRecorder) HandleUnhandledMsgs ¶ added in v0.3.0
func (mr *MockBackendMockRecorder) HandleUnhandledMsgs(ctx interface{}) *gomock.Call
HandleUnhandledMsgs indicates an expected call of HandleUnhandledMsgs
func (*MockBackendMockRecorder) LastCommittedProposal ¶ added in v0.1.6
func (mr *MockBackendMockRecorder) LastCommittedProposal() *gomock.Call
LastCommittedProposal indicates an expected call of LastCommittedProposal
func (*MockBackendMockRecorder) Post ¶ added in v0.1.6
func (mr *MockBackendMockRecorder) Post(ev interface{}) *gomock.Call
Post indicates an expected call of Post
func (*MockBackendMockRecorder) SetBlockchain ¶ added in v0.5.0
func (mr *MockBackendMockRecorder) SetBlockchain(bc interface{}) *gomock.Call
SetBlockchain indicates an expected call of SetBlockchain
func (*MockBackendMockRecorder) SetProposedBlockHash ¶ added in v0.1.6
func (mr *MockBackendMockRecorder) SetProposedBlockHash(hash interface{}) *gomock.Call
SetProposedBlockHash indicates an expected call of SetProposedBlockHash
func (*MockBackendMockRecorder) Sign ¶ added in v0.1.6
func (mr *MockBackendMockRecorder) Sign(arg0 interface{}) *gomock.Call
Sign indicates an expected call of Sign
func (*MockBackendMockRecorder) Subscribe ¶ added in v0.1.6
func (mr *MockBackendMockRecorder) Subscribe(types ...interface{}) *gomock.Call
Subscribe indicates an expected call of Subscribe
func (*MockBackendMockRecorder) SyncPeer ¶ added in v0.1.6
func (mr *MockBackendMockRecorder) SyncPeer(address interface{}) *gomock.Call
SyncPeer indicates an expected call of SyncPeer
func (*MockBackendMockRecorder) VerifyProposal ¶ added in v0.1.6
func (mr *MockBackendMockRecorder) VerifyProposal(arg0 interface{}) *gomock.Call
VerifyProposal indicates an expected call of VerifyProposal
func (*MockBackendMockRecorder) WhiteList ¶ added in v0.3.0
func (mr *MockBackendMockRecorder) WhiteList() *gomock.Call
WhiteList indicates an expected call of WhiteList
type MockTendermint ¶ added in v0.5.0
type MockTendermint struct {
// contains filtered or unexported fields
}
MockTendermint is a mock of Tendermint interface
func NewMockTendermint ¶ added in v0.5.0
func NewMockTendermint(ctrl *gomock.Controller) *MockTendermint
NewMockTendermint creates a new mock instance
func (*MockTendermint) EXPECT ¶ added in v0.5.0
func (m *MockTendermint) EXPECT() *MockTendermintMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockTendermint) GetCurrentHeightMessages ¶ added in v0.5.0
func (m *MockTendermint) GetCurrentHeightMessages() []*Message
GetCurrentHeightMessages mocks base method
func (*MockTendermint) Start ¶ added in v0.5.0
func (m *MockTendermint) Start(ctx context.Context, contract *autonity.Contract)
Start mocks base method
func (*MockTendermint) Stop ¶ added in v0.5.0
func (m *MockTendermint) Stop()
Stop mocks base method
type MockTendermintMockRecorder ¶ added in v0.5.0
type MockTendermintMockRecorder struct {
// contains filtered or unexported fields
}
MockTendermintMockRecorder is the mock recorder for MockTendermint
func (*MockTendermintMockRecorder) GetCurrentHeightMessages ¶ added in v0.5.0
func (mr *MockTendermintMockRecorder) GetCurrentHeightMessages() *gomock.Call
GetCurrentHeightMessages indicates an expected call of GetCurrentHeightMessages
func (*MockTendermintMockRecorder) Start ¶ added in v0.5.0
func (mr *MockTendermintMockRecorder) Start(ctx, contract interface{}) *gomock.Call
Start indicates an expected call of Start
func (*MockTendermintMockRecorder) Stop ¶ added in v0.5.0
func (mr *MockTendermintMockRecorder) Stop() *gomock.Call
Stop indicates an expected call of Stop
type Proposal ¶ added in v0.1.6
func NewProposal ¶ added in v0.1.6
func (*Proposal) DecodeRLP ¶ added in v0.1.6
DecodeRLP implements rlp.Decoder, and load the consensus fields from a RLP stream.
type Tendermint ¶ added in v0.5.0
type TimeoutEvent ¶ added in v0.1.6
type TimeoutEvent struct {
// contains filtered or unexported fields
}