-// Store provides storage for blockchain data: blocks and state tree
-// snapshots.
-//
-// Note, this is different from a state snapshot. A state snapshot
-// provides access to the state at a given point in time -- outputs
-// and issuance memory. The Chain type uses Store to load state
-// from storage and persist validated data.
-type Store interface {
- Height() uint64
- GetBlock(uint64) (*legacy.Block, error)
- LatestSnapshot(context.Context) (*state.Snapshot, uint64, error)
-
- SaveBlock(*legacy.Block) error
- FinalizeBlock(context.Context, uint64) error
- SaveSnapshot(context.Context, uint64, *state.Snapshot) error
+// NewChain returns a new Chain using store as the underlying storage.
+func NewChain(store Store, txPool *TxPool) (*Chain, error) {
+ return NewChainWithOrphanManage(store, txPool, NewOrphanManage())