diff --git a/p2p/host/basic/basic_host_test.go b/p2p/host/basic/basic_host_test.go index e52222d97e5060b7942982a3e2324df26f725d72..8ff677dbfa32076f8b408f074e7bf6145fca7cea 100644 --- a/p2p/host/basic/basic_host_test.go +++ b/p2p/host/basic/basic_host_test.go @@ -214,3 +214,31 @@ func TestHostProtoPreknowledge(t *testing.T) { s.Close() } + +func TestNewDialOld(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + h1, h2 := getHostPair(ctx, t) + defer h1.Close() + defer h2.Close() + + connectedOn := make(chan protocol.ID, 16) + h1.SetStreamHandler("/testing", func(s inet.Stream) { + connectedOn <- s.Protocol() + s.Close() + }) + + s, err := h2.NewStream(ctx, h1.ID(), "/testing/1.0.0", "/testing") + if err != nil { + t.Fatal(err) + } + + assertWait(t, connectedOn, "/testing") + + if s.Protocol() != "/testing" { + t.Fatal("shoould have gotten /testing") + } + + s.Close() +} diff --git a/package.json b/package.json index 75ee864587b06e3a4f5e67ccf53b871d7210b1f6..623b72a2284d9bd78c449c83f6096c8a786422f6 100644 --- a/package.json +++ b/package.json @@ -159,9 +159,9 @@ }, { "author": "whyrusleeping", - "hash": "Qmep1A25MDNZxMno8oHZ5ForA5T2gw1EXAGdZzGCCpDD4n", + "hash": "QmbRuJ16EfPGWuEguoNxwPacpeHFUAZb2XQXVvUt5Vxg5q", "name": "go-libp2p-transport", - "version": "1.3.4" + "version": "1.3.5" }, { "author": "whyrusleeping",