adding tests for blake3 and fixing an error handling bug.#158
adding tests for blake3 and fixing an error handling bug.#158aschmahmann merged 1 commit intomultiformats:masterfrom
Conversation
|
tests passed. I also found a bug in what was being displayed for ErrInconsistentLen and fixed the message to make a little more sense, and added a few comments for clarity... the way the logic was before, it was just gonna print like the same number twice in the "expected |
|
@Kubuxu @aschmahmann ready 2 go when u r :) |
|
The |
|
ok i changed the title to fit. i'm gonna leave the new blake3 tests too. committing now. |
|
@laudiacay do the tests passes ? I think you need to register blake3 in the test suite else they wont find the hasher. Simply add this line to your imports (in the tests) |
|
register/all gets blake3 and the tests get register/all! |
|
Ok good mb |
Jorropo
left a comment
There was a problem hiding this comment.
SGTM (need green CI first) (I don't have merge powers here)
I don't see that anywhere. As far as I can tell, this PR is 1. changing the error messages and 2. adding blake3 tests. Am I missing something? |
It used to do it but I've asked for it to be removed, I think people that want blake3 can just |
|
@marten-seemann it's not doing that anymore- it's fixing an error message and adding tests. I was doing that before but then @Jorropo let me know that that was unnecessary :P didn't quite understand go imports with side effects until just now |
|
are we good to merge? |
|
@laudiacay is this PR just:
If so LGTM, although if you could squash the commits together with a clear commit message that'd be great. |
|
Yep done |
| @@ -27,11 +27,12 @@ var ( | |||
|
|
|||
| // ErrInconsistentLen is returned when a decoded multihash has an inconsistent length | |||
| type ErrInconsistentLen struct { | |||
There was a problem hiding this comment.
Notes for a future PR, IMO, this error should wrap io.UnexpectedEOF.
Re-exporting blake3 constants in the right places so we can support it elsewhere (like go-verifcid, so that I can add support for approving fixed-length blake3 as a "good hash" there 😄 ) Draft because there are no tests yet.
edit: it doesn't exactly do this anymore, check comments below...