gpu-compute-chain/x/cosmostest/keeper/grpc_query_params.go

20 lines
482 B
Go
Raw Normal View History

2022-08-25 16:51:14 -07:00
package keeper
import (
"context"
"cosmos-test/x/cosmostest/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)
func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) {
if req == nil {
return nil, status.Error(codes.InvalidArgument, "invalid request")
}
ctx := sdk.UnwrapSDKContext(c)
return &types.QueryParamsResponse{Params: k.GetParams(ctx)}, nil
}