Documentation ¶
Index ¶
- Constants
- Variables
- func NewQuerier(keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier
- type BatchingChangeManager
- type ChangeManager
- type Keeper
- func (k Keeper) AppendStorageValueAndNotify(ctx sdk.Context, path, value string) error
- func (k Keeper) EmitChange(ctx sdk.Context, change *ProposedChange)
- func (k Keeper) ExportStorage(ctx sdk.Context) []*types.DataEntry
- func (k Keeper) ExportStorageFromPrefix(ctx sdk.Context, pathPrefix string) []*types.DataEntry
- func (k Keeper) FlushChangeEvents(ctx sdk.Context)
- func (k Keeper) GetChildren(ctx sdk.Context, path string) *types.Children
- func (k Keeper) GetDataPrefix() []byte
- func (k Keeper) GetEntry(ctx sdk.Context, path string) types.StorageEntry
- func (k Keeper) GetNoDataValue() []byte
- func (k Keeper) GetQueueLength(ctx sdk.Context, queuePath string) (sdk.Int, error)
- func (k Keeper) GetStoreName() string
- func (k Keeper) HasChildren(ctx sdk.Context, path string) bool
- func (k Keeper) HasEntry(ctx sdk.Context, path string) bool
- func (k Keeper) HasStorage(ctx sdk.Context, path string) bool
- func (k Keeper) ImportStorage(ctx sdk.Context, entries []*types.DataEntry)
- func (k Keeper) LegacySetStorageAndNotify(ctx sdk.Context, entry types.StorageEntry)
- func (k Keeper) MigrateNoDataPlaceholders(ctx sdk.Context)
- func (k Keeper) NewChangeBatch(ctx sdk.Context)
- func (k Keeper) PathToEncodedKey(path string) []byte
- func (k Keeper) PushQueueItem(ctx sdk.Context, queuePath string, value string) error
- func (k Keeper) SetStorage(ctx sdk.Context, entry types.StorageEntry)
- func (k Keeper) SetStorageAndNotify(ctx sdk.Context, entry types.StorageEntry)
- type ProposedChange
- type Querier
- type StreamCell
Constants ¶
const ( QueryData = "data" QueryChildren = "children" )
query endpoints supported by the vstorage Querier
Variables ¶
var MaxSDKInt = sdk.NewIntFromBigInt(new(big.Int).Sub(new(big.Int).Exp(big.NewInt(2), big.NewInt(256), nil), big.NewInt(1)))
2 ** 256 - 1
Functions ¶
func NewQuerier ¶
func NewQuerier(keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier
NewQuerier is the module level router for state queries
Types ¶
type BatchingChangeManager ¶ added in v0.34.0
type BatchingChangeManager struct {
// contains filtered or unexported fields
}
func NewBatchingChangeManager ¶ added in v0.34.0
func NewBatchingChangeManager() *BatchingChangeManager
The BatchingChangeManager needs to be a pointer because its state is mutated.
func (*BatchingChangeManager) EmitEvents ¶ added in v0.34.0
func (bcm *BatchingChangeManager) EmitEvents(ctx sdk.Context, k Keeper)
EmitEvents emits events for all actual changes. This does not clear the cache, so the caller must call Rollback() to do so.
func (*BatchingChangeManager) Rollback ¶ added in v0.34.0
func (bcm *BatchingChangeManager) Rollback(ctx sdk.Context)
func (*BatchingChangeManager) Track ¶ added in v0.34.0
func (bcm *BatchingChangeManager) Track(ctx sdk.Context, k Keeper, entry types.StorageEntry, isLegacy bool)
type ChangeManager ¶ added in v0.34.0
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper maintains the link to data storage and exposes getter/setter methods for the various parts of the state machine
func (Keeper) AppendStorageValueAndNotify ¶
func (Keeper) EmitChange ¶ added in v0.34.0
func (k Keeper) EmitChange(ctx sdk.Context, change *ProposedChange)
func (Keeper) ExportStorage ¶
ExportStorage fetches all storage
func (Keeper) ExportStorageFromPrefix ¶ added in v0.34.0
ExportStorageFromPrefix fetches storage only under the supplied pathPrefix.
func (Keeper) FlushChangeEvents ¶ added in v0.34.0
func (Keeper) GetChildren ¶
GetChildren gets all vstorage child children at a given path
func (Keeper) GetDataPrefix ¶
func (Keeper) GetEntry ¶ added in v0.34.0
GetEntry gets generic storage. The default value is an empty string.
func (Keeper) GetNoDataValue ¶ added in v0.34.0
func (Keeper) GetQueueLength ¶ added in v0.34.0
func (Keeper) GetStoreName ¶
func (Keeper) HasChildren ¶
HasChildren tells if a given path has child children.
func (Keeper) HasStorage ¶
HasStorage tells if a given path has data. Some storage nodes have no data (just an empty string) and exist only to provide linkage to subnodes with data.
func (Keeper) ImportStorage ¶
func (Keeper) LegacySetStorageAndNotify ¶
func (k Keeper) LegacySetStorageAndNotify(ctx sdk.Context, entry types.StorageEntry)
func (Keeper) MigrateNoDataPlaceholders ¶ added in v0.34.0
func (Keeper) NewChangeBatch ¶ added in v0.34.0
func (Keeper) PathToEncodedKey ¶
func (Keeper) PushQueueItem ¶ added in v0.34.0
func (Keeper) SetStorage ¶
func (k Keeper) SetStorage(ctx sdk.Context, entry types.StorageEntry)
SetStorage sets the data value for a path.
Maintains the invariant: path entries exist if and only if self or some descendant has non-empty storage
func (Keeper) SetStorageAndNotify ¶
func (k Keeper) SetStorageAndNotify(ctx sdk.Context, entry types.StorageEntry)
type ProposedChange ¶ added in v0.34.0
type Querier ¶
type Querier struct {
Keeper
}
Querier is used as Keeper will have duplicate methods if used directly, and gRPC names take precedence over keeper
func (Querier) Children ¶
func (k Querier) Children(c context.Context, req *types.QueryChildrenRequest) (*types.QueryChildrenResponse, error)
func (Querier) Data ¶
func (k Querier) Data(c context.Context, req *types.QueryDataRequest) (*types.QueryDataResponse, error)
type StreamCell ¶
StreamCell is an envelope representing a sequence of values written at a path in a single block. It is persisted to storage as a { "blockHeight": "<digits>", "values": ["...", ...] } JSON text that off-chain consumers rely upon. Many of those consumers *also* rely upon the strings of "values" being valid JSON text (cf. scripts/get-flattened-publication.sh), but we do not enforce that in this package.