pebble

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 17 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Accounts

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

func NewAccounts

func NewAccounts(db *Storage) *Accounts

func (*Accounts) GetBalance

func (a *Accounts) GetBalance(address *common.Address) (*big.Int, error)

func (*Accounts) GetNonce

func (a *Accounts) GetNonce(address *common.Address) (uint64, error)

func (*Accounts) Update

func (a *Accounts) Update(
	tx models.Transaction,
	receipt *gethTypes.Receipt,
) error

type Blocks

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

func NewBlocks

func NewBlocks(store *Storage) *Blocks

func (*Blocks) GetByHeight

func (b *Blocks) GetByHeight(height uint64) (*types.Block, error)

func (*Blocks) GetByID

func (b *Blocks) GetByID(ID common.Hash) (*types.Block, error)

func (*Blocks) GetCadenceHeight

func (b *Blocks) GetCadenceHeight(evmHeight uint64) (uint64, error)

func (*Blocks) GetHeightByID added in v0.7.0

func (b *Blocks) GetHeightByID(ID common.Hash) (uint64, error)

func (*Blocks) InitHeights added in v0.2.0

func (b *Blocks) InitHeights(cadenceHeight uint64) error

InitHeights sets the Cadence height to zero as well as EVM heights. Used for empty database init.

func (*Blocks) LatestCadenceHeight

func (b *Blocks) LatestCadenceHeight() (uint64, error)

func (*Blocks) LatestEVMHeight

func (b *Blocks) LatestEVMHeight() (uint64, error)

func (*Blocks) SetLatestCadenceHeight added in v0.2.0

func (b *Blocks) SetLatestCadenceHeight(height uint64) error

func (*Blocks) Store

func (b *Blocks) Store(cadenceHeight uint64, block *types.Block) error

type Receipts

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

func NewReceipts

func NewReceipts(store *Storage) *Receipts

func (*Receipts) BloomsForBlockRange

func (r *Receipts) BloomsForBlockRange(start, end *big.Int) ([]*gethTypes.Bloom, []*big.Int, error)

func (*Receipts) GetByBlockHeight

func (r *Receipts) GetByBlockHeight(height *big.Int) ([]*gethTypes.Receipt, error)

func (*Receipts) GetByTransactionID

func (r *Receipts) GetByTransactionID(ID common.Hash) (*gethTypes.Receipt, error)

func (*Receipts) Store

func (r *Receipts) Store(receipt *gethTypes.Receipt) error

Store receipt in the index.

Storing receipt will create multiple indexes, each receipt has a transaction ID, and a block height. We create following mappings: - receipt transaction ID => block height bytes - receipt block height => list of encoded receipts (1+ per block) - receipt block height => list of bloom filters (1+ per block)

type Storage

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

func New

func New(dir string, log zerolog.Logger) (*Storage, error)

New creates a new storage instance using the provided dir location as the storage directory.

type Transactions

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

func NewTransactions

func NewTransactions(store *Storage) *Transactions

func (*Transactions) Get

func (*Transactions) Store

func (t *Transactions) Store(tx models.Transaction) error

Jump to

Keyboard shortcuts

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