iavl

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2024 License: Apache-2.0, UNKNOWN not legal advice Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StoreConstructor

func StoreConstructor(db dbm.DB, opts types.StoreOptions) types.CommitStore

Implements store.CommitStoreConstructor.

Types

type Store

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

Store Implements types.Store and CommitStore.

func UnsafeNewStore

func UnsafeNewStore(tree *iavl.MutableTree, opts types.StoreOptions) *Store

func (*Store) CacheWrap

func (st *Store) CacheWrap() types.Store

Implements Store.

func (*Store) Commit

func (st *Store) Commit() types.CommitID

Implements Committer.

func (*Store) Delete

func (st *Store) Delete(key []byte)

Implements types.Store.

func (*Store) Get

func (st *Store) Get(key []byte) (value []byte)

Implements types.Store.

func (*Store) GetImmutable

func (st *Store) GetImmutable(version int64) (*Store, error)

GetImmutable returns a reference to a new store backed by an immutable IAVL tree at a specific version (height) without any pruning options. This should be used for querying and iteration only. If the version does not exist or has been pruned, an error will be returned. Any mutable operations executed will result in a panic.

func (*Store) GetStoreOptions

func (st *Store) GetStoreOptions() types.StoreOptions

Implements Committer.

func (*Store) Has

func (st *Store) Has(key []byte) (exists bool)

Implements types.Store.

func (*Store) Iterator

func (st *Store) Iterator(start, end []byte) types.Iterator

Implements types.Store.

func (*Store) LastCommitID

func (st *Store) LastCommitID() types.CommitID

Implements Committer.

func (*Store) LoadLatestVersion

func (st *Store) LoadLatestVersion() error

Implements Committer.

func (*Store) LoadVersion

func (st *Store) LoadVersion(ver int64) error

Implements Committer.

func (*Store) Query

func (st *Store) Query(req abci.RequestQuery) (res abci.ResponseQuery)

Query implements ABCI interface, allows queries

by default we will return from (latest height -1), as we will have merkle proofs immediately (header height = data height + 1) If latest-1 is not present, use latest (which must be present) if you care to have the latest data to see a tx results, you must explicitly set the height you want to see

func (*Store) ReverseIterator

func (st *Store) ReverseIterator(start, end []byte) types.Iterator

Implements types.Store.

func (*Store) Set

func (st *Store) Set(key, value []byte)

Implements types.Store.

func (*Store) SetStoreOptions

func (st *Store) SetStoreOptions(opts2 types.StoreOptions)

Implements Committer.

func (*Store) VersionExists

func (st *Store) VersionExists(version int64) bool

VersionExists returns whether or not a given version is stored.

func (*Store) Write

func (st *Store) Write()

Implements Store.

type Tree

type Tree interface {
	Has(key []byte) bool
	Get(key []byte) (index int64, value []byte)
	Set(key, value []byte) bool
	Remove(key []byte) ([]byte, bool)
	SaveVersion() ([]byte, int64, error)
	DeleteVersion(version int64) error
	Version() int64
	Hash() []byte
	LatestVersion() int64
	VersionExists(version int64) bool
	GetVersioned(key []byte, version int64) (int64, []byte)
	GetVersionedWithProof(key []byte, version int64) ([]byte, *iavl.RangeProof, error)
	GetImmutable(version int64) (*iavl.ImmutableTree, error)
}

Tree defines an interface that both mutable and immutable IAVL trees must implement. For mutable IAVL trees, the interface is directly implemented by an iavl.MutableTree. For an immutable IAVL tree, a wrapper must be made.

Jump to

Keyboard shortcuts

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