mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-26 21:07:45 +08:00
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@29b26f5bcb This commit was moved from ipfs/boxo@d493b70194
This commit is contained in:
parent
6f77341fd6
commit
eb58ebe446
@ -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)
|
||||
@ -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())
|
||||
|
||||
Loading…
Reference in New Issue
Block a user