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 manages a stack of nested cache store to support the evm `StateDB`'s `Snapshot` and `RevertToSnapshot` methods.
func NewStore ¶
func NewStore(store storetypes.CacheKVStore) *Store
NewStore creates a new Store object
func (*Store) Commit ¶
func (cs *Store) Commit()
Commit commits all the cached stores from top to bottom in order and clears the cache stack by setting an empty slice of cache store.
func (*Store) CurrentStore ¶
func (cs *Store) CurrentStore() storetypes.CacheKVStore
CurrentStore returns the top of cached store stack. If the stack is empty, returns the initial 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.
Click to show internal directories.
Click to hide internal directories.