Skip to content
This repository has been archived by the owner on Sep 3, 2021. It is now read-only.

Feature complete #4

Merged
merged 1 commit into from
Oct 24, 2016
Merged

Feature complete #4

merged 1 commit into from
Oct 24, 2016

Conversation

daviddias
Copy link
Member

Support for both v0 and v1 CID.

Ready for review

@daviddias
Copy link
Member Author

daviddias commented Oct 16, 2016

@dignifiedquire @victorbjelkholm could you review? Thank you :)

@@ -2,53 +2,92 @@
'use strict'

const expect = require('chai').expect
const mh = require('multihashes')
const multihash = require('multihashes')
const multihashing = require('multihashing')
Copy link
Member

Choose a reason for hiding this comment

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

Could you please move this to multihashing-async, we don't want slow tests :)

Copy link
Member Author

Choose a reason for hiding this comment

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

Definitely something happening next week, however, it would be impossible for me to focus on the IPLD work at hand, if adding to the npm link mad mountain that I had to do, I also had to maintain branches of branches npm linking all over the place :)

Copy link
Member

Choose a reason for hiding this comment

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

Fair point, starting Monday I will fully focus on getting that merged so we can upgrade these branches and ship ALL THE THINGS.

'dag-pb': new Buffer('70', 'hex'),
'dag-cbor': new Buffer('71', 'hex'),
'eth-block': new Buffer('90', 'hex'),
'eth-tx': new Buffer('91', 'hex')
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Would be nice if we could just pull this directly off of js-multicodec

Copy link
Member Author

Choose a reason for hiding this comment

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

💡 Or even a multicodec-table module that gets published directly from the spec repo, this way, all the other multi* can require it and use always the latest.

Copy link

Choose a reason for hiding this comment

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

👍

Copy link
Member

Choose a reason for hiding this comment

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

do you plan on doing this?

Copy link
Member Author

Choose a reason for hiding this comment

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

Once we have multiformats/multicodec#16 finished, otherwise, instead of having codes floating in two places, we would have it floating in three

Copy link
Member Author

Choose a reason for hiding this comment

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

Added a note here: multiformats/multicodec#20

@@ -2,7 +2,7 @@
"name": "cids",
"version": "0.1.1",
"description": "cid implementation",
"main": "lib/index.js",
"main": "src/index.js",
Copy link
Member

Choose a reason for hiding this comment

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

TODO: remove before merge

'dag-pb': new Buffer('70', 'hex'),
'dag-cbor': new Buffer('71', 'hex'),
'eth-block': new Buffer('90', 'hex'),
'eth-tx': new Buffer('91', 'hex')
}
Copy link
Member

Choose a reason for hiding this comment

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

do you plan on doing this?

this.codec = codec
this.version = version
this.multihash = multihash
}
Copy link
Member

Choose a reason for hiding this comment

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

Please throw some kind of error on the non working cases. This is a new format and could easily lead to implicit errors if we fail silently

} else if (typeof version === 'number') {
//
// TODO validate all of these
//
Copy link
Member

Choose a reason for hiding this comment

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

lets add at least some basic validations

@daviddias
Copy link
Member Author

Thank you for the CR @dignifiedquire, applied, now validation happens and it will throw if something is incorrect.

update multibase and multicodec
add tests
add documentation
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants