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-routing
Commits
3aaf6463
Commit
3aaf6463
authored
Dec 12, 2014
by
Brian Tiger Chow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor(mdag, bserv, bs) mocks, etc.
License: MIT Signed-off-by:
Brian Tiger Chow
<
brian@perfmode.com
>
parent
25824cf5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
5 deletions
+2
-5
mock/routing.go
mock/routing.go
+2
-5
No files found.
mock/routing.go
View file @
3aaf6463
...
@@ -30,10 +30,6 @@ func NewMockRouter(local peer.Peer, dstore ds.Datastore) routing.IpfsRouting {
...
@@ -30,10 +30,6 @@ func NewMockRouter(local peer.Peer, dstore ds.Datastore) routing.IpfsRouting {
}
}
}
}
func
(
mr
*
MockRouter
)
SetRoutingServer
(
rs
RoutingServer
)
{
mr
.
hashTable
=
rs
}
func
(
mr
*
MockRouter
)
PutValue
(
ctx
context
.
Context
,
key
u
.
Key
,
val
[]
byte
)
error
{
func
(
mr
*
MockRouter
)
PutValue
(
ctx
context
.
Context
,
key
u
.
Key
,
val
[]
byte
)
error
{
log
.
Debugf
(
"PutValue: %s"
,
key
)
log
.
Debugf
(
"PutValue: %s"
,
key
)
return
mr
.
datastore
.
Put
(
key
.
DsKey
(),
val
)
return
mr
.
datastore
.
Put
(
key
.
DsKey
(),
val
)
...
@@ -119,7 +115,8 @@ func (rs *hashTable) Announce(p peer.Peer, k u.Key) error {
...
@@ -119,7 +115,8 @@ func (rs *hashTable) Announce(p peer.Peer, k u.Key) error {
func
(
rs
*
hashTable
)
Providers
(
k
u
.
Key
)
[]
peer
.
Peer
{
func
(
rs
*
hashTable
)
Providers
(
k
u
.
Key
)
[]
peer
.
Peer
{
rs
.
lock
.
RLock
()
rs
.
lock
.
RLock
()
defer
rs
.
lock
.
RUnlock
()
defer
rs
.
lock
.
RUnlock
()
ret
:=
make
([]
peer
.
Peer
,
0
)
var
ret
[]
peer
.
Peer
peerset
,
ok
:=
rs
.
providers
[
k
]
peerset
,
ok
:=
rs
.
providers
[
k
]
if
!
ok
{
if
!
ok
{
return
ret
return
ret
...
...
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