diffdb

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2021 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Diff

type Diff map[common.Address][]Key

type DiffDb

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

/ A DiffDb is a thin wrapper around an Sqlite3 connection. / / Its purpose is to store and fetch the storage keys corresponding to an address that was / touched in a block.

func NewDiffDb

func NewDiffDb(path string, cache uint64) (*DiffDb, error)

/ Instantiates a new DiffDb using sqlite at `path`, with `cache` insertions / done in a transaction before it gets committed to the database.

func (*DiffDb) Close

func (diff *DiffDb) Close() error

func (*DiffDb) ForceCommit

func (diff *DiffDb) ForceCommit() error

/ Commits a pending diffdb transaction

func (*DiffDb) GetDiff

func (diff *DiffDb) GetDiff(blockNum *big.Int) (Diff, error)

/ Gets all the rows for the matching block and converts them to a Diff map.

func (*DiffDb) SetDiffAccount

func (diff *DiffDb) SetDiffAccount(block *big.Int, address common.Address) error

/ Inserts a new row to the sqlite indicating that the account was modified in that block / at a pre-set key

func (*DiffDb) SetDiffKey

func (diff *DiffDb) SetDiffKey(block *big.Int, address common.Address, key common.Hash, mutated bool) error

/ Inserts a new row to the sqlite with the provided diff data.

type Key

type Key struct {
	Key     common.Hash
	Mutated bool
}

Jump to

Keyboard shortcuts

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