diff --git a/go.mod b/go.mod index e304c120c0..24b81252a0 100644 --- a/go.mod +++ b/go.mod @@ -60,7 +60,6 @@ require ( github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/cheekybits/genny v1.0.0 // indirect github.com/containerd/cgroups v1.0.4 // indirect - github.com/coreos/go-semver v0.3.0 // indirect github.com/coreos/go-systemd/v22 v22.3.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect diff --git a/go.sum b/go.sum index 73fa9eaa00..5645fdce78 100644 --- a/go.sum +++ b/go.sum @@ -94,7 +94,6 @@ github.com/containerd/cgroups v1.0.4/go.mod h1:nLNQtsF7Sl2HxNebu77i1R0oDlhiTG+kO github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.1.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= diff --git a/p2p/host/basic/basic_host_test.go b/p2p/host/basic/basic_host_test.go index c894143b80..3a249059f2 100644 --- a/p2p/host/basic/basic_host_test.go +++ b/p2p/host/basic/basic_host_test.go @@ -15,7 +15,6 @@ import ( "github.com/libp2p/go-libp2p/p2p/protocol/identify" "github.com/libp2p/go-libp2p-core/event" - "github.com/libp2p/go-libp2p-core/helpers" "github.com/libp2p/go-libp2p-core/host" "github.com/libp2p/go-libp2p-core/network" "github.com/libp2p/go-libp2p-core/peer" @@ -272,9 +271,6 @@ func assertWait(t *testing.T, c chan protocol.ID, exp protocol.ID) { } func TestHostProtoPreference(t *testing.T) { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - h1, h2 := getHostPair(t) defer h1.Close() defer h2.Close() @@ -297,7 +293,7 @@ func TestHostProtoPreference(t *testing.T) { h2.SetStreamHandler(protoOld, handler) - s, err := h1.NewStream(ctx, h2.ID(), protoMinor, protoNew, protoOld) + s, err := h1.NewStream(context.Background(), h2.ID(), protoMinor, protoNew, protoOld) require.NoError(t, err) // force the lazy negotiation to complete @@ -307,12 +303,9 @@ func TestHostProtoPreference(t *testing.T) { assertWait(t, connectedOn, protoOld) s.Close() - mfunc, err := helpers.MultistreamSemverMatcher(protoMinor) - require.NoError(t, err) - h2.SetStreamHandlerMatch(protoMinor, mfunc, handler) - + h2.SetStreamHandlerMatch(protoMinor, func(string) bool { return true }, handler) // remembered preference will be chosen first, even when the other side newly supports it - s2, err := h1.NewStream(ctx, h2.ID(), protoMinor, protoNew, protoOld) + s2, err := h1.NewStream(context.Background(), h2.ID(), protoMinor, protoNew, protoOld) require.NoError(t, err) // required to force 'lazy' handshake @@ -322,7 +315,7 @@ func TestHostProtoPreference(t *testing.T) { assertWait(t, connectedOn, protoOld) s2.Close() - s3, err := h1.NewStream(ctx, h2.ID(), protoMinor) + s3, err := h1.NewStream(context.Background(), h2.ID(), protoMinor) require.NoError(t, err) // Force a lazy handshake as we may have received a protocol update by this point.