Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
237e594a
Commit
237e594a
authored
Dec 24, 2014
by
Brian Tiger Chow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
don't link when creating network client. rely on caller
parent
075841c1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
5 deletions
+2
-5
epictest/addcat_test.go
epictest/addcat_test.go
+2
-1
exchange/bitswap/testnet/peernet.go
exchange/bitswap/testnet/peernet.go
+0
-4
No files found.
epictest/addcat_test.go
View file @
237e594a
...
...
@@ -95,7 +95,8 @@ func AddCatBytes(data []byte, conf Config) error {
// defer mn.Close() FIXME does mocknet require clean-up
mn
.
SetLinkDefaults
(
mocknet
.
LinkOptions
{
Latency
:
conf
.
NetworkLatency
,
Bandwidth
:
math
.
MaxInt32
,
// TODO add to conf
// TODO add to conf. This is tricky because we want 0 values to be functional.
Bandwidth
:
math
.
MaxInt32
,
})
dhtNetwork
:=
mockrouting
.
NewDHTNetwork
(
mn
)
net
,
err
:=
tn
.
StreamNet
(
ctx
,
mn
,
dhtNetwork
)
...
...
exchange/bitswap/testnet/peernet.go
View file @
237e594a
...
...
@@ -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
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment