Commit d7ff47d8 authored by Brian Tiger Chow's avatar Brian Tiger Chow

don't link when creating network client. rely on caller

parent c6684e18
...@@ -20,14 +20,10 @@ func StreamNet(ctx context.Context, net mockpeernet.Mocknet, rs mockrouting.Serv ...@@ -20,14 +20,10 @@ func StreamNet(ctx context.Context, net mockpeernet.Mocknet, rs mockrouting.Serv
} }
func (pn *peernet) Adapter(p testutil.Peer) bsnet.BitSwapNetwork { func (pn *peernet) Adapter(p testutil.Peer) bsnet.BitSwapNetwork {
peers := pn.Mocknet.Peers()
client, err := pn.Mocknet.AddPeer(p.PrivateKey(), p.Address()) client, err := pn.Mocknet.AddPeer(p.PrivateKey(), p.Address())
if err != nil { if err != nil {
panic(err.Error()) panic(err.Error())
} }
for _, other := range peers {
pn.Mocknet.LinkPeers(p.ID(), other)
}
routing := pn.routingserver.ClientWithDatastore(context.TODO(), p, ds.NewMapDatastore()) routing := pn.routingserver.ClientWithDatastore(context.TODO(), p, ds.NewMapDatastore())
return bsnet.NewFromIpfsNetwork(client, routing) return bsnet.NewFromIpfsNetwork(client, routing)
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment