-
Notifications
You must be signed in to change notification settings - Fork 831
Move type definitions of pubkey/script hash types #1914
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
Conversation
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.
ACK ee33eefe04ef9aa809904b4c42c41f9cf2caf647
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.
Wouldn't this be better as doctest?
Also From is defined in key.rs so the test could go there? I don't really understand why the impl PubkeyHash and the struct are in different files along with the traits. |
ee33eef
to
b798939
Compare
BOOM! Thanks man. |
bitcoin/src/crypto/key.rs
Outdated
@@ -116,8 +116,7 @@ impl PublicKey { | |||
hash160::Hash::hash(&self.inner.serialize()).to_byte_array(), | |||
)) | |||
} else { | |||
// We can't create witness pubkey hashes for an uncompressed | |||
// public keys | |||
// We can't create witness pubkey hash for an uncompressed pubkey. |
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.
In 76f9ab2df76d5a65ade52c339d51a2999b8446ab
Should be "a witness pubkey hash".
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.
Done, thanks.
You say I think we should use the name |
ack b798939fde1d9890a93d41abe31eaf23e4a5356e other than the |
Will fix emty/new thing as suggested.
Well after this one can no longer write |
I just realized the new/empty change should not even be in this PR, its totally unrelated to pubkey/script hash - will pull it out into a separate PR. |
921b2fe
to
9d9fa62
Compare
Added a patch |
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.
ACK 9d9fa623e401b1e75c6720a71c6d874a5738cfbe
9d9fa62
to
dcfbafd
Compare
Rebased on master (to pick up #1927). No other changes. |
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.
ACK dcfbafd75572801e1fd8582c165a3cf956b0d80b
dcfbafd
to
47bde36
Compare
Removed the first two patches (because we now have #1925) and rebased. |
47bde36
to
10a95a6
Compare
Pulled master and rebased, woops. |
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.
ACK 10a95a6cf98c97f397affedfb44f1bdaca1b2178
Improve the pubkey hash types by doing: - Define the types in the `crypto::key` module - Add From<&PublicKey> impl for `PubkeyHash` Keep the current crate level re-export so this does not impact the public API _if_ people are using the re-export but is still a breaking change.
Improve the script hash types by doing: - Define the types in the `crypto::script` module - Put the From impls directly below the type definitions Keep the current crate level re-export so this does not impact the public API _if_ people are using the re-export but is still a breaking change.
10a95a6
to
27b3c1e
Compare
Rebase only, no other changes. |
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.
ACK 27b3c1e
Merging based on #1945. The rebase made no changes. |
Total re-write since review. Now this PR moves the hash type definitions out of
hash_types
. Please see #1909 (comment) for more.No longer adds unit tests.
Fix: #1909