Skip to content
This repository has been archived by the owner on Feb 7, 2024. It is now read-only.

update the codec names for the dag put command: ipld-in-ipfs series of PRs #248

Merged
merged 3 commits into from Aug 12, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions shell_test.go
Expand Up @@ -387,7 +387,7 @@ func TestDagPut(t *testing.T) {
is := is.New(t)
s := NewShell(shellUrl)

c, err := s.DagPut(`{"x": "abc","y":"def"}`, "json", "cbor")
c, err := s.DagPut(`{"x": "abc","y":"def"}`, "dag-json", "dag-cbor")
is.Nil(err)
is.Equal(c, "bafyreidrm3r2k6vlxqp2fk47sboeycf7apddib47w7cyagrajtpaxxl2pi")
}
Expand All @@ -398,7 +398,7 @@ func TestDagPutWithOpts(t *testing.T) {

c, err := s.DagPutWithOpts(`{"x": "abc","y":"def"}`, options.Dag.Pin("true"))
is.Nil(err)
is.Equal(c, "bafyreidrm3r2k6vlxqp2fk47sboeycf7apddib47w7cyagrajtpaxxl2pi")
is.Equal(c, "bafireidrm3r2k6vlxqp2fk47sboeycf7apddib47w7cyagrajtpaxxl2pi")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are these CIDs different?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is the codec, which we now account for correctly as dag-json rather than json

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://cid.ipfs.io/#bafireidrm3r2k6vlxqp2fk47sboeycf7apddib47w7cyagrajtpaxxl2pi
https://cid.ipfs.io/#bafyreidrm3r2k6vlxqp2fk47sboeycf7apddib47w7cyagrajtpaxxl2pi

Are you sure, it looks like it's because you changed the output encoding from cbor to dag-cbor. This shouldn't be needed, right? Unless the idea is that we're testing the defaults here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, i knew it was adding the dag.
The default is now dag-cbor for the encoding. (in that we don't fail if you try to put in a cid link in your dag put)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIUC what's happening here is that we used to say cbor = dagcbor and the default is cbor. We now have cbor as a separate option from dag-cbor, but the default has changed to dag-cbor.

I'd think that if you revert this change, but just temporarily bump CI to point the go-ipfs target branch that things will pass.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: reading this again, i now believe this shouldn't pass without this change: line 424 of the current master of this repo explicitly overrides the default back to cbor.

}

func TestStatsBW(t *testing.T) {
Expand Down