ss

package
v0.0.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const StoreTypeSeiStateStore = 100

Variables

This section is empty.

Functions

This section is empty.

Types

type ImportEntry

type ImportEntry struct {
	StoreKey string
	Key      []byte
	Value    []byte
}

type MultiStore

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

MultiStore wraps `StateStore` to implement `MultiStore` interface.

func NewMultiStore

func NewMultiStore(store StateStore, storeKeys []types.StoreKey) *MultiStore

NewMultiStore returns a new state store `MultiStore`.

func (*MultiStore) AddListeners

func (s *MultiStore) AddListeners(key types.StoreKey, listeners []types.WriteListener)

func (*MultiStore) CacheMultiStore

func (s *MultiStore) CacheMultiStore() types.CacheMultiStore

func (*MultiStore) CacheMultiStoreWithVersion

func (s *MultiStore) CacheMultiStoreWithVersion(version int64) (types.CacheMultiStore, error)

func (*MultiStore) CacheWrap

func (s *MultiStore) CacheWrap(storeKey types.StoreKey) types.CacheWrap

func (*MultiStore) CacheWrapWithListeners

func (s *MultiStore) CacheWrapWithListeners(storeKey types.StoreKey, listeners []types.WriteListener) types.CacheWrap

func (*MultiStore) CacheWrapWithTrace

func (s *MultiStore) CacheWrapWithTrace(storeKey types.StoreKey, w io.Writer, tc types.TraceContext) types.CacheWrap

func (*MultiStore) GetEvents

func (s *MultiStore) GetEvents() []abci.Event

func (*MultiStore) GetKVStore

func (s *MultiStore) GetKVStore(key types.StoreKey) types.KVStore

func (*MultiStore) GetStore

func (s *MultiStore) GetStore(key types.StoreKey) types.Store

func (*MultiStore) GetStoreType

func (s *MultiStore) GetStoreType() types.StoreType

func (*MultiStore) GetWorkingHash

func (s *MultiStore) GetWorkingHash() ([]byte, error)

func (*MultiStore) ListeningEnabled

func (s *MultiStore) ListeningEnabled(key types.StoreKey) bool

func (*MultiStore) MountMemoryStores

func (s *MultiStore) MountMemoryStores(keys map[string]*types.MemoryStoreKey)

MountMemoryStores simulates the same behavior as sdk to support grpc query service.

func (*MultiStore) MountTransientStores

func (s *MultiStore) MountTransientStores(keys map[string]*types.TransientStoreKey)

MountTransientStores simulates the same behavior as sdk to support grpc query service.

func (*MultiStore) ResetEvents

func (s *MultiStore) ResetEvents()

func (*MultiStore) SetTracer

func (s *MultiStore) SetTracer(w io.Writer) types.MultiStore

func (*MultiStore) SetTracingContext

func (s *MultiStore) SetTracingContext(context types.TraceContext) types.MultiStore

func (*MultiStore) TracingEnabled

func (s *MultiStore) TracingEnabled() bool

type StateStore

type StateStore interface {
	Get(storeKey string, key []byte, version int64) ([]byte, error)
	Has(storeKey string, key []byte, version int64) (bool, error)
	Iterator(storeKey string, start, end []byte, version int64) (types.Iterator, error)
	ReverseIterator(storeKey string, start, end []byte, version int64) (types.Iterator, error)
	GetLatestVersion() (int64, error)
	SetLatestVersion(version uint64) error

	// ApplyChangeset Persist the change set of a block,
	// the `changeSet` should be ordered by (storeKey, key),
	// the version should be latest version plus one.
	ApplyChangeset(version int64, changeSets []proto.NamedChangeSet) error

	// Import the initial state of the store
	Import(version int64, ch <-chan ImportEntry) error

	// Prune attempts to prune all versions up to and including the provided
	// version argument. The operation should be idempotent. An error should be
	// returned upon failure.
	Prune(version uint64) error

	// Closer releases associated resources. It should NOT be idempotent. It must
	// only be called once and any call after may panic.
	io.Closer
}

StateStore is a versioned, embedded Key-Value Store, which allows efficient reads, writes, iteration over a specific version

type Store

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

Store wraps a SS store and implements a cosmos KVStore

func NewKVStore

func NewKVStore(store StateStore, storeKey types.StoreKey, version int64) *Store

func (*Store) CacheWrap

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

func (*Store) CacheWrapWithListeners

func (st *Store) CacheWrapWithListeners(storeKey types.StoreKey, listeners []types.WriteListener) types.CacheWrap

func (*Store) CacheWrapWithTrace

func (st *Store) CacheWrapWithTrace(storeKey types.StoreKey, w io.Writer, tc types.TraceContext) types.CacheWrap

func (*Store) Delete

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

func (*Store) Get

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

func (*Store) GetStoreType

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

func (*Store) GetWorkingHash

func (st *Store) GetWorkingHash() ([]byte, error)

func (*Store) Has

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

func (*Store) Iterator

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

func (*Store) ReverseIterator

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

func (*Store) Set

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

Jump to

Keyboard shortcuts

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