Documentation ¶
Index ¶
- Constants
- func NewQuerierImpl(keeper Keeper) types.QueryServer
- type BatchIndexes
- type Keeper
- func (k Keeper) ConstructBatch(ctx sdk.Context) (types.Batch, [][]byte, [][]byte, error)
- func (k Keeper) ConstructDataResultTree(ctx sdk.Context, newBatchNum uint64) ([][]byte, []byte, error)
- func (k Keeper) ConstructValidatorTree(ctx sdk.Context) ([][]byte, []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) GetAllTreeEntries(ctx sdk.Context) ([]types.TreeEntries, error)
- func (k Keeper) GetBatchAssignment(ctx context.Context, dataReqID string) (uint64, error)
- func (k Keeper) GetBatchByBatchNumber(ctx context.Context, batchNumber uint64) (types.Batch, error)
- func (k Keeper) GetBatchForHeight(ctx context.Context, blockHeight int64) (types.Batch, error)
- func (k Keeper) GetBatchSignatures(ctx context.Context, batchNum uint64, validatorAddr string) (types.BatchSignatures, error)
- func (k Keeper) GetBatchSigsForBatch(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) (*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) GetParams(ctx sdk.Context) (types.Params, error)
- func (k Keeper) GetTreeEntries(ctx context.Context, batchNum uint64) (types.TreeEntries, error)
- func (k Keeper) GetValSetTrimPercent(ctx sdk.Context) (uint32, 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) IterateTreeEntries(ctx sdk.Context, callback func(types.TreeEntries) (stop bool)) error
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) SetBatchAssignment(ctx context.Context, dataReqID string, batchNumber uint64) error
- func (k Keeper) SetBatchSignatures(ctx context.Context, batchNum uint64, sigs types.BatchSignatures) error
- func (k Keeper) SetDataResultForBatching(ctx context.Context, result types.DataResult) error
- func (k Keeper) SetNewBatch(ctx context.Context, batch types.Batch, dataEntries, valEntries [][]byte) error
- type Querier
- func (q Querier) Batch(c context.Context, req *types.QueryBatchRequest) (*types.QueryBatchResponse, error)
- func (q Querier) BatchAssignment(c context.Context, req *types.QueryBatchAssignmentRequest) (*types.QueryBatchAssignmentResponse, error)
- func (q Querier) BatchForHeight(c context.Context, req *types.QueryBatchForHeightRequest) (*types.QueryBatchForHeightResponse, error)
- func (q Querier) BatchSignatures(c context.Context, req *types.QueryBatchSignaturesRequest) (*types.QueryBatchSignaturesResponse, 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)
- func (q Querier) TreeEntries(c context.Context, req *types.QueryTreeEntriesRequest) (*types.QueryTreeEntriesResponse, error)
Constants ¶
const ZeroHash = "0000000000000000000000000000000000000000000000000000000000000000"
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, authority string, sk types.StakingKeeper, wsk types.WasmStorageKeeper, pkk types.PubKeyKeeper, wk wasmtypes.ContractOpsKeeper, wvk wasmtypes.ViewKeeper, validatorAddressCodec addresscodec.Codec, ) Keeper
func (Keeper) ConstructBatch ¶
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) ([][]byte, []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 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) GetAllTreeEntries ¶
GetAllTreeEntries retrieves all tree entries from the store.
func (Keeper) GetBatchAssignment ¶
GetBatchAssignment returns the given data request's assigned batch number.
func (Keeper) GetBatchByBatchNumber ¶
func (Keeper) GetBatchForHeight ¶
func (Keeper) GetBatchSignatures ¶
func (k Keeper) GetBatchSignatures(ctx context.Context, batchNum uint64, validatorAddr string) (types.BatchSignatures, error)
GetBatchSignatures retrieves the batch signatures by a given validator at a given batch number.
func (Keeper) GetBatchSigsForBatch ¶
func (k Keeper) GetBatchSigsForBatch(ctx context.Context, batchNum uint64) ([]types.BatchSignatures, error)
GetBatchSigsForBatch returns all signatures of a given batch.
func (Keeper) GetCurrentBatchNum ¶
func (Keeper) GetDataResult ¶
GetDataResult returns a data result given the associated data request's ID.
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) GetTreeEntries ¶
GetTreeEntries returns the tree entries corresponding to the given batch number.
func (Keeper) GetValSetTrimPercent ¶
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.Pair[bool, string], 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) IterateTreeEntries ¶
func (k Keeper) IterateTreeEntries(ctx sdk.Context, callback func(types.TreeEntries) (stop bool)) error
IterateBatches iterates over the tree entries and performs a given callback function.
func (Keeper) SetBatchAssignment ¶
SetBatchAssignment assigns a given batch number to the given data request.
func (Keeper) SetBatchSignatures ¶
func (k Keeper) SetBatchSignatures(ctx context.Context, batchNum uint64, sigs types.BatchSignatures) error
SetBatchSignatures stores a validator's signatures of a 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, valEntries [][]byte) error
SetNewBatch increments the current batch number and stores a given batch at that index. It also stores the given data result tree entries and validator tree entries. 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) BatchAssignment ¶
func (q Querier) BatchAssignment(c context.Context, req *types.QueryBatchAssignmentRequest) (*types.QueryBatchAssignmentResponse, error)
func (Querier) BatchForHeight ¶
func (q Querier) BatchForHeight(c context.Context, req *types.QueryBatchForHeightRequest) (*types.QueryBatchForHeightResponse, error)
func (Querier) BatchSignatures ¶
func (q Querier) BatchSignatures(c context.Context, req *types.QueryBatchSignaturesRequest) (*types.QueryBatchSignaturesResponse, 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)
func (Querier) TreeEntries ¶
func (q Querier) TreeEntries(c context.Context, req *types.QueryTreeEntriesRequest) (*types.QueryTreeEntriesResponse, error)