sonr/x/did/keeper/querier.go
Prad Nukala b593245fe6
feature/implement vault allocation (#11)
* feat: add authentication middleware

* feat: add REST API endpoints for database interactions

* refactor: move DiscoveryDocument Pkl schema to oidc module

* fix: replace sonrd with test_node.sh

* feat: use NFT keeper to mint DID namespace NFT

* refactor: move NFT class configuration to types

* feat: add GlobalIntegrity genesis state

* fix: ensure GlobalIntegrity is initialized in genesis

* refactor: update all references to transactions module

* refactor: improve genesis state struct

* chore(did): update discovery endpoint to reflect base url

* feat: remove unused context cache and client code

* refactor: remove middleware dependency from keeper

* feat: Add new query handlers for DID module

* feat: Implement unimplemented params queries

* feat: add support for first-party caveats

* refactor: move motr command to cmd directory

* feat: add support for GitHub releases

* fix(motr): build app.wasm for motr package

* feat: add card component

* feat: add IndexedDB support for persistent storage

* feat: Add Row and Column components

* feat: add  and  components

* refactor: improve button component

* refactor: remove unnecessary button parameter in renderButton

* feat: add vault service endpoint

* feat: add input component
2024-09-14 12:47:25 -04:00

80 lines
2.4 KiB
Go

package keeper
import (
"context"
"github.com/onsonr/sonr/x/did/types"
)
var _ types.QueryServer = Querier{}
type Querier struct {
Keeper
}
func NewQuerier(keeper Keeper) Querier {
return Querier{Keeper: keeper}
}
// Params returns the total set of did parameters.
func (k Querier) Params(
goCtx context.Context,
req *types.QueryRequest,
) (*types.QueryParamsResponse, error) {
ctx := k.CurrentCtx(goCtx)
return &types.QueryParamsResponse{Params: k.GetParams(ctx.SDK())}, nil
}
// Resolve implements types.QueryServer.
func (k Querier) Resolve(
goCtx context.Context,
req *types.QueryRequest,
) (*types.QueryResponse, error) {
ctx := k.CurrentCtx(goCtx)
return &types.QueryResponse{Params: k.GetParams(ctx.SDK())}, nil
}
// Service implements types.QueryServer.
func (k Querier) Service(
goCtx context.Context,
req *types.QueryRequest,
) (*types.QueryResponse, error) {
ctx := k.CurrentCtx(goCtx)
return &types.QueryResponse{Service: ctx.GetServiceInfo(req.GetOrigin()), Params: ctx.Params()}, nil
}
// ParamsAssets implements types.QueryServer.
func (k Querier) ParamsAssets(goCtx context.Context, req *types.QueryRequest) (*types.QueryResponse, error) {
// ctx := sdk.UnwrapSDKContext(goCtx)
panic("ParamsAssets is unimplemented")
return &types.QueryResponse{}, nil
}
// ParamsByAsset implements types.QueryServer.
func (k Querier) ParamsByAsset(goCtx context.Context, req *types.QueryRequest) (*types.QueryResponse, error) {
// ctx := sdk.UnwrapSDKContext(goCtx)
panic("ParamsByAsset is unimplemented")
return &types.QueryResponse{}, nil
}
// ParamsKeys implements types.QueryServer.
func (k Querier) ParamsKeys(goCtx context.Context, req *types.QueryRequest) (*types.QueryResponse, error) {
// ctx := sdk.UnwrapSDKContext(goCtx)
panic("ParamsKeys is unimplemented")
return &types.QueryResponse{}, nil
}
// ParamsByKey implements types.QueryServer.
func (k Querier) ParamsByKey(goCtx context.Context, req *types.QueryRequest) (*types.QueryResponse, error) {
// ctx := sdk.UnwrapSDKContext(goCtx)
panic("ParamsByKey is unimplemented")
return &types.QueryResponse{}, nil
}
// RegistrationOptionsByKey implements types.QueryServer.
func (k Querier) RegistrationOptionsByKey(goCtx context.Context, req *types.QueryRequest) (*types.QueryResponse, error) {
// ctx := sdk.UnwrapSDKContext(goCtx)
panic("RegistrationOptionsByKey is unimplemented")
return &types.QueryResponse{}, nil
}