Skip to content

Commit

Permalink
chore: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
distractedm1nd committed Oct 25, 2022
1 parent 702d9e0 commit 093294c
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 14 deletions.
2 changes: 1 addition & 1 deletion api/mocks/api.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions api/rpc/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,8 @@ func (s *Server) RegisterService(namespace string, service interface{}) {

// Start starts the RPC Server.
func (s *Server) Start(context.Context) error {
err := s.http.ListenAndServe()
if err != nil {
return err
}
//nolint:errcheck
go s.http.ListenAndServe()
log.Infow("RPC server started", "listening on", s.http.Addr)
return nil
}
Expand Down
1 change: 0 additions & 1 deletion nodebuilder/fraud/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
// API is a wrapper around Module for the RPC.
// TODO(@distractedm1nd): These structs need to be autogenerated.
type API struct {
Broadcast func(context.Context, fraud.Proof) error
Subscribe func(fraud.ProofType) (fraud.Subscription, error)
Get func(context.Context, fraud.ProofType) ([]fraud.Proof, error)
}
Expand Down
4 changes: 2 additions & 2 deletions nodebuilder/rpc/rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package rpc

import (
"github.com/celestiaorg/celestia-node/api/rpc"
"github.com/celestiaorg/celestia-node/das"
"github.com/celestiaorg/celestia-node/nodebuilder/daser"
"github.com/celestiaorg/celestia-node/nodebuilder/fraud"
"github.com/celestiaorg/celestia-node/nodebuilder/header"
"github.com/celestiaorg/celestia-node/nodebuilder/share"
Expand All @@ -15,7 +15,7 @@ func RegisterEndpoints(
share share.Module,
fraud fraud.Module,
header header.Module,
daser *das.DASer,
daser daser.Module,
serv *rpc.Server,
) {
serv.RegisterService("handler", state)
Expand Down
6 changes: 2 additions & 4 deletions nodebuilder/rpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ import (
func TestRPCCallsUnderlyingNode(t *testing.T) {
nd, server := setupNodeWithModifiedRPC(t)
url := nd.RPCServer.ListenAddr()
port := url[len(url)-6:]
client, closer, err := client.NewClient(context.Background(), "http://0.0.0.0"+port)
client, closer, err := client.NewClient(context.Background(), "http://"+url)
require.NoError(t, err)
defer closer()
ctx := context.Background()
Expand Down Expand Up @@ -104,8 +103,7 @@ func setupNodeWithModifiedRPC(t *testing.T) (*Node, *mocks.MockAPI) {
server := mocks.NewMockAPI(ctrl)

overrideRPCHandler := fx.Invoke(func(srv *rpc.Server) {
handler := rpc.NewHandler(server, server, server, server, server)
handler.RegisterEndpoints(srv)
srv.RegisterService("Handler", server)
})
nd := TestNode(t, node.Full, overrideRPCHandler)
// start node
Expand Down
1 change: 0 additions & 1 deletion nodebuilder/state/service.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
//nolint:dupl
package state

import (
Expand Down
2 changes: 1 addition & 1 deletion nodebuilder/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func TestNodeWithConfig(t *testing.T, tp node.Type, cfg *Config, opts ...fx.Opti
require.NoError(t, err)
cfg.Core.IP = ip
cfg.Core.RPCPort = port
cfg.RPC.Port = "0"
cfg.RPC.Port = "26655"

opts = append(opts,
state.WithKeyringSigner(TestKeyringSigner(t)),
Expand Down

0 comments on commit 093294c

Please sign in to comment.