core

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2019 License: GPL-3.0, GPL-3.0 Imports: 27 Imported by: 0

Documentation

Overview

Package core is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var ErrUnauthorizedAddress = errors.New("unauthorized address")

Functions

func Encode

func Encode(val interface{}) ([]byte, error)

func New

func New(backend Backend, config *config.Config) *core

New creates an Tendermint consensus core

func NewRoundState

func NewRoundState(r *big.Int, h *big.Int) *roundState

NewRoundState creates a new roundState 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

func PrepareCommittedSeal

func PrepareCommittedSeal(hash common.Hash) []byte

PrepareCommittedSeal returns a committed seal for the given hash

Types

type Backend added in v0.2.1

type Backend interface {
	consensus.Engine
	consensus.Handler
	Start(ctx context.Context, chain consensus.ChainReader, currentBlock func() *types.Block, hasBadBlock func(hash common.Hash) bool) error

	// Address returns the owner's address
	Address() common.Address

	// Validators returns the validator set
	Validators(number uint64) validator.Set

	Subscribe(types ...interface{}) *event.TypeMuxSubscription

	Post(ev interface{})

	// Broadcast sends a message to all validators (include self)
	Broadcast(ctx context.Context, valSet validator.Set, payload []byte) error

	// Gossip sends a message to all validators (exclude self)
	Gossip(ctx context.Context, valSet validator.Set, payload []byte)

	// Commit delivers an approved proposal to backend.
	// The delivered proposal will be put into blockchain.
	Commit(proposalBlock types.Block, seals [][]byte) error

	// 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)

	// Sign signs input data with the backend's private key
	Sign([]byte) ([]byte, error)

	// CheckSignature verifies the signature by checking if it's signed by
	// the given validator
	CheckSignature(data []byte, addr common.Address, sig []byte) error

	// LastCommittedProposal retrieves latest committed proposal and the address of proposer
	LastCommittedProposal() (*types.Block, common.Address)

	// GetProposer returns the proposer of the given block height
	GetProposer(number uint64) common.Address

	// HasBadBlock returns whether the block with the hash is a bad block
	HasBadProposal(hash common.Hash) bool

	// Setter for proposed block hash
	SetProposedBlockHash(hash common.Hash)

	SyncPeer(address common.Address, messages []*Message)

	ResetPeerCache(address common.Address)

	AskSync(set validator.Set)

	HandleUnhandledMsgs(ctx context.Context)

	GetContractAddress() common.Address

	GetContractABI() string

	WhiteList() []string
}

Backend provides application specific functions for Istanbul core

type Message added in v0.2.1

type Message struct {
	Code          uint64
	Msg           []byte
	Address       common.Address
	Signature     []byte
	CommittedSeal []byte
}

func (*Message) Decode added in v0.2.1

func (m *Message) Decode(val interface{}) error

func (*Message) DecodeRLP added in v0.2.1

func (m *Message) DecodeRLP(s *rlp.Stream) error

DecodeRLP implements rlp.Decoder, and load the consensus fields from a RLP stream.

func (*Message) EncodeRLP added in v0.2.1

func (m *Message) EncodeRLP(w io.Writer) error

EncodeRLP serializes m into the Ethereum RLP format.

func (*Message) FromPayload added in v0.2.1

func (m *Message) FromPayload(b []byte, valSet validator.Set, validateFn func(validator.Set, []byte, []byte) (common.Address, error)) (*validator.Validator, error)

func (*Message) GetCode added in v0.2.1

func (m *Message) GetCode() uint64

func (*Message) GetSignature added in v0.2.1

func (m *Message) GetSignature() []byte

func (*Message) Payload added in v0.2.1

func (m *Message) Payload() ([]byte, error)

func (*Message) PayloadNoSig added in v0.2.1

func (m *Message) PayloadNoSig() ([]byte, error)

func (*Message) String added in v0.2.1

func (m *Message) String() string

type MockBackend added in v0.2.1

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

MockBackend is a mock of Backend interface

func NewMockBackend added in v0.2.1

func NewMockBackend(ctrl *gomock.Controller) *MockBackend

NewMockBackend creates a new mock instance

func (*MockBackend) APIs added in v0.2.1

func (m *MockBackend) APIs(chain consensus.ChainReader) []rpc.API

APIs mocks base method

func (*MockBackend) Address added in v0.2.1

func (m *MockBackend) Address() common.Address

Address mocks base method

func (*MockBackend) AskSync added in v0.3.0

