diff --git a/client/grpc/cmtservice/block.go b/client/grpc/cmtservice/block.go index 930b1ce9cbb0..f86704ad360f 100644 --- a/client/grpc/cmtservice/block.go +++ b/client/grpc/cmtservice/block.go @@ -8,7 +8,7 @@ import ( ) func getBlockHeight(ctx context.Context, rpc CometRPC) (int64, error) { - status, err := GetNodeStatus(ctx, rpc) + status, err := rpc.Status(ctx) if err != nil { return 0, err } diff --git a/client/grpc/cmtservice/service.go b/client/grpc/cmtservice/service.go index c936727da2b3..85b758db59de 100644 --- a/client/grpc/cmtservice/service.go +++ b/client/grpc/cmtservice/service.go @@ -3,7 +3,6 @@ package cmtservice import ( "context" - "cosmossdk.io/core/address" abci "github.com/cometbft/cometbft/api/cometbft/abci/v1" gogogrpc "github.com/cosmos/gogoproto/grpc" gogoprotoany "github.com/cosmos/gogoproto/types/any" @@ -11,6 +10,8 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + "cosmossdk.io/core/address" + "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" codectypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -49,7 +50,7 @@ func NewQueryServer( // GetSyncing implements ServiceServer.GetSyncing func (s queryServer) GetSyncing(ctx context.Context, _ *GetSyncingRequest) (*GetSyncingResponse, error) { - status, err := GetNodeStatus(ctx, s.rpc) + status, err := s.rpc.Status(ctx) if err != nil { return nil, err } @@ -163,7 +164,7 @@ func (s queryServer) GetValidatorSetByHeight(ctx context.Context, req *GetValida } func ValidatorsOutput(ctx context.Context, rpc CometRPC, consCodec address.Codec, height *int64, page, limit int) (*GetLatestValidatorSetResponse, error) { - vs, err := getValidators(ctx, rpc, height, page, limit) + vs, err := rpc.Validators(ctx, height, &page, &limit) if err != nil { return nil, err } @@ -204,7 +205,7 @@ func ValidatorsOutput(ctx context.Context, rpc CometRPC, consCodec address.Codec // GetNodeInfo implements ServiceServer.GetNodeInfo func (s queryServer) GetNodeInfo(ctx context.Context, _ *GetNodeInfoRequest) (*GetNodeInfoResponse, error) { - status, err := GetNodeStatus(ctx, s.rpc) + status, err := s.rpc.Status(ctx) if err != nil { return nil, err } diff --git a/client/grpc/cmtservice/status.go b/client/grpc/cmtservice/status.go deleted file mode 100644 index a3ba784a30de..000000000000 --- a/client/grpc/cmtservice/status.go +++ /dev/null @@ -1,13 +0,0 @@ -package cmtservice - -import ( - "context" - - coretypes "github.com/cometbft/cometbft/rpc/core/types" -) - -// GetNodeStatus returns the status of the node. -func GetNodeStatus(ctx context.Context, rpc CometRPC) (*coretypes.ResultStatus, error) { - - return rpc.Status(ctx) -} diff --git a/client/grpc/cmtservice/validator.go b/client/grpc/cmtservice/validator.go deleted file mode 100644 index 2f3f08bc27b0..000000000000 --- a/client/grpc/cmtservice/validator.go +++ /dev/null @@ -1,11 +0,0 @@ -package cmtservice - -import ( - "context" - - coretypes "github.com/cometbft/cometbft/rpc/core/types" -) - -func getValidators(ctx context.Context, rpc CometRPC, height *int64, page, limit int) (*coretypes.ResultValidators, error) { - return rpc.Validators(ctx, height, &page, &limit) -}