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
Show 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 (
...
@@ -22,7 +22,6 @@ import (
uio
"github.com/ipfs/go-ipfs/unixfs/io"
uio
"github.com/ipfs/go-ipfs/unixfs/io"
node
"gx/ipfs/QmUsVJ7AEnGyjX8YWnrwq9vmECVGwBQNAKPpgz5KSg8dcq/go-ipld-node"
node
"gx/ipfs/QmUsVJ7AEnGyjX8YWnrwq9vmECVGwBQNAKPpgz5KSg8dcq/go-ipld-node"
key
"gx/ipfs/QmYEoKZXHoAToWfhGF3vryhMn3WWhE1o2MasQ8uzY5iDi9/go-key"
u
"gx/ipfs/Qmb912gdngC1UWwTkhuW8knyRbcWeu5kqkxBpveLmW8bSr/go-ipfs-util"
u
"gx/ipfs/Qmb912gdngC1UWwTkhuW8knyRbcWeu5kqkxBpveLmW8bSr/go-ipfs-util"
cid
"gx/ipfs/QmcEcrBAMrwMyhSjXt4yfyPpzgSuV8HLHavnfmiKCSRqZU/go-cid"
cid
"gx/ipfs/QmcEcrBAMrwMyhSjXt4yfyPpzgSuV8HLHavnfmiKCSRqZU/go-cid"
)
)
...
@@ -56,8 +55,8 @@ func TestNode(t *testing.T) {
...
@@ -56,8 +55,8 @@ func TestNode(t *testing.T) {
}
}
h
:=
n
.
Multihash
()
h
:=
n
.
Multihash
()
k
:=
n
.
Key
()
k
:=
n
.
Cid
()
.
Hash
()
if
k
!=
key
.
Key
(
h
)
{
if
k
.
String
()
!=
h
.
String
(
)
{
t
.
Error
(
"Key is not equivalent to multihash"
)
t
.
Error
(
"Key is not equivalent to multihash"
)
}
else
{
}
else
{
fmt
.
Println
(
"key: "
,
k
)
fmt
.
Println
(
"key: "
,
k
)
...
@@ -84,7 +83,7 @@ func SubtestNodeStat(t *testing.T, n *ProtoNode) {
...
@@ -84,7 +83,7 @@ func SubtestNodeStat(t *testing.T, n *ProtoNode) {
return
return
}
}
k
:=
n
.
Key
()
k
:=
n
.
Cid
()
expected
:=
node
.
NodeStat
{
expected
:=
node
.
NodeStat
{
NumLinks
:
len
(
n
.
Links
()),
NumLinks
:
len
(
n
.
Links
()),
...
@@ -92,7 +91,7 @@ func SubtestNodeStat(t *testing.T, n *ProtoNode) {
...
@@ -92,7 +91,7 @@ func SubtestNodeStat(t *testing.T, n *ProtoNode) {
LinksSize
:
len
(
enc
)
-
len
(
n
.
Data
()),
// includes framing.
LinksSize
:
len
(
enc
)
-
len
(
n
.
Data
()),
// includes framing.
DataSize
:
len
(
n
.
Data
()),
DataSize
:
len
(
n
.
Data
()),
CumulativeSize
:
int
(
cumSize
),
CumulativeSize
:
int
(
cumSize
),
Hash
:
k
.
B58
String
(),
Hash
:
k
.
String
(),
}
}
actual
,
err
:=
n
.
Stat
()
actual
,
err
:=
n
.
Stat
()
...
...
node.go
View file @
7737cb02
...
@@ -6,7 +6,6 @@ import (
...
@@ -6,7 +6,6 @@ import (
node
"gx/ipfs/QmUsVJ7AEnGyjX8YWnrwq9vmECVGwBQNAKPpgz5KSg8dcq/go-ipld-node"
node
"gx/ipfs/QmUsVJ7AEnGyjX8YWnrwq9vmECVGwBQNAKPpgz5KSg8dcq/go-ipld-node"
mh
"gx/ipfs/QmYDds3421prZgqKbLpEK7T9Aa2eVdQ7o3YarX1LVLdP2J/go-multihash"
mh
"gx/ipfs/QmYDds3421prZgqKbLpEK7T9Aa2eVdQ7o3YarX1LVLdP2J/go-multihash"
key
"gx/ipfs/QmYEoKZXHoAToWfhGF3vryhMn3WWhE1o2MasQ8uzY5iDi9/go-key"
cid
"gx/ipfs/QmcEcrBAMrwMyhSjXt4yfyPpzgSuV8HLHavnfmiKCSRqZU/go-cid"
cid
"gx/ipfs/QmcEcrBAMrwMyhSjXt4yfyPpzgSuV8HLHavnfmiKCSRqZU/go-cid"
)
)
...
@@ -204,7 +203,7 @@ func (n *ProtoNode) Stat() (*node.NodeStat, error) {
...
@@ -204,7 +203,7 @@ func (n *ProtoNode) Stat() (*node.NodeStat, error) {
}
}
return
&
node
.
NodeStat
{
return
&
node
.
NodeStat
{
Hash
:
n
.
Key
()
.
B58
String
(),
Hash
:
n
.
Cid
()
.
String
(),
NumLinks
:
len
(
n
.
links
),
NumLinks
:
len
(
n
.
links
),
BlockSize
:
len
(
enc
),
BlockSize
:
len
(
enc
),
LinksSize
:
len
(
enc
)
-
len
(
n
.
data
),
// includes framing.
LinksSize
:
len
(
enc
)
-
len
(
n
.
data
),
// includes framing.
...
@@ -213,10 +212,6 @@ func (n *ProtoNode) Stat() (*node.NodeStat, error) {
...
@@ -213,10 +212,6 @@ func (n *ProtoNode) Stat() (*node.NodeStat, error) {
},
nil
},
nil
}
}
func
(
n
*
ProtoNode
)
Key
()
key
.
Key
{
return
key
.
Key
(
n
.
Multihash
())
}
func
(
n
*
ProtoNode
)
Loggable
()
map
[
string
]
interface
{}
{
func
(
n
*
ProtoNode
)
Loggable
()
map
[
string
]
interface
{}
{
return
map
[
string
]
interface
{}{
return
map
[
string
]
interface
{}{
"node"
:
n
.
String
(),
"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