Skip to content

Commit

Permalink
remove unnecessary helper fn
Browse files Browse the repository at this point in the history
  • Loading branch information
bap2pecs committed Nov 25, 2024
1 parent d60f8f2 commit d16aa27
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
10 changes: 0 additions & 10 deletions server/grpcserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,10 @@ package server
import (
"context"

"google.golang.org/grpc"

"github.com/babylonlabs-io/finality-gadget/proto"
"github.com/babylonlabs-io/finality-gadget/types"
)

// RegisterWithGrpcServer registers the rpcServer with the passed root gRPC
// server.
func (s *Server) RegisterWithGrpcServer(grpcServer *grpc.Server) error {
// Register the main RPC server.
proto.RegisterFinalityGadgetServer(grpcServer, s)
return nil
}

// QueryIsBlockBabylonFinalized is an RPC method that returns the finality status of a block by querying the internal db.
func (s *Server) QueryIsBlockBabylonFinalized(ctx context.Context, req *proto.QueryIsBlockBabylonFinalizedRequest) (*proto.QueryIsBlockFinalizedResponse, error) {
isFinalized, err := s.fg.QueryIsBlockBabylonFinalized(&types.Block{
Expand Down
4 changes: 1 addition & 3 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,7 @@ func (s *Server) startGrpcServer() error {
grpcServer := grpc.NewServer()
defer grpcServer.Stop()

if err := s.RegisterWithGrpcServer(grpcServer); err != nil {
return fmt.Errorf("failed to register gRPC server: %w", err)
}
proto.RegisterFinalityGadgetServer(grpcServer, s)

var wg sync.WaitGroup
wg.Add(1)
Expand Down

0 comments on commit d16aa27

Please sign in to comment.