memstore

package
v0.44.1 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2023 License: Apache-2.0 Imports: 8 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store implements the Store interface with an in-memory store.

func New

func New() *Store

New returns a new in-memory Store implementation.

func (*Store) BlockByHeight

func (s *Store) BlockByHeight(ctx context.Context, height uint64) (*flowgo.Block, error)

func (*Store) BlockByID

func (s *Store) BlockByID(ctx context.Context, blockID flowgo.Identifier) (*flowgo.Block, error)

func (*Store) CollectionByID

func (s *Store) CollectionByID(
	ctx context.Context,
	collectionID flowgo.Identifier,
) (flowgo.LightCollection, error)

func (*Store) CommitBlock

func (s *Store) CommitBlock(
	ctx context.Context,
	block flowgo.Block,
	collections []*flowgo.LightCollection,
	transactions map[flowgo.Identifier]*flowgo.TransactionBody,
	transactionResults map[flowgo.Identifier]*types.StorableTransactionResult,
	delta delta.Delta,
	events []flowgo.Event,
) error

func (*Store) EventsByHeight

func (s *Store) EventsByHeight(
	ctx context.Context,
	blockHeight uint64,
	eventType string,
) ([]flowgo.Event, error)

func (*Store) LatestBlock

func (s *Store) LatestBlock(ctx context.Context) (flowgo.Block, error)

func (*Store) LatestBlockHeight added in v0.42.0

func (s *Store) LatestBlockHeight(ctx context.Context) (uint64, error)

func (*Store) LedgerViewByHeight

func (s *Store) LedgerViewByHeight(ctx context.Context, blockHeight uint64) *delta.View

func (*Store) StoreBlock

func (s *Store) StoreBlock(ctx context.Context, block *flowgo.Block) error

func (*Store) TransactionByID

func (s *Store) TransactionByID(
	ctx context.Context,
	transactionID flowgo.Identifier,
) (flowgo.TransactionBody, error)

func (*Store) TransactionResultByID

func (s *Store) TransactionResultByID(
	ctx context.Context,
	transactionID flowgo.Identifier,
) (types.StorableTransactionResult, error)

func (*Store) UnsafeInsertLedgerDelta

func (s *Store) UnsafeInsertLedgerDelta(blockHeight uint64, delta delta.Delta) error

Jump to

Keyboard shortcuts

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