Commit 078db5de authored by Karthik Bala's avatar Karthik Bala

add transport logic to mocknet

License: MIT
Signed-off-by: default avatarKarthik Bala <karthikbala444@gmail.com>
parent 323fd6cf
...@@ -46,7 +46,7 @@ func (g *SessionGenerator) Next() Instance { ...@@ -46,7 +46,7 @@ func (g *SessionGenerator) Next() Instance {
if err != nil { if err != nil {
panic("FIXME") // TODO change signature panic("FIXME") // TODO change signature
} }
return session(g.ctx, g.net, p) return Session(g.ctx, g.net, p)
} }
func (g *SessionGenerator) Instances(n int) []Instance { func (g *SessionGenerator) Instances(n int) []Instance {
...@@ -85,7 +85,7 @@ func (i *Instance) SetBlockstoreLatency(t time.Duration) time.Duration { ...@@ -85,7 +85,7 @@ func (i *Instance) SetBlockstoreLatency(t time.Duration) time.Duration {
// NB: It's easy make mistakes by providing the same peer ID to two different // NB: It's easy make mistakes by providing the same peer ID to two different
// sessions. To safeguard, use the SessionGenerator to generate sessions. It's // sessions. To safeguard, use the SessionGenerator to generate sessions. It's
// just a much better idea. // just a much better idea.
func session(ctx context.Context, net tn.Network, p testutil.Identity) Instance { func Session(ctx context.Context, net tn.Network, p testutil.Identity) Instance {
bsdelay := delay.Fixed(0) bsdelay := delay.Fixed(0)
const writeCacheElems = 100 const writeCacheElems = 100
......
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