planetmint-go/x/asset/keeper/query_params.go
Jürgen Eckel 4dcf32a86b
added global errormsg module
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
2024-02-26 14:39:53 +01:00

21 lines
563 B
Go

package keeper
import (
"context"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/planetmint/planetmint-go/errormsg"
"github.com/planetmint/planetmint-go/x/asset/types"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)
func (k Keeper) Params(goCtx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) {
if req == nil {
return nil, status.Error(codes.InvalidArgument, errormsg.InvalidRequest)
}
ctx := sdk.UnwrapSDKContext(goCtx)
return &types.QueryParamsResponse{Params: k.GetParams(ctx)}, nil
}