From 3db9ba578e689317c057887dc82c9d55a9d17600 Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Wed, 17 Aug 2022 11:26:53 +0300 Subject: [PATCH] switch from github.com/libp2p/go-eventbus to p2p/host/eventbus --- p2p/host/autonat/autonat.go | 3 ++- p2p/host/basic/basic_host.go | 2 +- p2p/host/basic/basic_host_test.go | 2 +- p2p/host/blank/blank.go | 4 ++-- p2p/host/pstoremanager/pstoremanager_test.go | 3 +-- p2p/protocol/identify/id.go | 11 +++++------ p2p/protocol/identify/id_test.go | 3 +-- p2p/protocol/identify/obsaddr.go | 2 +- p2p/protocol/identify/obsaddr_test.go | 2 +- 9 files changed, 15 insertions(+), 17 deletions(-) diff --git a/p2p/host/autonat/autonat.go b/p2p/host/autonat/autonat.go index 3439e49b58..68b330a46b 100644 --- a/p2p/host/autonat/autonat.go +++ b/p2p/host/autonat/autonat.go @@ -7,7 +7,8 @@ import ( "sync/atomic" "time" - "github.com/libp2p/go-eventbus" + "github.com/libp2p/go-libp2p/p2p/host/eventbus" + "github.com/libp2p/go-libp2p-core/event" "github.com/libp2p/go-libp2p-core/host" "github.com/libp2p/go-libp2p-core/network" diff --git a/p2p/host/basic/basic_host.go b/p2p/host/basic/basic_host.go index cc6b7e98f6..423cbe87a8 100644 --- a/p2p/host/basic/basic_host.go +++ b/p2p/host/basic/basic_host.go @@ -10,6 +10,7 @@ import ( "time" "github.com/libp2p/go-libp2p/p2p/host/autonat" + "github.com/libp2p/go-libp2p/p2p/host/eventbus" "github.com/libp2p/go-libp2p/p2p/host/pstoremanager" "github.com/libp2p/go-libp2p/p2p/host/relaysvc" inat "github.com/libp2p/go-libp2p/p2p/net/nat" @@ -28,7 +29,6 @@ import ( "github.com/libp2p/go-libp2p-core/protocol" "github.com/libp2p/go-libp2p-core/record" - "github.com/libp2p/go-eventbus" "github.com/libp2p/go-netroute" logging "github.com/ipfs/go-log/v2" diff --git a/p2p/host/basic/basic_host_test.go b/p2p/host/basic/basic_host_test.go index c894143b80..333ae03755 100644 --- a/p2p/host/basic/basic_host_test.go +++ b/p2p/host/basic/basic_host_test.go @@ -11,6 +11,7 @@ import ( "time" "github.com/libp2p/go-libp2p/p2p/host/autonat" + "github.com/libp2p/go-libp2p/p2p/host/eventbus" swarmt "github.com/libp2p/go-libp2p/p2p/net/swarm/testing" "github.com/libp2p/go-libp2p/p2p/protocol/identify" @@ -24,7 +25,6 @@ import ( "github.com/libp2p/go-libp2p-core/record" "github.com/libp2p/go-libp2p-core/test" - "github.com/libp2p/go-eventbus" ma "github.com/multiformats/go-multiaddr" madns "github.com/multiformats/go-multiaddr-dns" diff --git a/p2p/host/blank/blank.go b/p2p/host/blank/blank.go index 7b917da16b..08f1f2fa48 100644 --- a/p2p/host/blank/blank.go +++ b/p2p/host/blank/blank.go @@ -6,6 +6,8 @@ import ( "fmt" "io" + "github.com/libp2p/go-libp2p/p2p/host/eventbus" + "github.com/libp2p/go-libp2p-core/connmgr" "github.com/libp2p/go-libp2p-core/event" "github.com/libp2p/go-libp2p-core/host" @@ -15,8 +17,6 @@ import ( "github.com/libp2p/go-libp2p-core/protocol" "github.com/libp2p/go-libp2p-core/record" - "github.com/libp2p/go-eventbus" - logging "github.com/ipfs/go-log/v2" ma "github.com/multiformats/go-multiaddr" diff --git a/p2p/host/pstoremanager/pstoremanager_test.go b/p2p/host/pstoremanager/pstoremanager_test.go index 72beb874e6..dec09cdf76 100644 --- a/p2p/host/pstoremanager/pstoremanager_test.go +++ b/p2p/host/pstoremanager/pstoremanager_test.go @@ -4,14 +4,13 @@ import ( "testing" "time" + "github.com/libp2p/go-libp2p/p2p/host/eventbus" "github.com/libp2p/go-libp2p/p2p/host/pstoremanager" "github.com/libp2p/go-libp2p-core/event" "github.com/libp2p/go-libp2p-core/network" "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-eventbus" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" ) diff --git a/p2p/protocol/identify/id.go b/p2p/protocol/identify/id.go index 9f5446bfd6..8e520deace 100644 --- a/p2p/protocol/identify/id.go +++ b/p2p/protocol/identify/id.go @@ -15,17 +15,16 @@ import ( "github.com/libp2p/go-libp2p-core/peerstore" "github.com/libp2p/go-libp2p-core/record" - "github.com/libp2p/go-eventbus" - "github.com/libp2p/go-msgio/protoio" - + "github.com/libp2p/go-libp2p/p2p/host/eventbus" pb "github.com/libp2p/go-libp2p/p2p/protocol/identify/pb" - ma "github.com/multiformats/go-multiaddr" - manet "github.com/multiformats/go-multiaddr/net" - msmux "github.com/multiformats/go-multistream" + "github.com/libp2p/go-msgio/protoio" "github.com/gogo/protobuf/proto" logging "github.com/ipfs/go-log/v2" + ma "github.com/multiformats/go-multiaddr" + manet "github.com/multiformats/go-multiaddr/net" + msmux "github.com/multiformats/go-multistream" ) var log = logging.Logger("net/identify") diff --git a/p2p/protocol/identify/id_test.go b/p2p/protocol/identify/id_test.go index b4411dbcfb..ae6ed4b256 100644 --- a/p2p/protocol/identify/id_test.go +++ b/p2p/protocol/identify/id_test.go @@ -11,6 +11,7 @@ import ( "github.com/libp2p/go-libp2p" blhost "github.com/libp2p/go-libp2p/p2p/host/blank" + "github.com/libp2p/go-libp2p/p2p/host/eventbus" "github.com/libp2p/go-libp2p/p2p/host/peerstore/pstoremem" mocknet "github.com/libp2p/go-libp2p/p2p/net/mock" "github.com/libp2p/go-libp2p/p2p/net/swarm" @@ -28,8 +29,6 @@ import ( "github.com/libp2p/go-libp2p-core/record" coretest "github.com/libp2p/go-libp2p-core/test" - "github.com/libp2p/go-eventbus" - mockClock "github.com/benbjohnson/clock" logging "github.com/ipfs/go-log/v2" "github.com/libp2p/go-msgio/protoio" diff --git a/p2p/protocol/identify/obsaddr.go b/p2p/protocol/identify/obsaddr.go index c722f09a05..31e7269263 100644 --- a/p2p/protocol/identify/obsaddr.go +++ b/p2p/protocol/identify/obsaddr.go @@ -7,11 +7,11 @@ import ( "sync" "time" - "github.com/libp2p/go-eventbus" "github.com/libp2p/go-libp2p-core/event" "github.com/libp2p/go-libp2p-core/host" "github.com/libp2p/go-libp2p-core/network" "github.com/libp2p/go-libp2p-core/peerstore" + "github.com/libp2p/go-libp2p/p2p/host/eventbus" ma "github.com/multiformats/go-multiaddr" manet "github.com/multiformats/go-multiaddr/net" diff --git a/p2p/protocol/identify/obsaddr_test.go b/p2p/protocol/identify/obsaddr_test.go index f970a1b247..ea5dc0ae36 100644 --- a/p2p/protocol/identify/obsaddr_test.go +++ b/p2p/protocol/identify/obsaddr_test.go @@ -5,6 +5,7 @@ import ( "testing" "time" + "github.com/libp2p/go-libp2p/p2p/host/eventbus" mocknet "github.com/libp2p/go-libp2p/p2p/net/mock" "github.com/libp2p/go-libp2p/p2p/protocol/identify" @@ -14,7 +15,6 @@ import ( "github.com/libp2p/go-libp2p-core/network" "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-eventbus" ma "github.com/multiformats/go-multiaddr" "github.com/stretchr/testify/require" )