func (m *MockBackend) AskSync(set validator.Set)

AskSync mocks base method

func (*MockBackend) Author added in v0.2.1

func (m *MockBackend) Author(header *types.Header) (common.Address, error)

Author mocks base method

func (*MockBackend) Broadcast added in v0.2.1

func (m *MockBackend) Broadcast(ctx context.Context, valSet validator.Set, payload []byte) error

Broadcast mocks base method

func (*MockBackend) CalcDifficulty added in v0.2.1

func (m *MockBackend) CalcDifficulty(chain consensus.ChainReader, time uint64, parent *types.Header) *big.Int

CalcDifficulty mocks base method

func (*MockBackend) CheckSignature added in v0.2.1

func (m *MockBackend) CheckSignature(data []byte, addr common.Address, sig []byte) error

CheckSignature mocks base method

func (*MockBackend) Close added in v0.2.1

func (m *MockBackend) Close() error

Close mocks base method

func (*MockBackend) Commit added in v0.2.1

func (m *MockBackend) Commit(proposalBlock types.Block, seals [][]byte) error

Commit mocks base method

func (*MockBackend) EXPECT added in v0.2.1

func (m *MockBackend) EXPECT() *MockBackendMockRecorder

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

func (*MockBackend) Finalize added in v0.2.1

func (m *MockBackend) Finalize(chain consensus.ChainReader, header *types.Header, state *state.StateDB, txs []*types.Transaction, uncles []*types.Header)

Finalize mocks base method

func (*MockBackend) FinalizeAndAssemble added in v0.2.1

func (m *MockBackend) FinalizeAndAssemble(chain consensus.ChainReader, header *types.Header, state *state.StateDB, txs []*types.Transaction, uncles []*types.Header, receipts []*types.Receipt) (*types.Block, error)

FinalizeAndAssemble mocks base method

func (*MockBackend) GetContractABI added in v0.3.0

func (m *MockBackend) GetContractABI() string

GetContractABI mocks base method

func (*MockBackend) GetContractAddress added in v0.3.0

func (m *MockBackend) GetContractAddress() common.Address

GetContractAddress mocks base method

func (*MockBackend) GetProposer added in v0.2.1

func (m *MockBackend) GetProposer(number uint64) common.Address

GetProposer mocks base method

func (*MockBackend) Gossip added in v0.2.1

func (m *MockBackend) Gossip(ctx context.Context, valSet validator.Set, payload []byte)

Gossip mocks base method

func (*MockBackend) HandleMsg added in v0.2.1

func (m *MockBackend) HandleMsg(address common.Address, data p2p.Msg) (bool, error)

HandleMsg mocks base method

func (*MockBackend) HandleUnhandledMsgs added in v0.3.0

func (m *MockBackend) HandleUnhandledMsgs(ctx context.Context)

HandleUnhandledMsgs mocks base method

func (*MockBackend) HasBadProposal added in v0.2.1

func (m *MockBackend) HasBadProposal(hash common.Hash) bool

HasBadProposal mocks base method

func (*MockBackend) LastCommittedProposal added in v0.2.1

func (m *MockBackend) LastCommittedProposal() (*types.Block, common.Address)

LastCommittedProposal mocks base method

func (*MockBackend) NewChainHead added in v0.2.1

func (m *MockBackend) NewChainHead() error

NewChainHead mocks base method

func (*MockBackend) Post added in v0.2.1

func (m *MockBackend) Post(ev interface{})

Post mocks base method

func (*MockBackend) Prepare added in v0.2.1

func (m *MockBackend) Prepare(chain consensus.ChainReader, header *types.Header) error

Prepare mocks base method

func (*MockBackend) Protocol added in v0.2.1

func (m *MockBackend) Protocol() (string, uint64)

Protocol mocks base method

func (*MockBackend) ResetPeerCache added in v0.2.1

func (m *MockBackend) ResetPeerCache(address common.Address)

ResetPeerCache mocks base method

func (*MockBackend) Seal added in v0.2.1

func (m *MockBackend) Seal(chain consensus.ChainReader, block *types.Block, results chan<- *types.Block, stop <-chan struct{}) error

Seal mocks base method

func (*MockBackend) SealHash added in v0.2.1

func (m *MockBackend) SealHash(header *types.Header) common.Hash

SealHash mocks base method

func (*MockBackend) SetBroadcaster added in v0.2.1

func (m *MockBackend) SetBroadcaster(arg0 consensus.Broadcaster)

