Skip to content
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

Upgrade bitcoin and miniscript #76

Merged
merged 2 commits into from
Jul 18, 2023

Conversation

tcharding
Copy link
Contributor

@tcharding tcharding commented Jun 13, 2023

This is my first PR to this project.

  • Patch 1 does the upgrade to bitcoin v0.30.0 and miniscript 0.10.0
  • Patch 2 does a little clean up, removing base64 dependency in favour of bitcoin::base64

Note please, this makes the following API changes:

  • Network is now non_exhaustive so we implement TryFrom instead of From. Also add panic in IntoPy, we already unwrap so it seems ok, please note.
  • get_client: Now takes an HWIChain instead of a generic, this is less general, and less usable. Done because From<Network> can no longer be implemented on HWIChain because of the newly added non_exhaustive on Network (added a test const TESTNET for HWIChain(Network::Testnet))
  • Address now has a tag and can only be deserialized unchecked. We just call assume_checked in the unit tests.

Is the error handling for new TryFrom acceptable to the project?

@tcharding tcharding force-pushed the 06-11-upgrade-bitcoin branch 3 times, most recently from 4aadc82 to 44a10eb Compare June 13, 2023 04:25
@tcharding
Copy link
Contributor Author

syn needs pinning because of Rust 1.41, I'll fix that up if this gets a concept ack.

@tcharding
Copy link
Contributor Author

This PR would be nicer if we implemented the suggestion in #80

@danielabrozzoni
Copy link
Member

Thanks for your contribution!
I'd say it's fine to bump the MSRV to 1.48, and to implement the suggestion in #80. If you could do that it would be great - either here or in a separate PR works for me.

The rest LGTM

@tcharding
Copy link
Contributor Author

Leave it with me.

@tcharding
Copy link
Contributor Author

If #84 is acceptable it could go in before this one and that would fix the CI fails.

@tcharding
Copy link
Contributor Author

I'll put this on ice until my other PRs get merged/closed.

@tcharding tcharding marked this pull request as draft June 28, 2023 02:33
@tcharding tcharding force-pushed the 06-11-upgrade-bitcoin branch 6 times, most recently from 11dc1e1 to 8a9eea7 Compare July 12, 2023 06:02
@tcharding tcharding marked this pull request as ready for review July 12, 2023 07:06
src/types.rs Outdated Show resolved Hide resolved
Upgrade to `miniscript` v0.10.0 and `bitcoin` v0.30.0

API Changes:

- `Network` is now `non_exhaustive` so we implement `TryFrom` instead of
`From`.
- `get_client`: Now takes an `HWIChain` instead of a generic, this is
less general, and less usable. Done because `From<Network>` can no
longer be implemented on `HWIChain` because of the newly added
`non_exhaustive` on `Network`.
- `Address` now has a tag and can only be deserialized unchecked. We
just call `assume_checked` in the unit tests.

Is the error handling for new `TryFrom` acceptable to the project?
We currently use `base64` to deserialize a vector. At the same time we
use `base64` indirectly from `rust-bitcoin` when deserializing a PSBT.

If we remove the dependency on `base64` and use the re-export from
bitcoin it saves having to keep the dependency and transient dependency
in sync so we don't get multiple versions of the same crate in the
dependency tree.
@tcharding
Copy link
Contributor Author

Changes in force push

  • Removed the error as suggested
  • Rebased on master

Copy link
Member

@danielabrozzoni danielabrozzoni left a comment

Choose a reason for hiding this comment

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

ACK f720747

@danielabrozzoni danielabrozzoni merged commit d6241e3 into bitcoindevkit:master Jul 18, 2023
7 checks passed
@tcharding tcharding deleted the 06-11-upgrade-bitcoin branch November 23, 2023 02:18
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.

2 participants