From 4e1ef58c54580ca8d1cad011116b1835854752ac Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Thu, 22 Jul 2021 21:15:16 +0200 Subject: [PATCH] remove deprecated types --- p2p/discovery/routing/routing.go | 10 +++++----- p2p/discovery/routing/routing_test.go | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/p2p/discovery/routing/routing.go b/p2p/discovery/routing/routing.go index 75660af2..a05071da 100644 --- a/p2p/discovery/routing/routing.go +++ b/p2p/discovery/routing/routing.go @@ -5,7 +5,7 @@ import ( "github.com/libp2p/go-libp2p-core/discovery" "time" - cid "github.com/ipfs/go-cid" + "github.com/ipfs/go-cid" "github.com/libp2p/go-libp2p-core/peer" "github.com/libp2p/go-libp2p-core/routing" @@ -23,8 +23,8 @@ func NewRoutingDiscovery(router routing.ContentRouting) *RoutingDiscovery { return &RoutingDiscovery{router} } -func (d *RoutingDiscovery) Advertise(ctx context.Context, ns string, opts ...Option) (time.Duration, error) { - var options Options +func (d *RoutingDiscovery) Advertise(ctx context.Context, ns string, opts ...discovery.Option) (time.Duration, error) { + var options discovery.Options err := options.Apply(opts...) if err != nil { return 0, err @@ -56,8 +56,8 @@ func (d *RoutingDiscovery) Advertise(ctx context.Context, ns string, opts ...Opt return ttl, nil } -func (d *RoutingDiscovery) FindPeers(ctx context.Context, ns string, opts ...Option) (<-chan peer.AddrInfo, error) { - var options Options +func (d *RoutingDiscovery) FindPeers(ctx context.Context, ns string, opts ...discovery.Option) (<-chan peer.AddrInfo, error) { + var options discovery.Options err := options.Apply(opts...) if err != nil { return nil, err diff --git a/p2p/discovery/routing/routing_test.go b/p2p/discovery/routing/routing_test.go index 1a956822..6383d585 100644 --- a/p2p/discovery/routing/routing_test.go +++ b/p2p/discovery/routing/routing_test.go @@ -90,7 +90,7 @@ func TestRoutingDiscovery(t *testing.T) { t.Fatal(err) } - pis, err := FindPeers(ctx, d2, "/test", Limit(20)) + pis, err := FindPeers(ctx, d2, "/test", discovery.Limit(20)) if err != nil { t.Fatal(err) }