Documentation ¶
Index ¶
- func NewQuerierImpl(keeper Keeper) types.QueryServer
- type BatchIndexes
- type Keeper
- func (k Keeper) ConstructBatch(ctx sdk.Context) (types.Batch, types.DataResultTreeEntries, []types.ValidatorTreeEntry, error)
- func (k Keeper) ConstructDataResultTree(ctx sdk.Context, newBatchNum uint64) (types.DataResultTreeEntries, []byte, error)
- func (k Keeper) ConstructValidatorTree(ctx sdk.Context) ([]types.ValidatorTreeEntry, []byte, error)
- func (k Keeper) EndBlock(ctx sdk.Context) (err error)
- func (k Keeper) ExportGenesis(ctx sdk.Context) types.GenesisState
- func (k Keeper) GetAllBatches(ctx sdk.Context) ([]types.Batch, error)
- func (k Keeper) GetBatchAssignment(ctx context.Context, dataReqID string, dataReqHeight uint64) (uint64, error)
- func (k Keeper) GetBatchByBatchNumber(ctx context.Context, batchNumber uint64) (types.Batch, error)
- func (k Keeper) GetBatchData(ctx context.Context, batchNum uint64) (types.BatchData, error)
- func (k Keeper) GetBatchForHeight(ctx context.Context, blockHeight int64) (types.Batch, error)
- func (k Keeper) GetBatchSignatures(ctx context.Context, batchNum uint64) ([]types.BatchSignatures, error)
- func (k Keeper) GetCurrentBatchNum(ctx context.Context) (uint64, error)
- func (k Keeper) GetDataResult(ctx context.Context, dataReqID string, dataReqHeight uint64) (*types.DataResult, error)
- func (k Keeper) GetDataResults(ctx context.Context, batched bool) ([]types.DataResult, error)
- func (k Keeper) GetLatestBatch(ctx context.Context) (types.Batch, error)
- func (k Keeper) GetLatestDataResult(ctx context.Context, dataReqID string) (*types.DataResult, error)
- func (k Keeper) GetLatestSignedBatch(ctx sdk.Context) (types.Batch, error)
- func (k Keeper) GetValidatorTreeEntry(ctx context.Context, batchNum uint64, valAddr sdk.ValAddress) (types.ValidatorTreeEntry, error)
- func (k Keeper) InitGenesis(ctx sdk.Context, data types.GenesisState)
- func (k Keeper) IterateBatches(ctx sdk.Context, callback func(types.Batch) (stop bool)) error
- func (k Keeper) IterateDataResults(ctx context.Context, batched bool, ...) error
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) MarkDataResultAsBatched(ctx context.Context, result types.DataResult, batchNum uint64) error
- func (k Keeper) SetBatchAssignment(ctx context.Context, dataReqID string, dataReqHeight uint64, ...) error
- func (k Keeper) SetBatchSigSecp256k1(ctx context.Context, batchNum uint64, valAddr sdk.ValAddress, signature []byte) error
- func (k Keeper) SetDataResultForBatching(ctx context.Context, result types.DataResult) error
- func (k Keeper) SetNewBatch(ctx context.Context, batch types.Batch, ...) error
- type Querier
- func (q Querier) Batch(c context.Context, req *types.QueryBatchRequest) (*types.QueryBatchResponse, error)
- func (q Querier) BatchForHeight(c context.Context, req *types.QueryBatchForHeightRequest) (*types.QueryBatchForHeightResponse, error)
- func (q Querier) Batches(c context.Context, req *types.QueryBatchesRequest) (*types.QueryBatchesResponse, error)
- func (q Querier) DataResult(c context.Context, req *types.QueryDataResultRequest) (*types.QueryDataResultResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewQuerierImpl ¶
func NewQuerierImpl(keeper Keeper) types.QueryServer
Types ¶
type BatchIndexes ¶
type BatchIndexes struct { // Number is a unique index that indexes batches by their batch number. Number *indexes.Unique[uint64, int64, types.Batch] }
func NewBatchIndexes ¶
func NewBatchIndexes(sb *collections.SchemaBuilder) BatchIndexes
func (BatchIndexes) IndexesList ¶
func (i BatchIndexes) IndexesList() []collections.Index[int64, types.Batch]
type Keeper ¶
type Keeper struct { Schema collections.Schema // contains filtered or unexported fields }
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, storeService storetypes.KVStoreService, sk types.StakingKeeper, wsk types.WasmStorageKeeper, pkk types.PubKeyKeeper, wk wasmtypes.ContractOpsKeeper, wvk wasmtypes.ViewKeeper, validatorAddressCodec addresscodec.Codec, ) Keeper
func (Keeper) ConstructBatch ¶
func (k Keeper) ConstructBatch(ctx sdk.Context) (types.Batch, types.DataResultTreeEntries, []types.ValidatorTreeEntry, error)
ConstructBatch constructs a data result tree from unbatched data results and a validator tree from the current active validator set. It returns a resulting batch, data result tree entries, and validator tree entries in that order.
func (Keeper) ConstructDataResultTree ¶
func (k Keeper) ConstructDataResultTree(ctx sdk.Context, newBatchNum uint64) (types.DataResultTreeEntries, []byte, error)
ConstructDataResultTree constructs a data result tree based on the data results that have not been batched yet. It returns the tree's entries without the domain separators and the tree root.
func (Keeper) ConstructValidatorTree ¶
ConstructValidatorTree constructs a validator tree based on the validators in the active set and their registered public keys. It returns the tree's entries without the domain separators, batch signature entries with validator address and public key fields populated, and the tree root.
func (Keeper) ExportGenesis ¶
func (k Keeper) ExportGenesis(ctx sdk.Context) types.GenesisState
ExportGenesis extracts all data from store to genesis state.
func (Keeper) GetAllBatches ¶
GetAllBatches returns all batches in the store.
func (Keeper) GetBatchAssignment ¶
func (k Keeper) GetBatchAssignment(ctx context.Context, dataReqID string, dataReqHeight uint64) (uint64, error)
GetBatchAssignment returns the given data request's assigned batch number for a given height.
func (Keeper) GetBatchByBatchNumber ¶
func (Keeper) GetBatchData ¶
GetBatchData returns various data for a given batch.
func (Keeper) GetBatchForHeight ¶
func (Keeper) GetBatchSignatures ¶
func (k Keeper) GetBatchSignatures(ctx context.Context, batchNum uint64) ([]types.BatchSignatures, error)
GetBatchSignatures returns all batch signatures for a given batch.
func (Keeper) GetCurrentBatchNum ¶
func (Keeper) GetDataResult ¶
func (k Keeper) GetDataResult(ctx context.Context, dataReqID string, dataReqHeight uint64) (*types.DataResult, error)
GetDataResult returns a data result given the associated data request's ID and height.
func (Keeper) GetDataResults ¶
GetDataResults returns a list of data results under a given status (batched or not).
func (Keeper) GetLatestBatch ¶
GetLatestBatch returns the most recently created batch. If batching has not begun, it returns an error ErrBatchingHasNotStarted.
func (Keeper) GetLatestDataResult ¶
func (k Keeper) GetLatestDataResult(ctx context.Context, dataReqID string) (*types.DataResult, error)
GetLatestDataResult returns the latest data result given the associated data request's ID.
func (Keeper) GetLatestSignedBatch ¶
GetLatestSignedBatch returns the latest batch whose signatures have been collected.
func (Keeper) GetValidatorTreeEntry ¶
func (k Keeper) GetValidatorTreeEntry(ctx context.Context, batchNum uint64, valAddr sdk.ValAddress) (types.ValidatorTreeEntry, error)
func (Keeper) InitGenesis ¶
func (k Keeper) InitGenesis(ctx sdk.Context, data types.GenesisState)
InitGenesis puts all data from genesis state into store.
func (Keeper) IterateBatches ¶
IterateBatches iterates over the batches and performs a given callback function.
func (Keeper) IterateDataResults ¶
func (k Keeper) IterateDataResults(ctx context.Context, batched bool, cb func(key collections.Triple[bool, string, uint64], value types.DataResult) (bool, error)) error
IterateDataResults iterates over all data results under a given status (batched or not) and performs a given callback function.
func (Keeper) MarkDataResultAsBatched ¶
func (k Keeper) MarkDataResultAsBatched(ctx context.Context, result types.DataResult, batchNum uint64) error
MarkDataResultAsBatched removes the "unbatched" variant of the given data result and stores a "batched" variant.
func (Keeper) SetBatchAssignment ¶
func (k Keeper) SetBatchAssignment(ctx context.Context, dataReqID string, dataReqHeight uint64, batchNumber uint64) error
SetBatchAssignment assigns a given batch number to the given data request ID and data request height.
func (Keeper) SetBatchSigSecp256k1 ¶
func (k Keeper) SetBatchSigSecp256k1(ctx context.Context, batchNum uint64, valAddr sdk.ValAddress, signature []byte) error
SetBatchSigSecp256k1 stores a given validator's secp256k1 signature for a specified batch.
func (Keeper) SetDataResultForBatching ¶
SetDataResultForBatching stores a data result so that it is ready to be batched.
func (Keeper) SetNewBatch ¶
func (k Keeper) SetNewBatch(ctx context.Context, batch types.Batch, dataEntries types.DataResultTreeEntries, valEntries []types.ValidatorTreeEntry) error
SetNewBatch increments the current batch number and stores a given batch at that index. It also stores the given data result tree entries, validator tree entries, and batch signature entries (at the next batch index, to be populated with signatures later). It returns an error if a batch already exists at the given batch's block height or if the given batch's batch number does not match the next batch number.
type Querier ¶
type Querier struct {
Keeper
}
func (Querier) Batch ¶
func (q Querier) Batch(c context.Context, req *types.QueryBatchRequest) (*types.QueryBatchResponse, error)
func (Querier) BatchForHeight ¶
func (q Querier) BatchForHeight(c context.Context, req *types.QueryBatchForHeightRequest) (*types.QueryBatchForHeightResponse, error)
func (Querier) Batches ¶
func (q Querier) Batches(c context.Context, req *types.QueryBatchesRequest) (*types.QueryBatchesResponse, error)
func (Querier) DataResult ¶
func (q Querier) DataResult(c context.Context, req *types.QueryDataResultRequest) (*types.QueryDataResultResponse, error)