states

package
v0.0.0-...-cb9e034 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2022 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type State

State persistently maintains a set of UTXOs, transaction, statuses, and singletons.

func New

func New(db database.Database, parser txs.Parser, metrics prometheus.Registerer) (State, error)

type TxState

type TxState interface {
	// Tx attempts to load a transaction from storage.
	GetTx(txID ids.ID) (*txs.Tx, error)

	// PutTx saves the provided transaction to storage.
	PutTx(txID ids.ID, tx *txs.Tx) error

	// DeleteTx removes the provided transaction from storage.
	DeleteTx(txID ids.ID) error
}

TxState is a thin wrapper around a database to provide, caching, serialization, and de-serialization of transactions.

func NewTxState

func NewTxState(db database.Database, parser txs.Parser, metrics prometheus.Registerer) (TxState, error)

Jump to

Keyboard shortcuts

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