mirror of
https://github.com/ipfs/kubo.git
synced 2025-09-09 19:32:24 +08:00
don't link when creating network client. rely on caller
This commit is contained in:
@ -20,14 +20,10 @@ func StreamNet(ctx context.Context, net mockpeernet.Mocknet, rs mockrouting.Serv
|
||||
}
|
||||
|
||||
func (pn *peernet) Adapter(p testutil.Peer) bsnet.BitSwapNetwork {
|
||||
peers := pn.Mocknet.Peers()
|
||||
client, err := pn.Mocknet.AddPeer(p.PrivateKey(), p.Address())
|
||||
if err != nil {
|
||||
panic(err.Error())
|
||||
}
|
||||
for _, other := range peers {
|
||||
pn.Mocknet.LinkPeers(p.ID(), other)
|
||||
}
|
||||
routing := pn.routingserver.ClientWithDatastore(context.TODO(), p, ds.NewMapDatastore())
|
||||
return bsnet.NewFromIpfsNetwork(client, routing)
|
||||
}
|
||||
|
Reference in New Issue
Block a user