mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-11-10 18:15:19 +00:00
36 lines
811 B
Go
36 lines
811 B
Go
|
package keeper
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
|
||
|
"google.golang.org/grpc/codes"
|
||
|
"google.golang.org/grpc/status"
|
||
|
|
||
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||
|
|
||
|
"github.com/kava-labs/kava/x/evmutil/types"
|
||
|
)
|
||
|
|
||
|
type queryServer struct {
|
||
|
keeper Keeper
|
||
|
}
|
||
|
|
||
|
// NewQueryServerImpl creates a new server for handling gRPC queries.
|
||
|
func NewQueryServerImpl(k Keeper) types.QueryServer {
|
||
|
return &queryServer{keeper: k}
|
||
|
}
|
||
|
|
||
|
var _ types.QueryServer = queryServer{}
|
||
|
|
||
|
// Params queries module params
|
||
|
func (s queryServer) Params(stdCtx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) {
|
||
|
if req == nil {
|
||
|
return nil, status.Errorf(codes.InvalidArgument, "empty request")
|
||
|
}
|
||
|
|
||
|
ctx := sdk.UnwrapSDKContext(stdCtx)
|
||
|
params := s.keeper.GetParams(ctx)
|
||
|
|
||
|
return &types.QueryParamsResponse{Params: params}, nil
|
||
|
}
|