Documentation
¶
Index ¶
- type Store
- func (s *Store) CacheMultiStore() storetypes.CacheMultiStore
- func (s *Store) CacheMultiStoreWithVersion(_ int64) (storetypes.CacheMultiStore, error)
- func (s *Store) CacheWrap() storetypes.CacheWrap
- func (s *Store) CacheWrapWithTrace(_ io.Writer, _ storetypes.TraceContext) storetypes.CacheWrap
- func (s *Store) GetKVStore(key storetypes.StoreKey) storetypes.KVStore
- func (s *Store) GetStore(key storetypes.StoreKey) storetypes.Store
- func (s *Store) GetStoreType() storetypes.StoreType
- func (s *Store) LatestVersion() int64
- func (s *Store) RevertToSnapshot(target int)
- func (s *Store) SetTracer(_ io.Writer) storetypes.MultiStore
- func (s *Store) SetTracingContext(_ storetypes.TraceContext) storetypes.MultiStore
- func (s *Store) Snapshot() int
- func (s *Store) TracingEnabled() bool
- func (s *Store) Write()
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
}
func NewStore ¶
func NewStore(cms storetypes.CacheMultiStore, keys map[string]*storetypes.KVStoreKey) *Store
NewStore creates a new Store objectwith CacheMultiStore and KVStoreKeys
func NewStoreWithKVStores ¶
func NewStoreWithKVStores(stores map[*storetypes.KVStoreKey]storetypes.CacheWrap) *Store
NewStore creates a new Store object with KVStores
func (*Store) CacheMultiStore ¶
func (s *Store) CacheMultiStore() storetypes.CacheMultiStore
CacheMultiStore snapshots store and return current store.
func (*Store) CacheMultiStoreWithVersion ¶
func (s *Store) CacheMultiStoreWithVersion(_ int64) (storetypes.CacheMultiStore, error)
CacheMultiStoreWithVersion load stores at a snapshot version.
NOTE: CacheMultiStoreWithVersion is no-op function.
func (*Store) CacheWrapWithTrace ¶
func (s *Store) CacheWrapWithTrace(_ io.Writer, _ storetypes.TraceContext) storetypes.CacheWrap
CacheWrapWithTrace implements the CacheWrapper interface.
NOTE: CacheWrapWithTrace is a method that enables a Store to satisfy the CacheWrapper interface. Although it accepts an io.Writer and tracingContext as inputs, these are not used in the implementation. Instead, it simply adds an additional cache layer on top of the existing KVStores. As a result, while the return value differs, the behavior is effectively the same as the Snapshot() method.
func (*Store) GetKVStore ¶
func (s *Store) GetKVStore(key storetypes.StoreKey) storetypes.KVStore
GetKVStore returns an underlying KVStore by key.
func (*Store) GetStore ¶
func (s *Store) GetStore(key storetypes.StoreKey) storetypes.Store
GetStore returns an underlying Store by key.
func (*Store) GetStoreType ¶
func (s *Store) GetStoreType() storetypes.StoreType
GetStoreType returns the type of the store.
func (*Store) LatestVersion ¶
LatestVersion returns the branch version of the store
func (*Store) RevertToSnapshot ¶
RevertToSnapshot pops all the cached stores whose index is greator than or equal to target. The target should be snapshot index returned by `Snapshot`. This function panics if the index is out of bounds.
func (*Store) SetTracer ¶
func (s *Store) SetTracer(_ io.Writer) storetypes.MultiStore
SetTracer sets the tracer for the MultiStore that the underlying stores will utilize to trace operations. A MultiStore is returned.
NOTE: SetTracer no-op function.
func (*Store) SetTracingContext ¶
func (s *Store) SetTracingContext(_ storetypes.TraceContext) storetypes.MultiStore
SetTracingContext updates the tracing context for the MultiStore by merging the given context with the existing context by key. Any existing keys will be overwritten. It is implied that the caller should update the context when necessary between tracing operations. It returns a modified MultiStore.
NOTE: SetTracingContext no-op function
func (*Store) Snapshot ¶
Snapshot pushes a new cached context to the stack, and returns the index of it.
func (*Store) TracingEnabled ¶
TracingEnabled returns if tracing is enabled for the MultiStore.