Skip to content

Commit

Permalink
refactor(server): use interface instead of full Application type (#23420
Browse files Browse the repository at this point in the history
)
  • Loading branch information
kocubinski authored Jan 16, 2025
1 parent b885d8a commit 514ce9e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions server/grpc/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"net"

gogogrpc "github.com/cosmos/gogoproto/grpc"
"google.golang.org/grpc"

"cosmossdk.io/log"
Expand All @@ -14,13 +15,16 @@ import (
"github.com/cosmos/cosmos-sdk/server/config"
"github.com/cosmos/cosmos-sdk/server/grpc/gogoreflection"
reflection "github.com/cosmos/cosmos-sdk/server/grpc/reflection/v2alpha1"
"github.com/cosmos/cosmos-sdk/server/types"
_ "github.com/cosmos/cosmos-sdk/types/tx/amino" // Import amino.proto file for reflection
)

type grpcApp interface {
RegisterGRPCServerWithSkipCheckHeader(gogogrpc.Server, bool)
}

// NewGRPCServer returns a correctly configured and initialized gRPC server.
// Note, the caller is responsible for starting the server. See StartGRPCServer.
func NewGRPCServer(clientCtx client.Context, app types.Application, cfg config.GRPCConfig) (*grpc.Server, error) {
func NewGRPCServer(clientCtx client.Context, app grpcApp, cfg config.GRPCConfig) (*grpc.Server, error) {
maxSendMsgSize := cfg.MaxSendMsgSize
if maxSendMsgSize == 0 {
maxSendMsgSize = config.DefaultGRPCMaxSendMsgSize
Expand Down

0 comments on commit 514ce9e

Please sign in to comment.