iavl

package
v2.0.0-...-fe22e9a Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	CacheSize              int  `mapstructure:"cache_size"`
	SkipFastStorageUpgrade bool `mapstructure:"skip_fast_storage_upgrade"`
}

Config is the configuration for the IAVL tree.

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns the default configuration for the IAVL tree.

type Exporter

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

Exporter is a wrapper around iavl.Exporter.

func (*Exporter) Close

func (e *Exporter) Close() error

Close closes the exporter.

func (*Exporter) Next

Next returns the next item in the exporter.

type IavlTree

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

IavlTree is a wrapper around iavl.MutableTree.

func NewIavlTree

func NewIavlTree(db corestore.KVStoreWithBatch, logger log.Logger, cfg *Config) *IavlTree

NewIavlTree creates a new IavlTree instance.

func (*IavlTree) Close

func (t *IavlTree) Close() error

Close closes the iavl tree.

func (*IavlTree) Commit

func (t *IavlTree) Commit() ([]byte, uint64, error)

Commit commits the current state to the tree.

func (*IavlTree) Export

func (t *IavlTree) Export(version uint64) (commitment.Exporter, error)

Export exports the tree exporter at the given version.

func (*IavlTree) Get

func (t *IavlTree) Get(version uint64, key []byte) ([]byte, error)

func (*IavlTree) GetLatestVersion

func (t *IavlTree) GetLatestVersion() uint64

GetLatestVersion returns the latest version of the tree.

func (*IavlTree) GetProof

func (t *IavlTree) GetProof(version uint64, key []byte) (*ics23.CommitmentProof, error)

GetProof returns a proof for the given key and version.

func (*IavlTree) Hash

func (t *IavlTree) Hash() []byte

Hash returns the hash of the latest saved version of the tree.

func (*IavlTree) Import

func (t *IavlTree) Import(version uint64) (commitment.Importer, error)

Import imports the tree importer at the given version.

func (*IavlTree) LoadVersion

func (t *IavlTree) LoadVersion(version uint64) error

LoadVersion loads the state at the given version.

func (*IavlTree) PausePruning

func (t *IavlTree) PausePruning(pause bool)

PausePruning pauses the pruning process.

func (*IavlTree) Prune

func (t *IavlTree) Prune(version uint64) error

Prune prunes all versions up to and including the provided version.

func (*IavlTree) Remove

func (t *IavlTree) Remove(key []byte) error

Remove removes the given key from the tree.

func (*IavlTree) Set

func (t *IavlTree) Set(key, value []byte) error

Set sets the given key-value pair in the tree.

func (*IavlTree) SetInitialVersion

func (t *IavlTree) SetInitialVersion(version uint64) error

SetInitialVersion sets the initial version of the database.

func (*IavlTree) WorkingHash

func (t *IavlTree) WorkingHash() []byte

WorkingHash returns the working hash of the tree.

type Importer

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

Importer is a wrapper around iavl.Importer.

func (*Importer) Add

Add adds the given item to the importer.

func (*Importer) Close

func (i *Importer) Close() error

Close closes the importer.

func (*Importer) Commit

func (i *Importer) Commit() error

Commit commits the importer.

Jump to

Keyboard shortcuts

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