Skip to content

Commit

Permalink
coreapi/dht: fix test panic
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
  • Loading branch information
magik6k committed Mar 30, 2018
1 parent 5f75628 commit ae14365
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions core/coreapi/dht_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ func TestDhtFindPeer(t *testing.T) {

addr := <-out

if addr.String() != "/ip4/127.0.0.1/tcp/4001" {
t.Errorf("got unexpected address from FindPeer: %s", addr.String())
if addr == nil || addr.String() != "/ip4/127.0.0.1/tcp/4001" {
t.Errorf("got unexpected address from FindPeer: %s", addr)
}

out, err = apis[1].Dht().FindPeer(ctx, peer.ID(nds[2].Identity))
Expand All @@ -38,8 +38,8 @@ func TestDhtFindPeer(t *testing.T) {

addr = <-out

if addr.String() != "/ip4/127.0.2.1/tcp/4001" {
t.Errorf("got unexpected address from FindPeer: %s", addr.String())
if addr == nil || addr.String() != "/ip4/127.0.2.1/tcp/4001" {
t.Errorf("got unexpected address from FindPeer: %s", addr)
}
}

Expand Down

0 comments on commit ae14365

Please sign in to comment.