db

package
v0.0.0-...-92d349b Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const TableAccountValues = "HermezSmtAccountValues"
View Source
const TableLastRoot = "HermezSmtLastRoot"
View Source
const TableSmt = "HermezSmt"

Variables

This section is empty.

Functions

This section is empty.

Types

type EriDb

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

func NewEriDb

func NewEriDb(tx kv.RwTx) (*EriDb, error)

func (*EriDb) CommitBatch

func (m *EriDb) CommitBatch() error

func (*EriDb) Delete

func (m *EriDb) Delete(key string) error

func (*EriDb) Get

func (m *EriDb) Get(key utils.NodeKey) (utils.NodeValue12, error)

func (*EriDb) GetAccountValue

func (m *EriDb) GetAccountValue(key utils.NodeKey) (utils.NodeValue8, error)

func (*EriDb) GetDb

func (m *EriDb) GetDb() map[string][]string

func (*EriDb) GetLastRoot

func (m *EriDb) GetLastRoot() (*big.Int, error)

func (*EriDb) Insert

func (m *EriDb) Insert(key utils.NodeKey, value utils.NodeValue12) error

func (*EriDb) InsertAccountValue

func (m *EriDb) InsertAccountValue(key utils.NodeKey, value utils.NodeValue8) error

func (*EriDb) OpenBatch

func (m *EriDb) OpenBatch(quitCh <-chan struct{})

func (*EriDb) PrintDb

func (m *EriDb) PrintDb()

func (*EriDb) RollbackBatch

func (m *EriDb) RollbackBatch()

func (*EriDb) SetLastRoot

func (m *EriDb) SetLastRoot(r *big.Int) error

type MemDb

type MemDb struct {
	Db       map[string][]string
	DbAccVal map[string][]string
	LastRoot *big.Int
	// contains filtered or unexported fields
}

func NewMemDb

func NewMemDb() *MemDb

func (*MemDb) CommitBatch

func (m *MemDb) CommitBatch() error

func (*MemDb) Delete

func (m *MemDb) Delete(key string) error

func (*MemDb) Get

func (m *MemDb) Get(key utils.NodeKey) (utils.NodeValue12, error)

func (*MemDb) GetAccountValue

func (m *MemDb) GetAccountValue(key utils.NodeKey) (utils.NodeValue8, error)

func (*MemDb) GetDb

func (m *MemDb) GetDb() map[string][]string

func (*MemDb) GetLastRoot

func (m *MemDb) GetLastRoot() (*big.Int, error)

func (*MemDb) Insert

func (m *MemDb) Insert(key utils.NodeKey, value utils.NodeValue12) error

func (*MemDb) InsertAccountValue

func (m *MemDb) InsertAccountValue(key utils.NodeKey, value utils.NodeValue8) error

func (*MemDb) IsEmpty

func (m *MemDb) IsEmpty() bool

func (*MemDb) OpenBatch

func (m *MemDb) OpenBatch(quitCh <-chan struct{})

func (*MemDb) PrintDb

func (m *MemDb) PrintDb()

func (*MemDb) RollbackBatch

func (m *MemDb) RollbackBatch()

func (*MemDb) SetLastRoot

func (m *MemDb) SetLastRoot(value *big.Int) error

type SmtDbTx

type SmtDbTx interface {
	GetOne(bucket string, key []byte) ([]byte, error)
	Put(bucket string, key []byte, value []byte) error
	Has(bucket string, key []byte) (bool, error)
	Delete(bucket string, key []byte) error
	ForEach(bucket string, start []byte, fn func(k, v []byte) error) error
	ForPrefix(bucket string, prefix []byte, fn func(k, v []byte) error) error
	Commit() error
	Rollback()
}

Jump to

Keyboard shortcuts

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