diff --git a/core/builder.go b/core/builder.go index baef82ed06d..c0ba93d4059 100644 --- a/core/builder.go +++ b/core/builder.go @@ -1,6 +1,7 @@ package core import ( + "context" "crypto/rand" "encoding/base64" "errors" @@ -17,14 +18,13 @@ import ( repo "github.com/ipfs/go-ipfs/repo" cfg "github.com/ipfs/go-ipfs/repo/config" - context "context" retry "gx/ipfs/QmPF5kxTYFkzhaY5LmkExood7aTTZBHWQC6cjdDQBuGrjp/retry-datastore" metrics "gx/ipfs/QmRg1gKTHzc3CZXSKzem8aR4E3TubFhbgXwfVuWnSK5CC5/go-metrics-interface" goprocessctx "gx/ipfs/QmSF8fPo3jgVBAy8fpdjjYqgG87dkJgUprRBHRd2tmfgpP/goprocess/context" pstore "gx/ipfs/QmXXCcQ7CLg5a81Ui9TTR35QcR4y7ZyihxwfjqaHfUVcVo/go-libp2p-peerstore" - key "gx/ipfs/QmYEoKZXHoAToWfhGF3vryhMn3WWhE1o2MasQ8uzY5iDi9/go-key" ds "gx/ipfs/QmbzuUusHqaLLoNTDEVLcSF6vZDHZDLPC7p4bztRvvkXxU/go-datastore" dsync "gx/ipfs/QmbzuUusHqaLLoNTDEVLcSF6vZDHZDLPC7p4bztRvvkXxU/go-datastore/sync" + peer "gx/ipfs/QmfMmLGoKzCHDN7cGgk64PJr4iipzidDRME8HABSJqvmhC/go-libp2p-peer" ci "gx/ipfs/QmfWDLQjGjVe4fr5CoztYW2DYYjRysMJrFe1RCsXLPTf46/go-libp2p-crypto" ) @@ -91,7 +91,7 @@ func defaultRepo(dstore repo.Datastore) (repo.Repo, error) { return nil, err } - data, err := pub.Hash() + pid, err := peer.IDFromPublicKey(pub) if err != nil { return nil, err } @@ -103,7 +103,7 @@ func defaultRepo(dstore repo.Datastore) (repo.Repo, error) { c.Bootstrap = cfg.DefaultBootstrapAddresses c.Addresses.Swarm = []string{"/ip4/0.0.0.0/tcp/4001"} - c.Identity.PeerID = key.Key(data).B58String() + c.Identity.PeerID = pid.Pretty() c.Identity.PrivKey = base64.StdEncoding.EncodeToString(privkeyb) return &repo.Mock{ diff --git a/core/commands/publish.go b/core/commands/publish.go index 35786849231..ce14b7f46c1 100644 --- a/core/commands/publish.go +++ b/core/commands/publish.go @@ -1,18 +1,18 @@ package commands import ( + "context" "errors" "fmt" "io" "strings" "time" - context "context" - cmds "github.com/ipfs/go-ipfs/commands" core "github.com/ipfs/go-ipfs/core" path "github.com/ipfs/go-ipfs/path" - key "gx/ipfs/QmYEoKZXHoAToWfhGF3vryhMn3WWhE1o2MasQ8uzY5iDi9/go-key" + + peer "gx/ipfs/QmfMmLGoKzCHDN7cGgk64PJr4iipzidDRME8HABSJqvmhC/go-libp2p-peer" crypto "gx/ipfs/QmfWDLQjGjVe4fr5CoztYW2DYYjRysMJrFe1RCsXLPTf46/go-libp2p-crypto" ) @@ -147,13 +147,13 @@ func publish(ctx context.Context, n *core.IpfsNode, k crypto.PrivKey, ref path.P return nil, err } - hash, err := k.GetPublic().Hash() + pid, err := peer.IDFromPrivateKey(k) if err != nil { return nil, err } return &IpnsEntry{ - Name: key.Key(hash).String(), + Name: pid.Pretty(), Value: ref.String(), }, nil } diff --git a/fuse/ipns/ipns_unix.go b/fuse/ipns/ipns_unix.go index 90e5e30dece..042dbf41967 100644 --- a/fuse/ipns/ipns_unix.go +++ b/fuse/ipns/ipns_unix.go @@ -5,22 +5,23 @@ package ipns import ( + "context" "errors" "fmt" "os" - "context" fuse "github.com/ipfs/go-ipfs/Godeps/_workspace/src/bazil.org/fuse" fs "github.com/ipfs/go-ipfs/Godeps/_workspace/src/bazil.org/fuse/fs" - logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" core "github.com/ipfs/go-ipfs/core" dag "github.com/ipfs/go-ipfs/merkledag" mfs "github.com/ipfs/go-ipfs/mfs" path "github.com/ipfs/go-ipfs/path" ft "github.com/ipfs/go-ipfs/unixfs" - key "gx/ipfs/QmYEoKZXHoAToWfhGF3vryhMn3WWhE1o2MasQ8uzY5iDi9/go-key" + + logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" cid "gx/ipfs/QmcEcrBAMrwMyhSjXt4yfyPpzgSuV8HLHavnfmiKCSRqZU/go-cid" + peer "gx/ipfs/QmfMmLGoKzCHDN7cGgk64PJr4iipzidDRME8HABSJqvmhC/go-libp2p-peer" ci "gx/ipfs/QmfWDLQjGjVe4fr5CoztYW2DYYjRysMJrFe1RCsXLPTf46/go-libp2p-crypto" ) @@ -135,11 +136,11 @@ func CreateRoot(ipfs *core.IpfsNode, keys map[string]ci.PrivKey, ipfspath, ipnsp roots := make(map[string]*keyRoot) links := make(map[string]*Link) for alias, k := range keys { - pkh, err := k.GetPublic().Hash() + pid, err := peer.IDFromPrivateKey(k) if err != nil { return nil, err } - name := key.Key(pkh).B58String() + name := pid.Pretty() kr := &keyRoot{k: k, alias: alias} fsn, err := loadRoot(ipfs.Context(), kr, ipfs, name) @@ -241,13 +242,12 @@ func (r *Root) ReadDirAll(ctx context.Context) ([]fuse.Dirent, error) { var listing []fuse.Dirent for alias, k := range r.Keys { - pub := k.GetPublic() - hash, err := pub.Hash() + pid, err := peer.IDFromPrivateKey(k) if err != nil { continue } ent := fuse.Dirent{ - Name: key.Key(hash).B58String(), + Name: pid.Pretty(), Type: fuse.DT_Dir, } link := fuse.Dirent{ diff --git a/merkledag/merkledag_test.go b/merkledag/merkledag_test.go index c75b33692dd..0e3637c7105 100644 --- a/merkledag/merkledag_test.go +++ b/merkledag/merkledag_test.go @@ -22,7 +22,6 @@ import ( uio "github.com/ipfs/go-ipfs/unixfs/io" node "gx/ipfs/QmUsVJ7AEnGyjX8YWnrwq9vmECVGwBQNAKPpgz5KSg8dcq/go-ipld-node" - key "gx/ipfs/QmYEoKZXHoAToWfhGF3vryhMn3WWhE1o2MasQ8uzY5iDi9/go-key" u "gx/ipfs/Qmb912gdngC1UWwTkhuW8knyRbcWeu5kqkxBpveLmW8bSr/go-ipfs-util" cid "gx/ipfs/QmcEcrBAMrwMyhSjXt4yfyPpzgSuV8HLHavnfmiKCSRqZU/go-cid" ) @@ -56,8 +55,8 @@ func TestNode(t *testing.T) { } h := n.Multihash() - k := n.Key() - if k != key.Key(h) { + k := n.Cid().Hash() + if k.String() != h.String() { t.Error("Key is not equivalent to multihash") } else { fmt.Println("key: ", k) @@ -84,7 +83,7 @@ func SubtestNodeStat(t *testing.T, n *ProtoNode) { return } - k := n.Key() + k := n.Cid() expected := node.NodeStat{ NumLinks: len(n.Links()), @@ -92,7 +91,7 @@ func SubtestNodeStat(t *testing.T, n *ProtoNode) { LinksSize: len(enc) - len(n.Data()), // includes framing. DataSize: len(n.Data()), CumulativeSize: int(cumSize), - Hash: k.B58String(), + Hash: k.String(), } actual, err := n.Stat() diff --git a/merkledag/node.go b/merkledag/node.go index 332b083fa7f..df68c9c8690 100644 --- a/merkledag/node.go +++ b/merkledag/node.go @@ -6,7 +6,6 @@ import ( node "gx/ipfs/QmUsVJ7AEnGyjX8YWnrwq9vmECVGwBQNAKPpgz5KSg8dcq/go-ipld-node" mh "gx/ipfs/QmYDds3421prZgqKbLpEK7T9Aa2eVdQ7o3YarX1LVLdP2J/go-multihash" - key "gx/ipfs/QmYEoKZXHoAToWfhGF3vryhMn3WWhE1o2MasQ8uzY5iDi9/go-key" cid "gx/ipfs/QmcEcrBAMrwMyhSjXt4yfyPpzgSuV8HLHavnfmiKCSRqZU/go-cid" ) @@ -204,7 +203,7 @@ func (n *ProtoNode) Stat() (*node.NodeStat, error) { } return &node.NodeStat{ - Hash: n.Key().B58String(), + Hash: n.Cid().String(), NumLinks: len(n.links), BlockSize: len(enc), LinksSize: len(enc) - len(n.data), // includes framing. @@ -213,10 +212,6 @@ func (n *ProtoNode) Stat() (*node.NodeStat, error) { }, nil } -func (n *ProtoNode) Key() key.Key { - return key.Key(n.Multihash()) -} - func (n *ProtoNode) Loggable() map[string]interface{} { return map[string]interface{}{ "node": n.String(), diff --git a/namesys/resolve_test.go b/namesys/resolve_test.go index 145396d11e2..78c4444f04a 100644 --- a/namesys/resolve_test.go +++ b/namesys/resolve_test.go @@ -1,16 +1,15 @@ package namesys import ( + "context" "errors" "testing" "time" - context "context" path "github.com/ipfs/go-ipfs/path" mockrouting "github.com/ipfs/go-ipfs/routing/mock" testutil "github.com/ipfs/go-ipfs/thirdparty/testutil" - key "gx/ipfs/QmYEoKZXHoAToWfhGF3vryhMn3WWhE1o2MasQ8uzY5iDi9/go-key" - u "gx/ipfs/Qmb912gdngC1UWwTkhuW8knyRbcWeu5kqkxBpveLmW8bSr/go-ipfs-util" + ds "gx/ipfs/QmbzuUusHqaLLoNTDEVLcSF6vZDHZDLPC7p4bztRvvkXxU/go-datastore" dssync "gx/ipfs/QmbzuUusHqaLLoNTDEVLcSF6vZDHZDLPC7p4bztRvvkXxU/go-datastore/sync" peer "gx/ipfs/QmfMmLGoKzCHDN7cGgk64PJr4iipzidDRME8HABSJqvmhC/go-libp2p-peer" @@ -36,13 +35,12 @@ func TestRoutingResolve(t *testing.T) { t.Fatal(err) } - pubkb, err := pubk.Bytes() + pid, err := peer.IDFromPublicKey(pubk) if err != nil { t.Fatal(err) } - pkhash := u.Hash(pubkb) - res, err := resolver.Resolve(context.Background(), key.Key(pkhash).B58String()) + res, err := resolver.Resolve(context.Background(), pid.Pretty()) if err != nil { t.Fatal(err) } diff --git a/namesys/routing.go b/namesys/routing.go index c7853201363..8c2dc84887d 100644 --- a/namesys/routing.go +++ b/namesys/routing.go @@ -1,21 +1,19 @@ package namesys import ( + "context" "fmt" "strings" "time" - "context" - lru "gx/ipfs/QmVYxfoJQiZijTgPNHCHgHELvQpbsJNTg6Crmc3dQkj3yy/golang-lru" - mh "gx/ipfs/QmYDds3421prZgqKbLpEK7T9Aa2eVdQ7o3YarX1LVLdP2J/go-multihash" - proto "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/proto" - pb "github.com/ipfs/go-ipfs/namesys/pb" path "github.com/ipfs/go-ipfs/path" - routing "gx/ipfs/QmUrCwTDvJgmBbJVHu1HGEyqDaod3dR6sEkZkpxZk4u47c/go-libp2p-routing" - key "gx/ipfs/QmYEoKZXHoAToWfhGF3vryhMn3WWhE1o2MasQ8uzY5iDi9/go-key" logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log" + routing "gx/ipfs/QmUrCwTDvJgmBbJVHu1HGEyqDaod3dR6sEkZkpxZk4u47c/go-libp2p-routing" + lru "gx/ipfs/QmVYxfoJQiZijTgPNHCHgHELvQpbsJNTg6Crmc3dQkj3yy/golang-lru" + mh "gx/ipfs/QmYDds3421prZgqKbLpEK7T9Aa2eVdQ7o3YarX1LVLdP2J/go-multihash" + proto "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/proto" u "gx/ipfs/Qmb912gdngC1UWwTkhuW8knyRbcWeu5kqkxBpveLmW8bSr/go-ipfs-util" cid "gx/ipfs/QmcEcrBAMrwMyhSjXt4yfyPpzgSuV8HLHavnfmiKCSRqZU/go-cid" ci "gx/ipfs/QmfWDLQjGjVe4fr5CoztYW2DYYjRysMJrFe1RCsXLPTf46/go-libp2p-crypto" @@ -179,9 +177,6 @@ func (r *routingResolver) resolveOnce(ctx context.Context, name string) (path.Pa } } - hsh, _ := pubkey.Hash() - log.Debugf("pk hash = %s", key.Key(hsh)) - // check sig with pk if ok, err := pubkey.Verify(ipnsEntryDataForSig(entry), entry.GetSignature()); err != nil || !ok { return "", fmt.Errorf("Invalid value. Not signed by PrivateKey corresponding to %v", pubkey) diff --git a/package.json b/package.json index dba0a4cd803..a7677ee4cef 100644 --- a/package.json +++ b/package.json @@ -211,12 +211,6 @@ "name": "go-cid", "version": "0.7.5" }, - { - "author": "whyrusleeping", - "hash": "QmYEoKZXHoAToWfhGF3vryhMn3WWhE1o2MasQ8uzY5iDi9", - "name": "go-key", - "version": "1.0.3" - }, { "author": "whyrusleeping", "hash": "QmU4VzzKNLJXJ72SedXBQKyf5Jo8W89iWpbWQjHn9qef8N", diff --git a/path/resolver_test.go b/path/resolver_test.go index bf13fac0a5c..b05c0393c39 100644 --- a/path/resolver_test.go +++ b/path/resolver_test.go @@ -10,25 +10,23 @@ import ( path "github.com/ipfs/go-ipfs/path" node "gx/ipfs/QmUsVJ7AEnGyjX8YWnrwq9vmECVGwBQNAKPpgz5KSg8dcq/go-ipld-node" - key "gx/ipfs/QmYEoKZXHoAToWfhGF3vryhMn3WWhE1o2MasQ8uzY5iDi9/go-key" util "gx/ipfs/Qmb912gdngC1UWwTkhuW8knyRbcWeu5kqkxBpveLmW8bSr/go-ipfs-util" ) -func randNode() (*merkledag.ProtoNode, key.Key) { +func randNode() *merkledag.ProtoNode { node := new(merkledag.ProtoNode) node.SetData(make([]byte, 32)) util.NewTimeSeededRand().Read(node.Data()) - k := node.Key() - return node, k + return node } func TestRecurivePathResolution(t *testing.T) { ctx := context.Background() dagService := dagmock.Mock() - a, _ := randNode() - b, _ := randNode() - c, cKey := randNode() + a := randNode() + b := randNode() + c := randNode() err := b.AddNodeLink("grandchild", c) if err != nil { @@ -47,7 +45,7 @@ func TestRecurivePathResolution(t *testing.T) { } } - aKey := a.Key() + aKey := a.Cid() segments := []string{aKey.String(), "child", "grandchild"} p, err := path.FromSegments("/ipfs/", segments...) @@ -61,6 +59,7 @@ func TestRecurivePathResolution(t *testing.T) { t.Fatal(err) } + cKey := c.Cid() key := node.Cid() if key.String() != cKey.String() { t.Fatal(fmt.Errorf( diff --git a/pin/indirect.go b/pin/indirect.go deleted file mode 100644 index b30a7c22d53..00000000000 --- a/pin/indirect.go +++ /dev/null @@ -1,39 +0,0 @@ -package pin - -import ( - key "gx/ipfs/QmYEoKZXHoAToWfhGF3vryhMn3WWhE1o2MasQ8uzY5iDi9/go-key" -) - -type indirectPin struct { - refCounts map[key.Key]uint64 -} - -func newIndirectPin() *indirectPin { - return &indirectPin{ - refCounts: make(map[key.Key]uint64), - } -} - -func (i *indirectPin) Increment(k key.Key) { - i.refCounts[k]++ -} - -func (i *indirectPin) Decrement(k key.Key) { - if i.refCounts[k] == 0 { - log.Warningf("pinning: bad call: asked to unpin nonexistent indirect key: %v", k) - return - } - i.refCounts[k]-- - if i.refCounts[k] == 0 { - delete(i.refCounts, k) - } -} - -func (i *indirectPin) HasKey(k key.Key) bool { - _, found := i.refCounts[k] - return found -} - -func (i *indirectPin) GetRefs() map[key.Key]uint64 { - return i.refCounts -} diff --git a/pin/set.go b/pin/set.go index 02a279bf954..f84a57a278c 100644 --- a/pin/set.go +++ b/pin/set.go @@ -14,7 +14,6 @@ import ( "github.com/ipfs/go-ipfs/pin/internal/pb" node "gx/ipfs/QmUsVJ7AEnGyjX8YWnrwq9vmECVGwBQNAKPpgz5KSg8dcq/go-ipld-node" - "gx/ipfs/QmYEoKZXHoAToWfhGF3vryhMn3WWhE1o2MasQ8uzY5iDi9/go-key" "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/proto" cid "gx/ipfs/QmcEcrBAMrwMyhSjXt4yfyPpzgSuV8HLHavnfmiKCSRqZU/go-cid" ) @@ -308,11 +307,3 @@ func storeSet(ctx context.Context, dag merkledag.DAGService, cids []*cid.Cid, in internalKeys(c) return n, nil } - -func copyRefcounts(orig map[key.Key]uint64) map[key.Key]uint64 { - r := make(map[key.Key]uint64, len(orig)) - for k, v := range orig { - r[k] = v - } - return r -} diff --git a/routing/supernode/server.go b/routing/supernode/server.go index 0efb7746735..e5aaea4345c 100644 --- a/routing/supernode/server.go +++ b/routing/supernode/server.go @@ -1,14 +1,14 @@ package supernode import ( + "context" "errors" "fmt" proxy "github.com/ipfs/go-ipfs/routing/supernode/proxy" + dshelp "github.com/ipfs/go-ipfs/thirdparty/ds-help" - context "context" pstore "gx/ipfs/QmXXCcQ7CLg5a81Ui9TTR35QcR4y7ZyihxwfjqaHfUVcVo/go-libp2p-peerstore" - key "gx/ipfs/QmYEoKZXHoAToWfhGF3vryhMn3WWhE1o2MasQ8uzY5iDi9/go-key" proto "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/proto" dhtpb "gx/ipfs/QmaMRCpeKL34rdT7t3bEndrENbVdD6gcCZr3YdkDUk6jue/go-libp2p-kad-dht/pb" datastore "gx/ipfs/QmbzuUusHqaLLoNTDEVLcSF6vZDHZDLPC7p4bztRvvkXxU/go-datastore" @@ -55,7 +55,7 @@ func (s *Server) handleMessage( switch req.GetType() { case dhtpb.Message_GET_VALUE: - rawRecord, err := getRoutingRecord(s.routingBackend, key.Key(req.GetKey())) + rawRecord, err := getRoutingRecord(s.routingBackend, req.GetKey()) if err != nil { return "", nil } @@ -69,7 +69,7 @@ func (s *Server) handleMessage( // log.Event(ctx, "validationFailed", req, p) // return "", nil // } - putRoutingRecord(s.routingBackend, key.Key(req.GetKey()), req.GetRecord()) + putRoutingRecord(s.routingBackend, req.GetKey(), req.GetRecord()) return p, req case dhtpb.Message_FIND_NODE: @@ -89,7 +89,7 @@ func (s *Server) handleMessage( if providerID == p { store := []*dhtpb.Message_Peer{provider} storeProvidersToPeerstore(s.peerstore, p, store) - if err := putRoutingProviders(s.routingBackend, key.Key(req.GetKey()), store); err != nil { + if err := putRoutingProviders(s.routingBackend, req.GetKey(), store); err != nil { return "", nil } } else { @@ -99,7 +99,7 @@ func (s *Server) handleMessage( return "", nil case dhtpb.Message_GET_PROVIDERS: - providers, err := getRoutingProviders(s.routingBackend, key.Key(req.GetKey())) + providers, err := getRoutingProviders(s.routingBackend, req.GetKey()) if err != nil { return "", nil } @@ -116,8 +116,8 @@ func (s *Server) handleMessage( var _ proxy.RequestHandler = &Server{} var _ proxy.Proxy = &Server{} -func getRoutingRecord(ds datastore.Datastore, k key.Key) (*pb.Record, error) { - dskey := k.DsKey() +func getRoutingRecord(ds datastore.Datastore, k string) (*pb.Record, error) { + dskey := dshelp.NewKeyFromBinary(k) val, err := ds.Get(dskey) if err != nil { return nil, err @@ -133,12 +133,12 @@ func getRoutingRecord(ds datastore.Datastore, k key.Key) (*pb.Record, error) { return &record, nil } -func putRoutingRecord(ds datastore.Datastore, k key.Key, value *pb.Record) error { +func putRoutingRecord(ds datastore.Datastore, k string, value *pb.Record) error { data, err := proto.Marshal(value) if err != nil { return err } - dskey := k.DsKey() + dskey := dshelp.NewKeyFromBinary(k) // TODO namespace if err := ds.Put(dskey, data); err != nil { return err @@ -146,8 +146,8 @@ func putRoutingRecord(ds datastore.Datastore, k key.Key, value *pb.Record) error return nil } -func putRoutingProviders(ds datastore.Datastore, k key.Key, newRecords []*dhtpb.Message_Peer) error { - log.Event(context.Background(), "putRoutingProviders", &k) +func putRoutingProviders(ds datastore.Datastore, k string, newRecords []*dhtpb.Message_Peer) error { + log.Event(context.Background(), "putRoutingProviders") oldRecords, err := getRoutingProviders(ds, k) if err != nil { return err @@ -185,8 +185,8 @@ func storeProvidersToPeerstore(ps pstore.Peerstore, p peer.ID, providers []*dhtp } } -func getRoutingProviders(ds datastore.Datastore, k key.Key) ([]*dhtpb.Message_Peer, error) { - e := log.EventBegin(context.Background(), "getProviders", &k) +func getRoutingProviders(ds datastore.Datastore, k string) ([]*dhtpb.Message_Peer, error) { + e := log.EventBegin(context.Background(), "getProviders") defer e.Done() var providers []*dhtpb.Message_Peer if v, err := ds.Get(providerKey(k)); err == nil { @@ -201,8 +201,8 @@ func getRoutingProviders(ds datastore.Datastore, k key.Key) ([]*dhtpb.Message_Pe return providers, nil } -func providerKey(k key.Key) datastore.Key { - return datastore.KeyWithNamespaces([]string{"routing", "providers", k.String()}) +func providerKey(k string) datastore.Key { + return datastore.KeyWithNamespaces([]string{"routing", "providers", k}) } func verify(ps pstore.Peerstore, r *pb.Record) error { diff --git a/routing/supernode/server_test.go b/routing/supernode/server_test.go index 4dab1aac71f..180acbf3d05 100644 --- a/routing/supernode/server_test.go +++ b/routing/supernode/server_test.go @@ -3,14 +3,13 @@ package supernode import ( "testing" - key "gx/ipfs/QmYEoKZXHoAToWfhGF3vryhMn3WWhE1o2MasQ8uzY5iDi9/go-key" dhtpb "gx/ipfs/QmaMRCpeKL34rdT7t3bEndrENbVdD6gcCZr3YdkDUk6jue/go-libp2p-kad-dht/pb" datastore "gx/ipfs/QmbzuUusHqaLLoNTDEVLcSF6vZDHZDLPC7p4bztRvvkXxU/go-datastore" ) func TestPutProviderDoesntResultInDuplicates(t *testing.T) { routingBackend := datastore.NewMapDatastore() - k := key.Key("foo") + k := "foo" put := []*dhtpb.Message_Peer{ convPeer("bob", "127.0.0.1/tcp/4001"), convPeer("alice", "10.0.0.10/tcp/4001"),