store

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2023 License: LGPL-3.0 Imports: 5 Imported by: 4 modules, 6 packages

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

View Source
var (
	ErrNotFound = errors.New("key not found")
)

Functions

This section is empty.

Types

type BlockStore

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

func NewBlockStore

func NewBlockStore(db KeyValueReaderWriter) *BlockStore

func (*BlockStore) GetLastStoredBlock

func (bs *BlockStore) GetLastStoredBlock(domainID uint8) (*big.Int, error)

GetLastStoredBlock queries the blockstore and returns latest known block

func (*BlockStore) GetStartBlock

func (bs *BlockStore) GetStartBlock(domainID uint8, startBlock *big.Int, latest bool, fresh bool) (*big.Int, error)

GetStartBlock queries the blockstore for the latest known block. If the latest block is greater than configured startBlock, then startBlock is replaced with the latest known block.

func (*BlockStore) StoreBlock

func (bs *BlockStore) StoreBlock(block *big.Int, domainID uint8) error

StoreBlock stores block number per domainID into blockstore

type KeyValueReader

type KeyValueReader interface {
	GetByKey(key []byte) ([]byte, error)
}

type KeyValueReaderWriter

type KeyValueReaderWriter interface {
	KeyValueReader
	KeyValueWriter
}

type KeyValueWriter

type KeyValueWriter interface {
	SetByKey(key []byte, value []byte) error
}

type NonceStore

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

func NewNonceStore

func NewNonceStore(db KeyValueReaderWriter) *NonceStore

func (*NonceStore) GetNonce

func (ns *NonceStore) GetNonce(chainID *big.Int) (*big.Int, error)

GetNonce queries the blockstore and returns latest nonce

func (*NonceStore) StoreNonce

func (ns *NonceStore) StoreNonce(chainID *big.Int, nonce *big.Int) error

StoreNonce stores nonce per chainID

Directories

Path Synopsis
Package mock_blockstore is a generated GoMock package.
Package mock_blockstore is a generated GoMock package.

Jump to

Keyboard shortcuts

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