8000 Patch hashes and update the code by Kixunil · Pull Request #1477 · rust-bitcoin/rust-bitcoin · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Patch hashes and update the code #1477

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 1 commit into from
Dec 19, 2022
Merged

Conversation

Kixunil
Copy link
Collaborator
@Kixunil Kixunil commented Dec 15, 2022

This patches bitcoin_hashes to use the version in the repository and fixes the code after removal of Deref.

@Kixunil Kixunil added the bug label Dec 15, 2022
@Kixunil Kixunil added this to the 0.30.0 milestone Dec 15, 2022
@Kixunil Kixunil force-pushed the patch-hashes branch 4 times, most recently from 6cf4582 to e3f6e58 Compare December 15, 2022 20:47
@Kixunil
Copy link
Collaborator Author
Kixunil commented Dec 15, 2022

Hmm, do we really need AS_DEPENDENCY test? What does it achieve?

@tcharding
Copy link
Member

I don't know what was the initial motivation for adding the dependency test but git blame tells me it was added by @elichai in commit 89f73ea686cf28ff44e066a5c341bf318811e8e5. Do you remember Elichai?

@tcharding
Copy link
Member

PR looks good to me.

@elichai
Copy link
Member
elichai commented Dec 16, 2022

Yes, IIRC we had a bug in the one of the macros, that it assumed some things were available(don't remember if it was a dependency it assumed or something else) but they weren't when the macro was used from outside of the crate.
So we added a test testing the macro as a dependency

@Kixunil
Copy link
Collaborator Author
Kixunil commented Dec 16, 2022

Oh, wow, I thought this is not needed because integration tests were supposed to act exactly as if they used the library as a dependency but if they have some dependencies available that are used by macros I can totally see how the issue wouldn't be caught.

That being said, I don't think the test can check anything unless it actually calls the macro. Do you know which one it was?

@tcharding
Copy link
Member
tcharding commented Dec 18, 2022

We should be able to have an integration test that only uses hashes and calls all of the exported macros. And then in rust-bitcoin have one that only uses bitcoin. Right?

@Kixunil
Copy link
Collaborator Author
Kixunil commented Dec 18, 2022

@tcharding yeah, I think that's what we should do. My suggestion is to remove/disable the current test for now to get this in and then we can do the change in parallel with other.

@Kixunil Kixunil force-pushed the patch-hashes branch 2 times, most recently from 882f730 to 0cdc61f Compare December 18, 2022 13:31
This patches `bitcoin_hashes` to use the version in the repository and
fixes the code after removal of `Deref`.

This also turns off `AS_DEPENDENCY` check with the intention to refactor
it later.
@Kixunil
Copy link
Collaborator Author
Kixunil commented Dec 18, 2022

The latest push has those tests disabled.

Copy link
Member
@tcharding tcharding left a comment

Choose a reason for hiding this comment

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

ACK 6acf9ac

),
prevouts: common_cache.prevouts.hash_again(),
sequences: common_cache.sequences.hash_again(),
outputs: common_cache.outputs.hash_again(),
Copy link
Member

Choose a reason for hiding this comment

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

Hah, good memory! I totally forgot we added this hash_again method.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Heh, I stared at it confused for a few minutes thinking "is this doing the same thing and we forgot to change it or does it do something else?!"

Copy link
Member

Choose a reason for hiding this comment

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

I think we added it specifically for this code, and then forgot to use it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, I think the big advantage of having the crates in the same repo is we can use new APIs like this immediately which should prevent us from forgetting.

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 6acf9ac

@apoelstra apoelstra merged commit dc91b87 into rust-bitcoin:master Dec 19, 2022
@Kixunil Kixunil deleted the patch-hashes branch December 19, 2022 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0