6 "github.com/vapor/database/storage"
7 "github.com/vapor/protocol/bc"
8 "github.com/vapor/protocol/bc/types"
9 "github.com/vapor/protocol/state"
13 ErrNotFoundVoteResult = errors.New("can't find the vote result by given sequence")
16 // Store provides storage interface for blockchain data
17 type Store interface {
18 BlockExist(*bc.Hash) bool
20 GetBlock(*bc.Hash) (*types.Block, error)
21 GetStoreStatus() *BlockStoreState
22 GetTransactionStatus(*bc.Hash) (*bc.TransactionStatus, error)
23 GetTransactionsUtxo(*state.UtxoViewpoint, []*bc.Tx) error
24 GetUtxo(*bc.Hash) (*storage.UtxoEntry, error)
25 GetVoteResult(uint64) (*state.VoteResult, error)
27 LoadBlockIndex(uint64) (*state.BlockIndex, error)
28 SaveBlock(*types.Block, *bc.TransactionStatus) error
29 SaveChainStatus(*state.BlockNode, *state.BlockNode, *state.UtxoViewpoint, map[uint64]*state.VoteResult) error
30 SaveChainNodeStatus(*state.BlockNode, *state.BlockNode) error
33 // BlockStoreState represents the core's db status
34 type BlockStoreState struct {
37 IrreversibleHeight uint64
38 IrreversibleHash *bc.Hash