Skip to content

Commit

Permalink
dag/get: fix link formatting in json output
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
  • Loading branch information
whyrusleeping committed Feb 5, 2017
1 parent 313b884 commit 810499f
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion core/commands/dag/dag.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

node "gx/ipfs/QmRSU5EqqWVZSNdbU51yXmVoF1uNw3JgTNB6RaiL7DZM16/go-ipld-node"
cid "gx/ipfs/QmcTcsTvfaeEBRFo1TkFgT8sRmgi1n1LTZpecfVP8fzpGD/go-cid"
ipldcbor "gx/ipfs/QmfMxth6d2po8YGrtSVyNb2u6SFNrPdAsWQoZG83oXRBqX/go-ipld-cbor"
ipldcbor "gx/ipfs/Qmf658QLDTXfRDgnGmUB6TYj671XjmHScG61p3g7dSxUcF/go-ipld-cbor"
)

var DagCmd = &cmds.Command{
Expand Down
2 changes: 1 addition & 1 deletion merkledag/merkledag.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
node "gx/ipfs/QmRSU5EqqWVZSNdbU51yXmVoF1uNw3JgTNB6RaiL7DZM16/go-ipld-node"
logging "gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log"
cid "gx/ipfs/QmcTcsTvfaeEBRFo1TkFgT8sRmgi1n1LTZpecfVP8fzpGD/go-cid"
ipldcbor "gx/ipfs/QmfMxth6d2po8YGrtSVyNb2u6SFNrPdAsWQoZG83oXRBqX/go-ipld-cbor"
ipldcbor "gx/ipfs/Qmf658QLDTXfRDgnGmUB6TYj671XjmHScG61p3g7dSxUcF/go-ipld-cbor"
)

var log = logging.Logger("merkledag")
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,9 @@
},
{
"author": "whyrusleeping",
"hash": "QmfMxth6d2po8YGrtSVyNb2u6SFNrPdAsWQoZG83oXRBqX",
"hash": "Qmf658QLDTXfRDgnGmUB6TYj671XjmHScG61p3g7dSxUcF",
"name": "go-ipld-cbor",
"version": "1.0.0"
"version": "1.1.0"
},
{
"author": "lgierth",
Expand Down
13 changes: 13 additions & 0 deletions test/sharness/t0053-dag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,19 @@ test_dag_cmd() {
ipfs refs -r --timeout=2s $EXPHASH > /dev/null
'

test_expect_success "can get object" '
ipfs dag get $IPLDHASH > ipld_obj_out
'

test_expect_success "object links look right" '
grep "{\"/\":\"" ipld_obj_out > /dev/null
'

test_expect_success "retreived object hashes back correctly" '
IPLDHASH2=$(cat ipld_obj_out | ipfs dag put) &&
test "$IPLDHASH" == "$IPLDHASH2"
'

test_expect_success "add a normal file" '
HASH=$(echo "foobar" | ipfs add -q)
'
Expand Down

0 comments on commit 810499f

Please sign in to comment.