Versions in this module Expand all Collapse all v1 v1.0.0 May 26, 2022 Changes in this version + type BlockStoreState struct + FinalizedHash *bc.Hash + FinalizedHeight uint64 + Hash *bc.Hash + Height uint64 + type Checkpoint struct + Hash bc.Hash + Height uint64 + Parent *Checkpoint + ParentHash bc.Hash + Rewards map[string]uint64 + Status CheckpointStatus + SupLinks []*types.SupLink + Timestamp uint64 + Votes map[string]uint64 + func NewCheckpoint(parent *Checkpoint) *Checkpoint + func (c *Checkpoint) AddVerification(sourceHash bc.Hash, sourceHeight uint64, validatorOrder int, signature []byte) *types.SupLink + func (c *Checkpoint) AllValidators() []*Validator + func (c *Checkpoint) ContainsVerification(validatorOrder int, sourceHash *bc.Hash) bool + func (c *Checkpoint) EffectiveValidators() map[string]*Validator + func (c *Checkpoint) GetValidator(timeStamp uint64) *Validator + func (c *Checkpoint) Increase(block *types.Block) error + type CheckpointStatus uint8 + const Finalized + const Growing + const Justified + const Unjustified + type ContractViewpoint struct + AttachEntries map[[32]byte][]byte + DetachEntries map[[32]byte][]byte + func NewContractViewpoint() *ContractViewpoint + func (view *ContractViewpoint) ApplyBlock(block *types.Block) error + func (view *ContractViewpoint) DetachBlock(block *types.Block) error + type Store interface + BlockExist func(*bc.Hash) bool + CheckpointsFromNode func(height uint64, hash *bc.Hash) ([]*Checkpoint, error) + GetBlock func(*bc.Hash) (*types.Block, error) + GetBlockHeader func(*bc.Hash) (*types.BlockHeader, error) + GetCheckpoint func(*bc.Hash) (*Checkpoint, error) + GetCheckpointsByHeight func(uint64) ([]*Checkpoint, error) + GetContract func(hash [32]byte) ([]byte, error) + GetMainChainHash func(uint64) (*bc.Hash, error) + GetStoreStatus func() *BlockStoreState + GetTransactionsUtxo func(*UtxoViewpoint, []*bc.Tx) error + GetUtxo func(*bc.Hash) (*storage.UtxoEntry, error) + SaveBlock func(*types.Block) error + SaveBlockHeader func(*types.BlockHeader) error + SaveChainStatus func(*types.BlockHeader, []*types.BlockHeader, *UtxoViewpoint, *ContractViewpoint, ...) error + SaveCheckpoints func([]*Checkpoint) error + type UtxoViewpoint struct + Entries map[bc.Hash]*storage.UtxoEntry + func NewUtxoViewpoint() *UtxoViewpoint + func (view *UtxoViewpoint) ApplyBlock(block *bc.Block) error + func (view *UtxoViewpoint) ApplyTransaction(block *bc.Block, tx *bc.Tx) error + func (view *UtxoViewpoint) CanSpend(hash *bc.Hash) bool + func (view *UtxoViewpoint) DetachBlock(block *bc.Block) error + func (view *UtxoViewpoint) DetachTransaction(tx *bc.Tx) error + func (view *UtxoViewpoint) HasUtxo(hash *bc.Hash) bool + type Validator struct + Order int + PubKey string + VoteNum uint64