fix tests for swarm refactor

This commit is contained in:
Steven Allen 2018-02-16 19:42:39 -08:00
parent bac5c5ae79
commit d02440c25d
2 changed files with 15 additions and 19 deletions

View File

@ -11,8 +11,8 @@ import (
"time"
host "github.com/libp2p/go-libp2p-host"
netutil "github.com/libp2p/go-libp2p-netutil"
peer "github.com/libp2p/go-libp2p-peer"
swarmt "github.com/libp2p/go-libp2p-swarm/testing"
//bhost "github.com/libp2p/go-libp2p/p2p/host/basic"
bhost "github.com/libp2p/go-libp2p-blankhost"
)
@ -37,7 +37,7 @@ func getNetHosts(t *testing.T, ctx context.Context, n int) []host.Host {
var out []host.Host
for i := 0; i < n; i++ {
netw := netutil.GenSwarmNetwork(t, ctx)
netw := swarmt.GenSwarm(t, ctx)
h := bhost.NewBlankHost(netw)
out = append(out, h)
}
@ -777,11 +777,7 @@ func TestPeerDisconnect(t *testing.T) {
peers := psubs[0].ListPeers("foo")
assertPeerList(t, peers, hosts[1].ID())
for _, c := range hosts[1].Network().ConnsToPeer(hosts[0].ID()) {
streams, err := c.GetStreams()
if err != nil {
t.Fatal(err)
}
for _, s := range streams {
for _, s := range c.GetStreams() {
s.Close()
}
}

View File

@ -21,27 +21,21 @@
},
{
"author": "whyrusleeping",
"hash": "QmaSfSMvc1VPZ8JbMponFs4WHvF9FgEruF56opm5E1RgQA",
"hash": "QmdHyfNVTZ5VtUx4Xz23z8wtnioSrFQ28XSfpVkdhQBkGA",
"name": "go-libp2p-host",
"version": "2.1.8"
"version": "3.0.0"
},
{
"author": "whyrusleeping",
"hash": "Qma2UuHusnaFV24DgeZ5hyrM9uc4UdyVaZbtn2FQsPRhES",
"name": "go-libp2p-netutil",
"version": "0.3.13"
},
{
"author": "whyrusleeping",
"hash": "QmYEmPwCBe7ZUFfuymozopHTuF3JXejvJPDAjwtyQCrsDi",
"hash": "QmQ6ASb73YCy77TLfxzKnzQFUyFKMQzDhmjwjaQp6rxK34",
"name": "go-libp2p-blankhost",
"version": "0.2.8"
"version": "0.3.0"
},
{
"author": "whyrusleeping",
"hash": "QmXoz9o2PT3tEzf7hicegwex5UgVP54n3k82K7jrWFyN86",
"hash": "QmYj8wdn5sZEHX2XMDWGBvcXJNdzVbaVpHmXvhHBVZepen",
"name": "go-libp2p-net",
"version": "2.0.7"
"version": "3.0.0"
},
{
"hash": "QmTG23dvpBCBjqQwyDxV8CQT6jmS4PSftNr1VqHhE3MLy7",
@ -65,6 +59,12 @@
"hash": "QmZNkThpqfVXs9GNbexPrfBbXSLNYeKrE7jwFM2oqHbyqN",
"name": "go-libp2p-protocol",
"version": "1.0.0"
},
{
"author": "whyrusleeping",
"hash": "QmPzT3rJnSP8VFP1kw7Ly7HP8AprKNZtwLHXHnxfVSbWT3",
"name": "go-libp2p-swarm",
"version": "3.0.0"
}
],
"gxVersion": "0.9.0",