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
8451a895
Commit
8451a895
authored
Jan 20, 2017
by
Zander Mackie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove deprecated 'FindProviders' method from mock
License: MIT Signed-off-by:
Zander Mackie
<
zmackie@gmail.com
>
parent
8a0870c2
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
15 deletions
+8
-15
mock/centralized_test.go
mock/centralized_test.go
+8
-8
mock/interface.go
mock/interface.go
+0
-3
offline/offline.go
offline/offline.go
+0
-4
No files found.
mock/centralized_test.go
View file @
8451a895
...
...
@@ -7,7 +7,6 @@ import (
delay
"github.com/ipfs/go-ipfs/thirdparty/delay"
"github.com/ipfs/go-ipfs/thirdparty/testutil"
u
"gx/ipfs/Qmb912gdngC1UWwTkhuW8knyRbcWeu5kqkxBpveLmW8bSr/go-ipfs-util"
cid
"gx/ipfs/QmcTcsTvfaeEBRFo1TkFgT8sRmgi1n1LTZpecfVP8fzpGD/go-cid"
pstore
"gx/ipfs/QmeXj9VAjmYQZxpmVz7VzccbJrpmr8qkCDSjfVNsPTWTYU/go-libp2p-peerstore"
...
...
@@ -154,20 +153,21 @@ func TestValidAfter(t *testing.T) {
rs
.
Client
(
pi
)
.
Provide
(
ctx
,
key
)
var
providers
[]
pstore
.
PeerInfo
providers
,
err
:=
rs
.
Client
(
pi
)
.
FindProviders
(
ctx
,
key
)
if
err
!=
nil
{
t
.
Fatal
(
err
)
max
:=
100
providersChan
:=
rs
.
Client
(
pi
)
.
FindProvidersAsync
(
ctx
,
key
,
max
)
for
p
:=
range
providersChan
{
providers
=
append
(
providers
,
p
)
}
if
len
(
providers
)
>
0
{
t
.
Fail
()
}
conf
.
ValueVisibility
.
Set
(
0
)
providers
,
err
=
rs
.
Client
(
pi
)
.
FindProviders
(
ctx
,
key
)
if
err
!=
nil
{
t
.
Fatal
(
err
)
}
providersChan
=
rs
.
Client
(
pi
)
.
FindProvidersAsync
(
ctx
,
key
,
max
)
t
.
Log
(
"providers"
,
providers
)
for
p
:=
range
providersChan
{
providers
=
append
(
providers
,
p
)
}
if
len
(
providers
)
!=
1
{
t
.
Fail
()
}
...
...
mock/interface.go
View file @
8451a895
...
...
@@ -12,8 +12,6 @@ import (
ds
"gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore"
routing
"gx/ipfs/QmbkGVaN9W6RYJK4Ws5FvMKXKDqdRQ5snhtaa92qP6L8eU/go-libp2p-routing"
cid
"gx/ipfs/QmcTcsTvfaeEBRFo1TkFgT8sRmgi1n1LTZpecfVP8fzpGD/go-cid"
pstore
"gx/ipfs/QmeXj9VAjmYQZxpmVz7VzccbJrpmr8qkCDSjfVNsPTWTYU/go-libp2p-peerstore"
peer
"gx/ipfs/QmfMmLGoKzCHDN7cGgk64PJr4iipzidDRME8HABSJqvmhC/go-libp2p-peer"
)
...
...
@@ -25,7 +23,6 @@ type Server interface {
// Client implements IpfsRouting
type
Client
interface
{
FindProviders
(
context
.
Context
,
*
cid
.
Cid
)
([]
pstore
.
PeerInfo
,
error
)
routing
.
IpfsRouting
}
...
...
offline/offline.go
View file @
8451a895
...
...
@@ -91,10 +91,6 @@ func (c *offlineRouting) GetValues(ctx context.Context, key string, _ int) ([]ro
},
nil
}
func
(
c
*
offlineRouting
)
FindProviders
(
ctx
context
.
Context
,
key
*
cid
.
Cid
)
([]
pstore
.
PeerInfo
,
error
)
{
return
nil
,
ErrOffline
}
func
(
c
*
offlineRouting
)
FindPeer
(
ctx
context
.
Context
,
pid
peer
.
ID
)
(
pstore
.
PeerInfo
,
error
)
{
return
pstore
.
PeerInfo
{},
ErrOffline
}
...
...
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