@cryptotaxi247 / kubo / commits / 81a67338f

fix(bitswap) remove peerstore

Brian Tiger Chow committed Dec 23, 2014 at 15:08 UTC 81a67338f10040ef326d1aa93a216a8b7cbbf93a
1 file changed +2 -4
exchange/bitswap/testutils.go
+2 -4
@@ -18,7 +18,6 @@ func NewSessionGenerator(
18 net tn.Network) SessionGenerator {
19 ctx, cancel := context.WithCancel(context.TODO())
20 return SessionGenerator{
21 - ps: peer.NewPeerstore(),
21 net: net,
22 seq: 0,
23 ctx: ctx, // TODO take ctx as param to Next, Instances
@@ -30,7 +29,6 @@ func NewSessionGenerator(
29 type SessionGenerator struct {
30 seq int
31 net tn.Network
33 - ps peer.Peerstore
32 ctx context.Context
33 cancel context.CancelFunc
34 }
@@ -42,7 +40,7 @@ func (g *SessionGenerator) Close() error {
40
41 func (g *SessionGenerator) Next() Instance {
42 g.seq++
45 - return session(g.ctx, g.net, g.ps, peer.ID(g.seq))
43 + return session(g.ctx, g.net, peer.ID(g.seq))
44 }
45
46 func (g *SessionGenerator) Instances(n int) []Instance {
@@ -75,7 +73,7 @@ func (i *Instance) SetBlockstoreLatency(t time.Duration) time.Duration {
73 // NB: It's easy make mistakes by providing the same peer ID to two different
74 // sessions. To safeguard, use the SessionGenerator to generate sessions. It's
75 // just a much better idea.
78 -func session(ctx context.Context, net tn.Network, ps peer.Peerstore, p peer.ID) Instance {
76 +func session(ctx context.Context, net tn.Network, p peer.ID) Instance {
77
78 adapter := net.Adapter(p)
79