fix go test error

Signed-off-by: Leo Chen <leo@harmony.one>
pull/465/head
Leo Chen 6 years ago
parent 9628430bdf
commit bd8c13cbf6
  1. 13
      api/service/discovery/discovery_test.go

@ -3,15 +3,16 @@ package discovery
import (
"testing"
"github.com/harmony-one/harmony/api/service"
"github.com/harmony-one/harmony/internal/utils"
"github.com/harmony-one/harmony/p2p"
"github.com/harmony-one/harmony/p2p/p2pimpl"
)
var (
ip = "127.0.0.1"
port = "7099"
service *Service
ip = "127.0.0.1"
port = "7099"
dService *Service
)
func TestDiscoveryService(t *testing.T) {
@ -23,9 +24,11 @@ func TestDiscoveryService(t *testing.T) {
t.Fatalf("unable to new host in harmony: %v", err)
}
service = New(host, "rendezvous", nil, nil)
config := service.NodeConfig{}
if service == nil {
dService = New(host, config, nil)
if dService == nil {
t.Fatalf("unable to create new discovery service")
}
}

Loading…
Cancel
Save