From 2ec71caad024fc261563d602f971502233526022 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Mon, 15 Apr 2019 21:58:51 -0700 Subject: [PATCH] fix: cleanup TestDhtProvide And fix for peer ID formatting changes. fixes https://github.com/ipfs/go-ipfs/pull/6222#issuecomment-483479039 This commit was moved from ipfs/interface-go-ipfs-core@29b26f5bcb322e936e67dfbb7b0a5264b7e23089 --- coreapi/iface/tests/dht.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/coreapi/iface/tests/dht.go b/coreapi/iface/tests/dht.go index 1793cd738..5482b50b1 100644 --- a/coreapi/iface/tests/dht.go +++ b/coreapi/iface/tests/dht.go @@ -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() != "" { - 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) @@ -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())