Documentation ¶
Overview ¶
Package memstore is a protocol.Store implementation that keeps all blockchain state in memory.
It is used in tests to avoid needing a database.
Index ¶
- type MemStore
- func (m *MemStore) FinalizeHeight(context.Context, uint64) error
- func (m *MemStore) GetBlock(ctx context.Context, height uint64) (*bc.Block, error)
- func (m *MemStore) Height(context.Context) (uint64, error)
- func (m *MemStore) LatestSnapshot(context.Context) (*state.Snapshot, error)
- func (m *MemStore) SaveBlock(ctx context.Context, b *bc.Block) error
- func (m *MemStore) SaveSnapshot(ctx context.Context, snapshot *state.Snapshot) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemStore ¶
type MemStore struct { Blocks map[uint64]*bc.Block State *state.Snapshot // contains filtered or unexported fields }
MemStore satisfies the Store interface.
func (*MemStore) FinalizeHeight ¶
FinalizeHeight satisfies the protocol.Store interface.
func (*MemStore) LatestSnapshot ¶
LatestSnapshot satisfies the protocol.Store interface.
Click to show internal directories.
Click to hide internal directories.