Skip to content

refactor: make Descriptor plan API available for generic Pk#929

Merged
apoelstra merged 2 commits intorust-bitcoin:masterfrom
trevarj:desc-plan-api-generic
Apr 25, 2026
Merged

refactor: make Descriptor plan API available for generic Pk#929
apoelstra merged 2 commits intorust-bitcoin:masterfrom
trevarj:desc-plan-api-generic

Conversation

@trevarj
Copy link
Copy Markdown
Contributor

@trevarj trevarj commented Apr 22, 2026

  • Migrate plan and plan_mall methods from DefiniteDescriptorKey to generic
    Pk: MiniscriptKey + ToPublicKey.

  • Made the Plan struct generic over Pk (excluding update_psbt_input since
    it needs descriptor key data).

Adding this to same PR in a separate commit since it's trivial:

  • Rename plan and plan_mall to have into_ prefix

Closes #927 and #928

@trevarj trevarj force-pushed the desc-plan-api-generic branch 2 times, most recently from 669788d to fe71f3e Compare April 22, 2026 21:27
@apoelstra
Copy link
Copy Markdown
Member

In fe71f3e:

Can you re-add the old name as a deprecated passthrough to the new name?

@trevarj trevarj force-pushed the desc-plan-api-generic branch from fe71f3e to 685d59c Compare April 23, 2026 05:15
@trevarj
Copy link
Copy Markdown
Contributor Author

trevarj commented Apr 23, 2026

In fe71f3e:

Can you re-add the old name as a deprecated passthrough to the new name?

Done. Wasn't sure which version to use in since. Left it as 13.0.0 since I don't know what the next release will be (13.1.0?)

@tcharding
Copy link
Copy Markdown
Member

In rust-bitcoin we throw 'TBD' in there and then try to set it before release. Not sure what we want to do here though?

@apoelstra
Copy link
Copy Markdown
Member

Either TBD or 14.0.0 would be fine.

If you're really motivated you can use 13.1.0 but then you need to make a separate PR to backport this deprecation to the 13.x branch. But the next release off master will be the 14.x series.

@trevarj trevarj force-pushed the desc-plan-api-generic branch from 685d59c to 5041df3 Compare April 23, 2026 16:02
@trevarj
Copy link
Copy Markdown
Contributor Author

trevarj commented Apr 23, 2026

Pushed with "TBD" there is another one floating in the code too, so we can change all 3 to 14.0.0 when the time comes.

@apoelstra
Copy link
Copy Markdown
Member

CI is failing because there's a non-whitelisted call to the deprecated method somewhere.

trevarj added 2 commits April 23, 2026 16:34
- Migrate `plan` and `plan_mall` methods from `DefiniteDescriptorKey` to generic
`Pk: MiniscriptKey + ToPublicKey`.

- Made the `Plan` struct generic over `Pk` (excluding `update_psbt_input` since
it needs descriptor key data).
These functions consume `self`, therefore they should be prefixed with `into_`.
The old functions are now deprecated.
@trevarj trevarj force-pushed the desc-plan-api-generic branch from 5041df3 to b646120 Compare April 23, 2026 16:47
@trevarj
Copy link
Copy Markdown
Contributor Author

trevarj commented Apr 23, 2026

CI is failing because there's a non-whitelisted call to the deprecated method somewhere.

Right...rebased onto master. There was a usage of path in a662453

@trevarj
Copy link
Copy Markdown
Contributor Author

trevarj commented Apr 23, 2026

@apoelstra I think CI needs to be re-run:

Run cargo install --git https://github.com/rust-bitcoin/rust-bitcoin-maintainer-tools.git --rev "$(cat rbmt-version)" cargo-rbmt
    Updating git repository `[https://github.com/rust-bitcoin/rust-bitcoin-maintainer-tools.git`](https://github.com/rust-bitcoin/rust-bitcoin-maintainer-tools.git%60)
warning: spurious network error (3 tries remaining): unexpected http status code: 500; class=Http (34)
warning: spurious network error (2 tries remaining): unexpected http status code: 500; class=Http (34)
warning: spurious network error (1 try remaining): unexpected http status code: 500; class=Http (34)
error: failed to clone into: /home/runner/.cargo/git/db/rust-bitcoin-maintainer-tools-027d3079154a3847

Caused by:
  revision bcff6290c9e3f5b4d7e832acb5a8c6bf890fd1ce not found

Caused by:
  network failure seems to have happened
  if a proxy or similar is necessary `net.git-fetch-with-cli` may help here
  https://doc.rust-lang.org/cargo/reference/config.html#netgit-fetch-with-cli

Caused by:
  unexpected http status code: 500; class=Http (34)
  

Copy link
Copy Markdown
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 b646120; successfully ran local tests

@apoelstra apoelstra merged commit 7cd03d0 into rust-bitcoin:master Apr 25, 2026
50 of 51 checks passed
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.

Descriptor plan API only available for Descriptor<DefiniteDescriptorKey>

3 participants