|
|
@ -3,6 +3,7 @@ package discovery |
|
|
|
import ( |
|
|
|
import ( |
|
|
|
"testing" |
|
|
|
"testing" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"github.com/harmony-one/harmony/api/service" |
|
|
|
"github.com/harmony-one/harmony/internal/utils" |
|
|
|
"github.com/harmony-one/harmony/internal/utils" |
|
|
|
"github.com/harmony-one/harmony/p2p" |
|
|
|
"github.com/harmony-one/harmony/p2p" |
|
|
|
"github.com/harmony-one/harmony/p2p/p2pimpl" |
|
|
|
"github.com/harmony-one/harmony/p2p/p2pimpl" |
|
|
@ -11,7 +12,7 @@ import ( |
|
|
|
var ( |
|
|
|
var ( |
|
|
|
ip = "127.0.0.1" |
|
|
|
ip = "127.0.0.1" |
|
|
|
port = "7099" |
|
|
|
port = "7099" |
|
|
|
service *Service |
|
|
|
dService *Service |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
func TestDiscoveryService(t *testing.T) { |
|
|
|
func TestDiscoveryService(t *testing.T) { |
|
|
@ -23,9 +24,11 @@ func TestDiscoveryService(t *testing.T) { |
|
|
|
t.Fatalf("unable to new host in harmony: %v", err) |
|
|
|
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") |
|
|
|
t.Fatalf("unable to create new discovery service") |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|