Skip to content

Conversation

@RCasatta
Copy link
Collaborator

@RCasatta RCasatta commented Jan 4, 2024

Solves only hard errors for now

@RCasatta RCasatta force-pushed the 2024-01--bitcoin31 branch 4 times, most recently from 4c44f34 to 01c52ee Compare January 17, 2024 16:01
@RCasatta RCasatta marked this pull request as ready for review January 17, 2024 16:31
@RCasatta
Copy link
Collaborator Author

Sorry, some cargo fmt slipped in by error on autofmt on save, let me know if I have to fix those

@jamesdorfman
Copy link
Collaborator

utACK e7a853e.

Copy link
Member

@apoelstra apoelstra left a comment

Choose a reason for hiding this comment

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

ACK e7a853e

@apoelstra apoelstra merged commit 31fbf27 into ElementsProject:master Jan 18, 2024
forward
);
sha256t_hash_newtype! {
pub struct Elip151Tag = hash_str("ELIP-151 Deterministic descriptor blinding keys");
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

🐞🐞🐞

sorry :(

Copy link
Member

Choose a reason for hiding this comment

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

Lol, derp. But we really should have had tests to catch this!!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

would it be feasible and makes sense to have a parameter of the macro requiring to specify the result of the hash for the empty string and the macro generates a test for it?

Copy link
Member

Choose a reason for hiding this comment

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

oo I like that idea.

cc @tcharding what do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't quite get it, what is the test hoping to catch? Is it hoped to be a regression test? (I don't see how one would get the hash of the empty string without first using the new tagged type.) Am I missing some context?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, you'd run the test once to get the correct string.

And then yes, it would be a regression test which would (hopefully) detect whenever anybody poked at the macro, or replaced the macro, or something, causing the hash to change.

Having said that, having such a test as part of the macro limits its value, since it's likely to go away when the macro is changed, which is exactly when we want it..

Copy link
Contributor

Choose a reason for hiding this comment

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

We could definitely, and probably should already, have a single unit test in each repo that calls the macro and tests the empty hash - "don't trust verify" and all that.

Copy link
Contributor

@tcharding tcharding May 7, 2024

Choose a reason for hiding this comment

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

I hear those lads that maintain hashes chop and change every week like a bunch of cowboys.

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.

4 participants