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-merkledag
Commits
7737cb02
Commit
7737cb02
authored
Nov 28, 2016
by
Jeromy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
completely remove go-key dep
License: MIT Signed-off-by:
Jeromy
<
why@ipfs.io
>
parent
49c8ac01
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
11 deletions
+5
-11
merkledag_test.go
merkledag_test.go
+4
-5
node.go
node.go
+1
-6
No files found.
merkledag_test.go
View file @
7737cb02
...
...
@@ -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
.
B58
String
(),
Hash
:
k
.
String
(),
}
actual
,
err
:=
n
.
Stat
()
...
...
node.go
View file @
7737cb02
...
...
@@ -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
()
.
B58
String
(),
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
(),
...
...
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