Skip to content

Derive std::hash::Hash for Descriptor et al #243

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

Merged
merged 3 commits into from
Apr 21, 2021

Conversation

stevenroose
Copy link
Contributor

Actually, I'm quite confused by this. The Miniscript type derives Hash without the ScriptContext trait requiring Hash, but when I tried for Descriptor it would complain about that. Is there some magic that made it work in Miniscript? Ideally we wouldn't require the Hash on ScriptContext there, but it doesn't hurt either.

@sanket1729
Copy link
Member

utACK, looks like there are some rust 1.29 errors

@stevenroose
Copy link
Contributor Author

I pushed some CI fixes here, if you prefer them separate, I can take them apart.

@apoelstra
Copy link
Member

@stevenroose when we derive Hash for Miniscript, it only implements Hash in the case that the generic ScriptContext also implements Hash....in other words, never. Oops.

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 8e52efb

@apoelstra
Copy link
Member

(To clarify my above comment -- this PR fixes the issue by putting a std::Hash requirement on the ScriptContext trait.)

@apoelstra apoelstra merged commit 79d5c06 into rust-bitcoin:master Apr 21, 2021
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.

3 participants