Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: persist CIDv1 multicodec #37

Merged

Conversation

lidel
Copy link
Contributor

@lidel lidel commented Nov 15, 2019

This change avoids creating new CID object if it is already v1 and persists non-dag-pb multicodec if v1 is passed in text form as specified in https://github.com/libp2p/specs/blob/master/RFC/0001-text-peerid-cid.md

In also added tests that ensure multicodec of v1 is persisted.
CID internals can be inspected with https://cid.ipfs.io

cc https://github.com/ipfs/ipfs/issues/337, libp2p/specs#209, libp2p/specs#216, MetaMask/metamask-extension#7362

This change avoids creating new CID object if it is already v1
and persists non-dag-pb multicodec if v1 is passed in text form
as specified in
https://github.com/libp2p/specs/blob/master/RFC/0001-text-peerid-cid.md

License: MIT
Signed-off-by: Marcin Rataj <lidel@lidel.org>
Copy link
Owner

@pldespaigne pldespaigne left a comment

Choose a reason for hiding this comment

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

SGTM, thanks for the contribution!

@pldespaigne pldespaigne merged commit ca2c6d9 into pldespaigne:master Nov 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants