memstore

package
v0.0.0-...-8b8382b Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2019 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

MemStore is 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]*legacy.Block
	State       *state.Snapshot
	StateHeight uint64
	// contains filtered or unexported fields
}

MemStore satisfies the 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) (*legacy.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 *legacy.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