2024-07-05 22:20:13 -04:00
|
|
|
package keeper
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"context"
|
|
|
|
|
|
2024-09-05 01:24:57 -04:00
|
|
|
"github.com/onsonr/sonr/x/did/types"
|
2024-07-05 22:20:13 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
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.
|
2024-09-07 18:12:58 -04:00
|
|
|
func (k Querier) Params(
|
2024-09-11 15:10:54 -04:00
|
|
|
goCtx context.Context,
|
2024-09-07 18:12:58 -04:00
|
|
|
req *types.QueryRequest,
|
2024-09-14 12:47:25 -04:00
|
|
|
) (*types.QueryParamsResponse, error) {
|
2024-09-11 15:10:54 -04:00
|
|
|
ctx := k.CurrentCtx(goCtx)
|
2024-09-14 12:47:25 -04:00
|
|
|
return &types.QueryParamsResponse{Params: k.GetParams(ctx.SDK())}, nil
|
2024-08-10 17:01:14 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Resolve implements types.QueryServer.
|
2024-09-07 18:12:58 -04:00
|
|
|
func (k Querier) Resolve(
|
|
|
|
|
goCtx context.Context,
|
|
|
|
|
req *types.QueryRequest,
|
2024-09-14 14:59:10 -04:00
|
|
|
) (*types.QueryResolveResponse, error) {
|
|
|
|
|
_ = k.CurrentCtx(goCtx)
|
|
|
|
|
return &types.QueryResolveResponse{}, nil
|
2024-07-05 22:20:13 -04:00
|
|
|
}
|
2024-07-23 14:18:15 -04:00
|
|
|
|
2024-08-10 17:01:14 -04:00
|
|
|
// Service implements types.QueryServer.
|
2024-09-07 18:12:58 -04:00
|
|
|
func (k Querier) Service(
|
|
|
|
|
goCtx context.Context,
|
|
|
|
|
req *types.QueryRequest,
|
2024-09-14 14:59:10 -04:00
|
|
|
) (*types.QueryServiceResponse, error) {
|
2024-09-11 15:10:54 -04:00
|
|
|
ctx := k.CurrentCtx(goCtx)
|
2024-09-14 14:59:10 -04:00
|
|
|
return &types.QueryServiceResponse{Service: ctx.GetServiceInfo(req.GetOrigin())}, nil
|
2024-09-05 01:24:57 -04:00
|
|
|
}
|
2024-09-14 12:47:25 -04:00
|
|
|
|
2024-09-18 02:22:17 -04:00
|
|
|
// Sync implements types.QueryServer.
|
|
|
|
|
func (k Querier) Sync(goCtx context.Context, req *types.SyncRequest) (*types.SyncResponse, error) {
|
2024-09-14 12:47:25 -04:00
|
|
|
// ctx := sdk.UnwrapSDKContext(goCtx)
|
2024-09-18 02:22:17 -04:00
|
|
|
panic("Sync is unimplemented")
|
|
|
|
|
return &types.SyncResponse{}, nil
|
2024-09-14 12:47:25 -04:00
|
|
|
}
|