From 70eed4ebcf806c4dd523b7a30f62787c6cf8f46b Mon Sep 17 00:00:00 2001 From: Rod Vagg Date: Tue, 27 Jul 2021 13:20:24 +1000 Subject: [PATCH] Update go-ipld-prime, revert tests to sorted-cbor forms --- go.mod | 2 +- go.sum | 3 ++- test/sharness/t0053-dag.sh | 27 +++++++++++++-------------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/go.mod b/go.mod index bb23be27cc0..a123bfe0de3 100644 --- a/go.mod +++ b/go.mod @@ -62,7 +62,7 @@ require ( github.com/ipfs/interface-go-ipfs-core v0.4.1-0.20210410030100-56c2e678cb62 github.com/ipld/go-car v0.3.1 github.com/ipld/go-codec-dagpb v1.2.1-0.20210405170603-d0b86f7623c2 - github.com/ipld/go-ipld-prime v0.10.1-0.20210723093545-ebe39c7bab39 + github.com/ipld/go-ipld-prime v0.10.1-0.20210727022528-083c39518830 github.com/jbenet/go-is-domain v1.0.5 github.com/jbenet/go-random v0.0.0-20190219211222-123a90aedc0c github.com/jbenet/go-temp-err-catcher v0.1.0 diff --git a/go.sum b/go.sum index 13bb2185bf5..959a03ec19f 100644 --- a/go.sum +++ b/go.sum @@ -514,8 +514,9 @@ github.com/ipld/go-codec-dagpb v1.2.1-0.20210405170603-d0b86f7623c2/go.mod h1:GM github.com/ipld/go-ipld-prime v0.9.0/go.mod h1:KvBLMr4PX1gWptgkzRjVZCrLmSGcZCb/jioOQwCqZN8= github.com/ipld/go-ipld-prime v0.9.1-0.20210324083106-dc342a9917db/go.mod h1:KvBLMr4PX1gWptgkzRjVZCrLmSGcZCb/jioOQwCqZN8= github.com/ipld/go-ipld-prime v0.9.1-0.20210402181957-7406578571d1/go.mod h1:KvBLMr4PX1gWptgkzRjVZCrLmSGcZCb/jioOQwCqZN8= -github.com/ipld/go-ipld-prime v0.10.1-0.20210723093545-ebe39c7bab39 h1:70/42k1tU7ZHuyjFDd7vbd6dgnMyFnC0fe8LKeF9ZPg= github.com/ipld/go-ipld-prime v0.10.1-0.20210723093545-ebe39c7bab39/go.mod h1:KvBLMr4PX1gWptgkzRjVZCrLmSGcZCb/jioOQwCqZN8= +github.com/ipld/go-ipld-prime v0.10.1-0.20210727022528-083c39518830 h1:tQyWv1pyxNIFe2hPczHGITClSQRJlW6dLIcEvkdSRgY= +github.com/ipld/go-ipld-prime v0.10.1-0.20210727022528-083c39518830/go.mod h1:KvBLMr4PX1gWptgkzRjVZCrLmSGcZCb/jioOQwCqZN8= github.com/jackpal/gateway v1.0.5/go.mod h1:lTpwd4ACLXmpyiCTRtfiNyVnUmqT9RivzCDQetPfnjA= github.com/jackpal/go-nat-pmp v1.0.1/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus= diff --git a/test/sharness/t0053-dag.sh b/test/sharness/t0053-dag.sh index f14fe25b15e..b95e853cd8b 100755 --- a/test/sharness/t0053-dag.sh +++ b/test/sharness/t0053-dag.sh @@ -21,10 +21,8 @@ test_expect_success "make a few test files" ' HASH4=$(ipfs add --pin=false -q file4) ' -# TODO: revert this ordering when https://github.com/ipld/go-ipld-prime/pull/204 is merged -# and we get dag-cbor map sorting test_expect_success "make an ipld object in json" ' - printf "{\"cats\":[{\"/\":\"%s\"},{\"water\":{\"/\":\"%s\"}}],\"hello\":\"world\",\"magic\":{\"/\":\"%s\"},\"subNode\":{\"beep\":[0,\"bop\"],\"dict\":\"ionary\"}}" $HASH1 $HASH2 $HASH3 > ipld_object + printf "{\"hello\":\"world\",\"cats\":[{\"/\":\"%s\"},{\"water\":{\"/\":\"%s\"}}],\"magic\":{\"/\":\"%s\"},\"sub\":{\"dict\":\"ionary\",\"beep\":[0,\"bop\"]}}" $HASH1 $HASH2 $HASH3 > ipld_object ' test_expect_success "make the same ipld object in dag-cbor, dag-json and dag-pb" ' @@ -39,7 +37,8 @@ test_dag_cmd() { ' test_expect_success "CID looks correct" ' - EXPHASH="bafyreihim5n3etxp5om74fdpriqtys5sdmgbd5ix2oil7u2g2qfdpdlgie" + EXPHASH="bafyreiblwimnjbqcdoeafiobk6q27jcw64ew7n2fmmhdpldd63edmjecde" + echo $IPLDHASH > ipld_hash && \ test $EXPHASH = $IPLDHASH ' @@ -48,7 +47,7 @@ test_dag_cmd() { ' test_expect_success "CID looks correct" ' - EXPHASH="bafyreihim5n3etxp5om74fdpriqtys5sdmgbd5ix2oil7u2g2qfdpdlgie" + EXPHASH="bafyreiblwimnjbqcdoeafiobk6q27jcw64ew7n2fmmhdpldd63edmjecde" test $EXPHASH = $IPLDHASH ' @@ -109,10 +108,10 @@ test_dag_cmd() { test_expect_success "resolving sub-objects works" ' ipfs dag get $IPLDHASH/hello > sub1 && - ipfs dag get $IPLDHASH/subNode > sub2 && - ipfs dag get $IPLDHASH/subNode/beep > sub3 && - ipfs dag get $IPLDHASH/subNode/beep/0 > sub4 && - ipfs dag get $IPLDHASH/subNode/beep/1 > sub5 + ipfs dag get $IPLDHASH/sub > sub2 && + ipfs dag get $IPLDHASH/sub/beep > sub3 && + ipfs dag get $IPLDHASH/sub/beep/0 > sub4 && + ipfs dag get $IPLDHASH/sub/beep/1 > sub5 ' test_expect_success "sub-objects look right" ' @@ -184,9 +183,9 @@ test_dag_cmd() { test_cmp cat_exp cat_out ' - test_expect_success "non-canonical cbor input is normalized" ' + test_expect_success "non-canonical dag-cbor input is normalized" ' HASH=$(cat ../t0053-dag-data/non-canon.cbor | ipfs dag put --format=dag-cbor --input-enc=dag-cbor) && - test $HASH = "bafyreicfngo3hexoxbbwsm64apbydw5fyeruyrfwiyxlj3f4wuzdyztd4m" || + test $HASH = "bafyreiawx7ona7oa2ptcoh6vwq4q6bmd7x2ibtkykld327bgb7t73ayrqm" || test_fsh echo $HASH ' @@ -204,12 +203,12 @@ test_dag_cmd() { ipfs refs -r --timeout=2s $PINHASH > /dev/null ' - test_expect_success "can add an ipld object with sha3 hash" ' - IPLDHASH=$(cat ipld_object | ipfs dag put --hash sha3) + test_expect_success "can add an ipld object with sha3-512 hash" ' + IPLDHASH=$(cat ipld_object | ipfs dag put --hash sha3-512) ' test_expect_success "output looks correct" ' - EXPHASH="bafyriqdoys7rmgfkjg7jjdjdhaajt66vxjusd2ry6eims63xy5wwjtjgditq4z4f76tmnal5rccb4zg3o4zcud3utxulm7svoapq2du3xmnok" + EXPHASH="bafyriqforjma7y7akqz7nhuu73r6liggj5zhkbfiqgicywe3fgkna2ijlhod2af3ue7doj56tlzt5hh6iu5esafc4msr3sd53jol5m2o25ucy" test $EXPHASH = $IPLDHASH '