gaskv

package
v0.48.86 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store applies gas tracking to an underlying KVStore. It implements the KVStore interface.

func NewStore

func NewStore(parent types.KVStore, gasMeter types.GasMeter, gasConfig types.GasConfig) *Store

NewStore returns a reference to a new GasKVStore.

func (*Store) CacheWrap

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

Implements KVStore.

func (*Store) CacheWrapWithTrace

func (gs *Store) CacheWrapWithTrace(_ io.Writer, _ types.TraceContext) types.CacheWrap

CacheWrapWithTrace implements the KVStore interface.

func (*Store) Delete

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

Implements KVStore.

func (*Store) Get

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

Implements KVStore.

func (*Store) GetStoreType

func (gs *Store) GetStoreType() types.StoreType

Implements Store.

func (*Store) Has

func (gs *Store) Has(key []byte) bool

Implements KVStore.

func (*Store) Iterator

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

Iterator implements the KVStore interface. It returns an iterator which incurs a flat gas cost for seeking to the first key/value pair and a variable gas cost based on the current value's length if the iterator is valid.

func (*Store) ReverseIterator

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

ReverseIterator implements the KVStore interface. It returns a reverse iterator which incurs a flat gas cost for seeking to the first key/value pair and a variable gas cost based on the current value's length if the iterator is valid.

func (*Store) Set

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

Implements KVStore.

Jump to

Keyboard shortcuts

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