memstore

package
v0.0.0-...-4e0ae02 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 29, 2016 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package memstore provides a Store implementation that keeps all blockchain state in memory.

It is used in tests to avoid needing a database.

Index

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
	StateHeight uint64
	// contains filtered or unexported fields
}

MemStore satisfies the protocol.Store interface.

func New

func New() *MemStore

New returns a new MemStore

func (*MemStore) FinalizeBlock

func (m *MemStore) FinalizeBlock(context.Context, uint64) error

func (*MemStore) GetBlock

func (m *MemStore) GetBlock(ctx context.Context, height uint64) (*bc.Block, error)

func (*MemStore) Height

func (m *MemStore) Height(context.Context) (uint64, error)

func (*MemStore) LatestSnapshot

func (m *MemStore) LatestSnapshot(context.Context) (*state.Snapshot, uint64, error)

func (*MemStore) SaveBlock

func (m *MemStore) SaveBlock(ctx context.Context, b *bc.Block) error

func (*MemStore) SaveSnapshot

func (m *MemStore) SaveSnapshot(ctx context.Context, height uint64, snapshot *state.Snapshot) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL