Commit 4570f1ef authored by Kevin Atkinson's avatar Kevin Atkinson

gx update and fix code to use new Cid type

parent 48ba18db
......@@ -34,7 +34,7 @@ func (c *client) GetValue(ctx context.Context, key string, opts ...ropts.Option)
return c.vs.GetValue(ctx, key, opts...)
}
func (c *client) FindProviders(ctx context.Context, key *cid.Cid) ([]pstore.PeerInfo, error) {
func (c *client) FindProviders(ctx context.Context, key cid.Cid) ([]pstore.PeerInfo, error) {
return c.server.Providers(key), nil
}
......@@ -43,7 +43,7 @@ func (c *client) FindPeer(ctx context.Context, pid peer.ID) (pstore.PeerInfo, er
return pstore.PeerInfo{}, nil
}
func (c *client) FindProvidersAsync(ctx context.Context, k *cid.Cid, max int) <-chan pstore.PeerInfo {
func (c *client) FindProvidersAsync(ctx context.Context, k cid.Cid, max int) <-chan pstore.PeerInfo {
out := make(chan pstore.PeerInfo)
go func() {
defer close(out)
......@@ -63,7 +63,7 @@ func (c *client) FindProvidersAsync(ctx context.Context, k *cid.Cid, max int) <-
// Provide returns once the message is on the network. Value is not necessarily
// visible yet.
func (c *client) Provide(_ context.Context, key *cid.Cid, brd bool) error {
func (c *client) Provide(_ context.Context, key cid.Cid, brd bool) error {
if !brd {
return nil
}
......
......@@ -18,8 +18,8 @@ import (
// server is the mockrouting.Client's private interface to the routing server
type server interface {
Announce(pstore.PeerInfo, *cid.Cid) error
Providers(*cid.Cid) []pstore.PeerInfo
Announce(pstore.PeerInfo, cid.Cid) error
Providers(cid.Cid) []pstore.PeerInfo
Server
}
......@@ -37,7 +37,7 @@ type providerRecord struct {
Created time.Time
}
func (rs *s) Announce(p pstore.PeerInfo, c *cid.Cid) error {
func (rs *s) Announce(p pstore.PeerInfo, c cid.Cid) error {
rs.lock.Lock()
defer rs.lock.Unlock()
......@@ -54,7 +54,7 @@ func (rs *s) Announce(p pstore.PeerInfo, c *cid.Cid) error {
return nil
}
func (rs *s) Providers(c *cid.Cid) []pstore.PeerInfo {
func (rs *s) Providers(c cid.Cid) []pstore.PeerInfo {
rs.delayConf.Query.Wait() // before locking
rs.lock.RLock()
......
......@@ -30,13 +30,13 @@ func (c *nilclient) FindPeer(_ context.Context, _ peer.ID) (pstore.PeerInfo, err
return pstore.PeerInfo{}, nil
}
func (c *nilclient) FindProvidersAsync(_ context.Context, _ *cid.Cid, _ int) <-chan pstore.PeerInfo {
func (c *nilclient) FindProvidersAsync(_ context.Context, _ cid.Cid, _ int) <-chan pstore.PeerInfo {
out := make(chan pstore.PeerInfo)
defer close(out)
return out
}
func (c *nilclient) Provide(_ context.Context, _ *cid.Cid, _ bool) error {
func (c *nilclient) Provide(_ context.Context, _ cid.Cid, _ bool) error {
return nil
}
......
......@@ -94,13 +94,13 @@ func (c *offlineRouting) FindPeer(ctx context.Context, pid peer.ID) (pstore.Peer
return pstore.PeerInfo{}, ErrOffline
}
func (c *offlineRouting) FindProvidersAsync(ctx context.Context, k *cid.Cid, max int) <-chan pstore.PeerInfo {
func (c *offlineRouting) FindProvidersAsync(ctx context.Context, k cid.Cid, max int) <-chan pstore.PeerInfo {
out := make(chan pstore.PeerInfo)
close(out)
return out
}
func (c *offlineRouting) Provide(_ context.Context, k *cid.Cid, _ bool) error {
func (c *offlineRouting) Provide(_ context.Context, k cid.Cid, _ bool) error {
return ErrOffline
}
......
......@@ -14,9 +14,9 @@
"version": "3.0.9"
},
{
"hash": "QmY9JUvS8kbgao3XbPh6WAV3ChE2nxGKhcGTHiwMC4gmcU",
"hash": "QmdKS5YtmuSWKuLLgbHG176mS3VX3AKiyVmaaiAfvgcuch",
"name": "go-libp2p-routing",
"version": "2.4.10"
"version": "2.5.0"
},
{
"author": "whyrusleeping",
......@@ -32,9 +32,9 @@
},
{
"author": "whyrusleeping",
"hash": "QmZFbDTY9jfSBms2MchvYM9oYRbAF19K7Pby47yDBfpPrb",
"hash": "QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7",
"name": "go-cid",
"version": "0.8.0"
"version": "0.9.0"
},
{
"author": "jbenet",
......@@ -61,9 +61,9 @@
},
{
"author": "hsanjuan",
"hash": "Qmf1xGr3SyBpiPp3ZDuKkYMh4gnRk9K4QnbL17kstnf35h",
"hash": "QmXejiSr776HgKLEGSs7unW7GT82AgfMbQX5crfSybGU8b",
"name": "go-ipfs-ds-help",
"version": "0.0.10"
"version": "0.1.0"
},
{
"author": "whyrusleeping",
......
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