4 "github.com/vapor/chain"
5 "github.com/vapor/common"
6 "github.com/vapor/protocol/bc"
7 "github.com/vapor/protocol/bc/types"
10 type AddressBalance struct {
15 type DelegateInterface interface {
16 ConsensusName() string
19 // Engine is an algorithm agnostic consensus engine.
20 type Engine interface {
21 Init(c chain.Chain, delegateNumber, intervalTime, blockHeight uint64, blockHash bc.Hash) error
23 IsMining(address common.Address, t uint64) (interface{}, error)
24 ProcessRegister(delegateAddress string, delegateName string, hash bc.Hash, height uint64) bool
25 ProcessVote(voterAddress string, delegates []string, hash bc.Hash, height uint64) bool
26 ProcessCancelVote(voterAddress string, delegates []string, hash bc.Hash, height uint64) bool
27 UpdateAddressBalance(addressBalance []AddressBalance)
28 CheckBlockHeader(header types.BlockHeader) error
29 CheckBlock(block types.Block, fIsCheckDelegateInfo bool) error
30 IsValidBlockCheckIrreversibleBlock(height uint64, hash bc.Hash) error
31 GetOldBlockHeight() uint64
32 GetOldBlockHash() bc.Hash