SetBroadcaster mocks base method

func (*MockBackend) SetProposedBlockHash added in v0.2.1

func (m *MockBackend) SetProposedBlockHash(hash common.Hash)

SetProposedBlockHash mocks base method

func (*MockBackend) Sign added in v0.2.1

func (m *MockBackend) Sign(arg0 []byte) ([]byte, error)

Sign mocks base method

func (*MockBackend) Start added in v0.2.1

func (m *MockBackend) Start(ctx context.Context, chain consensus.ChainReader, currentBlock func() *types.Block, hasBadBlock func(common.Hash) bool) error

Start mocks base method

func (*MockBackend) Subscribe added in v0.2.1

func (m *MockBackend) Subscribe(types ...interface{}) *event.TypeMuxSubscription

Subscribe mocks base method

func (*MockBackend) SyncPeer added in v0.2.1

func (m *MockBackend) SyncPeer(address common.Address, messages []*Message)

SyncPeer mocks base method

func (*MockBackend) Validators added in v0.2.1

func (m *MockBackend) Validators(number uint64) validator.Set

Validators mocks base method

func (*MockBackend) VerifyHeader added in v0.2.1

func (m *MockBackend) VerifyHeader(chain consensus.ChainReader, header *types.Header, seal bool) error

VerifyHeader mocks base method

func (*MockBackend) VerifyHeaders added in v0.2.1

func (m *MockBackend) VerifyHeaders(chain consensus.ChainReader, headers []*types.Header, seals []bool) (chan<- struct{}, <-chan error)

VerifyHeaders mocks base method

func (*MockBackend) VerifyProposal added in v0.2.1

func (m *MockBackend) VerifyProposal(arg0 types.Block) (time.Duration, error)

VerifyProposal mocks base method

func (*MockBackend) VerifySeal added in v0.2.1

func (m *MockBackend) VerifySeal(chain consensus.ChainReader, header *types.Header) error

VerifySeal mocks base method

func (*MockBackend) VerifyUncles added in v0.2.1

func (m *MockBackend) VerifyUncles(chain consensus.ChainReader, block *types.Block) error

VerifyUncles 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.2.1

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

MockBackendMockRecorder is the mock recorder for MockBackend

func (*MockBackendMockRecorder) APIs added in v0.2.1

func (mr *MockBackendMockRecorder) APIs(chain interface{}) *gomock.Call

APIs indicates an expected call of APIs

func (*MockBackendMockRecorder) Address added in v0.2.1

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(set interface{}) *gomock.Call

AskSync indicates an expected call of AskSync

func (*MockBackendMockRecorder) Author added in v0.2.1

func (mr *MockBackendMockRecorder) Author(header interface{}) *gomock.Call

Author indicates an expected call of Author

func (*MockBackendMockRecorder) Broadcast added in v0.2.1

func (mr *MockBackendMockRecorder) Broadcast(ctx, valSet, payload interface{}) *gomock.Call

Broadcast indicates an expected call of Broadcast

func (*MockBackendMockRecorder) CalcDifficulty added in v0.2.1

func (mr *MockBackendMockRecorder) CalcDifficulty(chain, time, parent interface{}) *gomock.Call

CalcDifficulty indicates an expected call of CalcDifficulty

func (*MockBackendMockRecorder) CheckSignature added in v0.2.1

func (mr *MockBackendMockRecorder) CheckSignature(data, addr, sig interface{}) *gomock.Call

CheckSignature indicates an expected call of CheckSignature

func (*MockBackendMockRecorder) Close added in v0.2.1

func (mr *MockBackendMockRecorder) Close() *gomock.Call

Close indicates an expected call of Close

func (*MockBackendMockRecorder) Commit added in v0.2.1

func (mr *MockBackendMockRecorder) Commit(proposalBlock, seals interface{}) *gomock.Call

Commit indicates an expected call of Commit

func (*MockBackendMockRecorder) Finalize added in v0.2.1

func (mr *MockBackendMockRecorder) Finalize(chain, header, state, txs, uncles interface{}) *gomock.Call

Finalize indicates an expected call of Finalize

func (*MockBackendMockRecorder) FinalizeAndAssemble added in v0.2.1

func (mr *MockBackendMockRecorder) FinalizeAndAssemble(chain, header, state, txs, uncles, receipts interface{}) *gomock.Call

FinalizeAndAssemble indicates an expected call of FinalizeAndAssemble

func (*MockBackendMockRecorder) GetContractABI added in v0.3.0

func (mr *MockBackendMockRecorder) GetContractABI() *gomock.Call

GetContractABI indicates an expected call of GetContractABI

func (*MockBackendMockRecorder) GetContractAddress added in v0.3.0

func (mr *MockBackendMockRecorder) GetContractAddress() *gomock.Call

GetContractAddress indicates an expected call of GetContractAddress

func (*MockBackendMockRecorder) GetProposer added in v0.2.1

func (mr *MockBackendMockRecorder) GetProposer(number interface{}) *gomock.Call

GetProposer indicates an expected call of GetProposer

func (*MockBackendMockRecorder) Gossip added in v0.2.1

func (mr *MockBackendMockRecorder) Gossip(ctx, valSet, payload interface{}) *gomock.Call

Gossip indicates an expected call of Gossip

func (*MockBackendMockRecorder) HandleMsg added in v0.2.1

func (mr *MockBackendMockRecorder) HandleMsg(address, data interface{}) *gomock.Call

HandleMsg indicates an expected call of HandleMsg

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) HasBadProposal added in v0.2.1

func (mr *MockBackendMockRecorder) HasBadProposal(hash interface{}) *gomock.Call

HasBadProposal indicates an expected call of HasBadProposal

func (*MockBackendMockRecorder) LastCommittedProposal added in v0.2.1

func (mr *MockBackendMockRecorder) LastCommittedProposal() *gomock.Call

LastCommittedProposal indicates an expected call of LastCommittedProposal

func (*MockBackendMockRecorder) NewChainHead added in v0.2.1

func (mr *MockBackendMockRecorder) NewChainHead() *gomock.Call

NewChainHead indicates an expected call of NewChainHead

func (*MockBackendMockRecorder) Post added in v0.2.1

func (mr *MockBackendMockRecorder) Post(ev interface{}) *gomock.Call

Post indicates an expected call of Post

func (*MockBackendMockRecorder) Prepare added in v0.2.1

func (mr *MockBackendMockRecorder) Prepare(chain, header interface{}) *gomock.Call

Prepare indicates an expected call of Prepare

func (*MockBackendMockRecorder) Protocol added in v0.2.1

func (mr *MockBackendMockRecorder) Protocol() *gomock.Call

Protocol indicates an expected call of Protocol

func (*MockBackendMockRecorder) ResetPeerCache added in v0.2.1

func (mr *MockBackendMockRecorder) ResetPeerCache(address interface{}) *gomock.Call

ResetPeerCache indicates an expected call of ResetPeerCache

func (*MockBackendMockRecorder) Seal added in v0.2.1

func (mr *MockBackendMockRecorder) Seal(chain, block, results, stop interface{}) *gomock.Call

Seal indicates an expected call of Seal

func (*MockBackendMockRecorder) SealHash added in v0.2.1

func (mr *MockBackendMockRecorder) SealHash(header interface{}) *gomock.Call

SealHash indicates an expected call of SealHash

func (*MockBackendMockRecorder) SetBroadcaster added in v0.2.1

func (mr *MockBackendMockRecorder) SetBroadcaster(arg0 interface{}) *gomock.Call

SetBroadcaster indicates an expected call of SetBroadcaster

func (*MockBackendMockRecorder) SetProposedBlockHash added in v0.2.1

func (mr *MockBackendMockRecorder) SetProposedBlockHash(hash interface{}) *gomock.Call

SetProposedBlockHash indicates an expected call of SetProposedBlockHash

func (*MockBackendMockRecorder) Sign added in v0.2.1

func (mr *MockBackendMockRecorder) Sign(arg0 interface{}) *gomock.Call

Sign indicates an expected call of Sign

func (*MockBackendMockRecorder) Start added in v0.2.1

func (mr *MockBackendMockRecorder) Start(ctx, chain, currentBlock, hasBadBlock interface{}) *gomock.Call

Start indicates an expected call of Start

func (*MockBackendMockRecorder) Subscribe added in v0.2.1

func (mr *MockBackendMockRecorder) Subscribe(types ...interface{}) *gomock.Call

Subscribe indicates an expected call of Subscribe

func (*MockBackendMockRecorder) SyncPeer added in v0.2.1

func (mr *MockBackendMockRecorder) SyncPeer(address, messages interface{}) *gomock.Call

SyncPeer indicates an expected call of SyncPeer

func (*MockBackendMockRecorder) Validators added in v0.2.1

func (mr *MockBackendMockRecorder) Validators(number interface{}) *gomock.Call

Validators indicates an expected call of Validators

func (*MockBackendMockRecorder) VerifyHeader added in v0.2.1

func (mr *MockBackendMockRecorder) VerifyHeader(chain, header, seal interface{}) *gomock.Call

VerifyHeader indicates an expected call of VerifyHeader

func (*MockBackendMockRecorder) VerifyHeaders added in v0.2.1

func (mr *MockBackendMockRecorder) VerifyHeaders(chain, headers, seals interface{}) *gomock.Call

VerifyHeaders indicates an expected call of VerifyHeaders

func (*MockBackendMockRecorder) VerifyProposal added in v0.2.1

func (mr *MockBackendMockRecorder) VerifyProposal(arg0 interface{}) *gomock.Call

VerifyProposal indicates an expected call of VerifyProposal

func (*MockBackendMockRecorder) VerifySeal added in v0.2.1

func (mr *MockBackendMockRecorder) VerifySeal(chain, header interface{}) *gomock.Call

VerifySeal indicates an expected call of VerifySeal

func (*MockBackendMockRecorder) VerifyUncles added in v0.2.1

func (mr *MockBackendMockRecorder) VerifyUncles(chain, block interface{}) *gomock.Call

VerifyUncles indicates an expected call of VerifyUncles

func (*MockBackendMockRecorder) WhiteList added in v0.3.0

func (mr *MockBackendMockRecorder) WhiteList() *gomock.Call

WhiteList indicates an expected call of WhiteList

type Proposal added in v0.2.1

type Proposal struct {
	Round      *big.Int
	Height     *big.Int
	ValidRound *big.Int
	// RLP decode sets nil to 0, so 0 = false and 1 = true
	IsValidRoundNil *big.Int
	ProposalBlock   *types.Block
	// contains filtered or unexported fields
}

func NewProposal added in v0.2.1

func NewProposal(r *big.Int, h *big.Int, vr *big.Int, p *types.Block, logger log.Logger) *Proposal

func (*Proposal) DecodeRLP added in v0.2.1

func (p *Proposal) DecodeRLP(s *rlp.Stream) error

DecodeRLP implements rlp.Decoder, and load the consensus fields from a RLP stream.

func (*Proposal) EncodeRLP added in v0.2.1

func (p *Proposal) EncodeRLP(w io.Writer) error

EncodeRLP serializes b into the Ethereum RLP format.

type Step

type Step uint64

func (Step) Cmp

func (s Step) Cmp(y Step) int

func (Step) String

func (s Step) String() string

type TimeoutEvent added in v0.2.1

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

type VerifyHeaderAlwaysTrueEngine added in v0.2.1

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

func NewVerifyHeaderAlwaysTrueEngine added in v0.2.1

func NewVerifyHeaderAlwaysTrueEngine(c consensus.Engine) *VerifyHeaderAlwaysTrueEngine

func (VerifyHeaderAlwaysTrueEngine) APIs added in v0.2.1

func (c VerifyHeaderAlwaysTrueEngine) APIs(chain consensus.ChainReader) []rpc.API

func (VerifyHeaderAlwaysTrueEngine) Author added in v0.2.1

func (c VerifyHeaderAlwaysTrueEngine) Author(header *types.Header) (common.Address, error)

func (VerifyHeaderAlwaysTrueEngine) CalcDifficulty added in v0.2.1

func (c VerifyHeaderAlwaysTrueEngine) CalcDifficulty(chain consensus.ChainReader, time uint64, parent *types.Header) *big.Int

func (VerifyHeaderAlwaysTrueEngine) Close added in v0.2.1

func (c VerifyHeaderAlwaysTrueEngine) Close() error

func (VerifyHeaderAlwaysTrueEngine) Finalize added in v0.2.1

func (c VerifyHeaderAlwaysTrueEngine) Finalize(chain consensus.ChainReader, header *types.Header, state *state.StateDB, txs []*types.Transaction,
	uncles []*types.Header)

func (VerifyHeaderAlwaysTrueEngine) FinalizeAndAssemble added in v0.2.1

func (c VerifyHeaderAlwaysTrueEngine) FinalizeAndAssemble(chain consensus.ChainReader, header *types.Header, state *state.StateDB, txs []*types.Transaction,
	uncles []*types.Header, receipts []*types.Receipt) (*types.Block, error)

func (VerifyHeaderAlwaysTrueEngine) GetCurrentHeightMessages added in v0.2.1

func (c VerifyHeaderAlwaysTrueEngine) GetCurrentHeightMessages() []*Message

func (VerifyHeaderAlwaysTrueEngine) HandleMsg added in v0.2.1

func (c VerifyHeaderAlwaysTrueEngine) HandleMsg(address common.Address, data p2p.Msg) (bool, error)

func (VerifyHeaderAlwaysTrueEngine) IsValidator added in v0.2.1

func (c VerifyHeaderAlwaysTrueEngine) IsValidator(address common.Address) bool

func (VerifyHeaderAlwaysTrueEngine) NewChainHead added in v0.2.1

func (c VerifyHeaderAlwaysTrueEngine) NewChainHead() error

func (VerifyHeaderAlwaysTrueEngine) Prepare added in v0.2.1

func (c VerifyHeaderAlwaysTrueEngine) Prepare(chain consensus.ChainReader, header *types.Header) error

func (VerifyHeaderAlwaysTrueEngine) Protocol added in v0.2.1

func (c VerifyHeaderAlwaysTrueEngine) Protocol() (protocolName string, extraMsgCodes uint64)

func (VerifyHeaderAlwaysTrueEngine) Quorum added in v0.2.1

func (c VerifyHeaderAlwaysTrueEngine) Quorum(i int) bool

func (VerifyHeaderAlwaysTrueEngine) ResetPeerCache added in v0.2.1

func (c VerifyHeaderAlwaysTrueEngine) ResetPeerCache(address common.Address)

func (VerifyHeaderAlwaysTrueEngine) Seal added in v0.2.1

func (c VerifyHeaderAlwaysTrueEngine) Seal(chain consensus.ChainReader, block *types.Block, results chan<- *types.Block, stop <-chan struct{}) error

func (VerifyHeaderAlwaysTrueEngine) SealHash added in v0.2.1

func (c VerifyHeaderAlwaysTrueEngine) SealHash(header *types.Header) common.Hash

func (VerifyHeaderAlwaysTrueEngine) SetBroadcaster added in v0.2.1

func (c VerifyHeaderAlwaysTrueEngine) SetBroadcaster(b consensus.Broadcaster)

func (VerifyHeaderAlwaysTrueEngine) Start added in v0.2.1

func (c VerifyHeaderAlwaysTrueEngine) Start(ctx context.Context, chain consensus.ChainReader, currentBlock func() *types.Block, hasBadBlock func(hash common.Hash) bool) error

Start implements core.Engine.Start

func (VerifyHeaderAlwaysTrueEngine) Stop added in v0.2.1

func (c VerifyHeaderAlwaysTrueEngine) Stop() error

Stop implements core.Engine.Stop

func (VerifyHeaderAlwaysTrueEngine) SyncPeer added in v0.2.1

func (c VerifyHeaderAlwaysTrueEngine) SyncPeer(address common.Address)

Synchronize new connected peer with current height state

func (*VerifyHeaderAlwaysTrueEngine) VerifyHeader added in v0.2.1

func (VerifyHeaderAlwaysTrueEngine) VerifyHeaders added in v0.2.1

func (c VerifyHeaderAlwaysTrueEngine) VerifyHeaders(chain consensus.ChainReader, headers []*types.Header, seals []bool) (chan<- struct{}, <-chan error)

func (VerifyHeaderAlwaysTrueEngine) VerifySeal added in v0.2.1

func (c VerifyHeaderAlwaysTrueEngine) VerifySeal(chain consensus.ChainReader, header *types.Header) error

func (VerifyHeaderAlwaysTrueEngine) VerifyUncles added in v0.2.1

func (c VerifyHeaderAlwaysTrueEngine) VerifyUncles(chain consensus.ChainReader, block *types.Block) error

type Vote added in v0.2.1

type Vote struct {
	Round             *big.Int
	Height            *big.Int
	ProposedBlockHash common.Hash
}

func (*Vote) DecodeRLP added in v0.2.1

func (sub *Vote) DecodeRLP(s *rlp.Stream) error

DecodeRLP implements rlp.Decoder, and load the consensus fields from a RLP stream.

func (*Vote) EncodeRLP added in v0.2.1

func (sub *Vote) EncodeRLP(w io.Writer) error

EncodeRLP serializes b into the Ethereum RLP format.

func (*Vote) String added in v0.2.1

func (sub *Vote) String() string

Jump to

Keyboard shortcuts

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