Skip to content

Commit

Permalink
fix: cleanup TestDhtProvide
Browse files Browse the repository at this point in the history
And fix for peer ID formatting changes.

fixes ipfs/kubo#6222 (comment)


This commit was moved from ipfs/interface-go-ipfs-core@29b26f5
  • Loading branch information
Stebalien committed Apr 16, 2019
1 parent 25b9995 commit d493b70
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions coreiface/tests/dht.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,17 +130,17 @@ func (tp *provider) TestDhtProvide(t *testing.T) {
t.Fatal(err)
}

provider := <-out
_, ok := <-out

if ok {
t.Fatal("did not expect to find any providers")
}

self0, err := apis[0].Key().Self(ctx)
if err != nil {
t.Fatal(err)
}

if provider.ID.String() != "<peer.ID >" {
t.Errorf("got wrong provider: %s != %s", provider.ID.String(), self0.ID().String())
}

err = apis[0].Dht().Provide(ctx, p)
if err != nil {
t.Fatal(err)
Expand All @@ -151,7 +151,7 @@ func (tp *provider) TestDhtProvide(t *testing.T) {
t.Fatal(err)
}

provider = <-out
provider := <-out

if provider.ID.String() != self0.ID().String() {
t.Errorf("got wrong provider: %s != %s", provider.ID.String(), self0.ID().String())
Expand Down

0 comments on commit d493b70

Please sign in to comment.