This repository has been archived by the owner on Nov 10, 2022. It is now read-only.
forked from ipfs/go-verifcid
-
Notifications
You must be signed in to change notification settings - Fork 0
Allow ll-specific multihash #1
Merged
Merged
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
bbb215f
change to allow ll-specific codec and ll go-multihash fork
liamsi 6e84e93
update go-multihash fork to latest commit
liamsi c3e21cf
bump go-multihash
liamsi 19890b0
Update go-verifcid to use vanilla multihash module
liamsi bfe738b
review feedback: simplify IsGoodHash slightly
liamsi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An alternative would be to import the constant from where it is defined, currently in lazyledger-core:
https://github.com/lazyledger/lazyledger-core/blob/755a7175168e57e9f1996341e533683eace5c5d3/p2p/ipld/plugin/nodes/nodes.go#L27-L29
For now it seems more reasonable to repeat this here instead of introducing a massive dependency and assert that this checks out by the consumer of verifcid:
https://github.com/lazyledger/lazyledger-core/blob/7b9550659e2bd957b4042880b8339d9e1d84c9c0/p2p/ipld/plugin/nodes/nodes_test.go#L26-L30
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another option is to extract "common" dependency. But creating a module just for single const seems like overengineering.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thought about this too. But I agree, it would be overkill for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to make this use of a magic number a bit more...documented (can't think of a better word)? I.e. this file documents what's happening, but if you go modify the magic number the other file you have no idea this one exists. Even putting it in the PR's description instead of a comment would go a long way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I'll put it in the PR description.
BTW, there is a test in the consuming code that would fail if the constant was modified without updating it here accordingly: https://github.com/lazyledger/lazyledger-core/blob/3308e7636503ded830e476cd79ec4f9a5cf16de0/p2p/ipld/plugin/nodes/nodes_test.go#L26-L30