From c7a481767eaf3ad8d7a51e8e9927374d61bb5590 Mon Sep 17 00:00:00 2001 From: nisainan Date: Tue, 13 Sep 2022 15:06:46 +0800 Subject: [PATCH] chore: update go-libp2p to v0.22.0 This commit was moved from ipfs/go-ipfs-routing@e8c4a5b70efe2092ef35af35d543f2189b52b84f --- routing/mock/centralized_client.go | 14 ++++++-------- routing/mock/centralized_server.go | 10 ++++------ routing/mock/centralized_test.go | 5 ++--- routing/mock/interface.go | 7 +++---- routing/none/none_client.go | 10 ++++------ routing/offline/offline.go | 10 ++++------ routing/offline/offline_test.go | 4 ++-- 7 files changed, 25 insertions(+), 35 deletions(-) diff --git a/routing/mock/centralized_client.go b/routing/mock/centralized_client.go index e57d03239..ac3f938cc 100644 --- a/routing/mock/centralized_client.go +++ b/routing/mock/centralized_client.go @@ -4,13 +4,11 @@ import ( "context" "time" - cid "github.com/ipfs/go-cid" + "github.com/ipfs/go-cid" logging "github.com/ipfs/go-log" - - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/routing" - "github.com/libp2p/go-libp2p-testing/net" - + tnet "github.com/libp2p/go-libp2p-testing/net" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/routing" ma "github.com/multiformats/go-multiaddr" ) @@ -22,13 +20,13 @@ type client struct { peer tnet.Identity } -// FIXME(brian): is this method meant to simulate putting a value into the network? +// PutValue FIXME(brian): is this method meant to simulate putting a value into the network? func (c *client) PutValue(ctx context.Context, key string, val []byte, opts ...routing.Option) error { log.Debugf("PutValue: %s", key) return c.vs.PutValue(ctx, key, val, opts...) } -// FIXME(brian): is this method meant to simulate getting a value from the network? +// GetValue FIXME(brian): is this method meant to simulate getting a value from the network? func (c *client) GetValue(ctx context.Context, key string, opts ...routing.Option) ([]byte, error) { log.Debugf("GetValue: %s", key) return c.vs.GetValue(ctx, key, opts...) diff --git a/routing/mock/centralized_server.go b/routing/mock/centralized_server.go index 9c8bd853c..8ff614ca7 100644 --- a/routing/mock/centralized_server.go +++ b/routing/mock/centralized_server.go @@ -6,14 +6,12 @@ import ( "sync" "time" - cid "github.com/ipfs/go-cid" + "github.com/ipfs/go-cid" ds "github.com/ipfs/go-datastore" dssync "github.com/ipfs/go-datastore/sync" - - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-testing/net" - - offline "github.com/ipfs/go-ipfs-routing/offline" + "github.com/ipfs/go-ipfs-routing/offline" + tnet "github.com/libp2p/go-libp2p-testing/net" + "github.com/libp2p/go-libp2p/core/peer" ) // server is the mockrouting.Client's private interface to the routing server diff --git a/routing/mock/centralized_test.go b/routing/mock/centralized_test.go index fc832cf7a..6c36e492a 100644 --- a/routing/mock/centralized_test.go +++ b/routing/mock/centralized_test.go @@ -8,9 +8,8 @@ import ( "github.com/ipfs/go-cid" delay "github.com/ipfs/go-ipfs-delay" u "github.com/ipfs/go-ipfs-util" - - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-testing/net" + tnet "github.com/libp2p/go-libp2p-testing/net" + "github.com/libp2p/go-libp2p/core/peer" ) func TestKeyNotFound(t *testing.T) { diff --git a/routing/mock/interface.go b/routing/mock/interface.go index 6b0206534..35430a72c 100644 --- a/routing/mock/interface.go +++ b/routing/mock/interface.go @@ -9,10 +9,9 @@ import ( ds "github.com/ipfs/go-datastore" delay "github.com/ipfs/go-ipfs-delay" - - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/routing" - "github.com/libp2p/go-libp2p-testing/net" + tnet "github.com/libp2p/go-libp2p-testing/net" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/routing" ) // MockValidator is a record validator that always returns success. diff --git a/routing/none/none_client.go b/routing/none/none_client.go index 2ba1a8f8f..6f400b54a 100644 --- a/routing/none/none_client.go +++ b/routing/none/none_client.go @@ -5,14 +5,12 @@ import ( "context" "errors" - cid "github.com/ipfs/go-cid" + "github.com/ipfs/go-cid" ds "github.com/ipfs/go-datastore" - - "github.com/libp2p/go-libp2p-core/host" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/routing" - record "github.com/libp2p/go-libp2p-record" + "github.com/libp2p/go-libp2p/core/host" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/routing" ) type nilclient struct { diff --git a/routing/offline/offline.go b/routing/offline/offline.go index 0b3083c59..7e4292f56 100644 --- a/routing/offline/offline.go +++ b/routing/offline/offline.go @@ -8,16 +8,14 @@ import ( "errors" "time" - proto "github.com/gogo/protobuf/proto" - cid "github.com/ipfs/go-cid" + "github.com/gogo/protobuf/proto" + "github.com/ipfs/go-cid" ds "github.com/ipfs/go-datastore" dshelp "github.com/ipfs/go-ipfs-ds-help" - - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/routing" - record "github.com/libp2p/go-libp2p-record" pb "github.com/libp2p/go-libp2p-record/pb" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/routing" ) // ErrOffline is returned when trying to perform operations that diff --git a/routing/offline/offline_test.go b/routing/offline/offline_test.go index 00e0174ba..9a17e8689 100644 --- a/routing/offline/offline_test.go +++ b/routing/offline/offline_test.go @@ -8,8 +8,8 @@ import ( cid "github.com/ipfs/go-cid" ds "github.com/ipfs/go-datastore" - "github.com/libp2p/go-libp2p-core/routing" - "github.com/libp2p/go-libp2p-core/test" + "github.com/libp2p/go-libp2p/core/routing" + "github.com/libp2p/go-libp2p/core/test" mh "github.com/multiformats/go-multihash" )