Commit 7737cb02 authored by Jeromy's avatar Jeromy

completely remove go-key dep

License: MIT
Signed-off-by: default avatarJeromy <why@ipfs.io>
parent 49c8ac01
......@@ -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()
......
......@@ -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(),
......
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