rust-bitcoin-unsafe-fast/bitcoin
Martin Habovstiak a8168c3f81 Add `taproot_leaf_script` methood to `Witness`
We already have `tapscript` method on `Witness` which is broken because
it doesn't check that the leaf script is a tapscript, however that
behavior might have been intended by some consumers who want to inspect
the script independent of the version. To resolve the confusion, we're
going to add a new method that returns both the leaf script and, to
avoid forgetting version check, also the leaf version.

This doesn't touch the `tapscript` method yet to make backporting of
this commit easier. It's also worth noting that leaf script is often
used together with version. To make passing them around easier it'd be
helpful to use a separate type. Thus this also adds a public POD type
containing the script and the version. In anticipation of if being
usable in different APIs it's also generic over the script type.
Similarly to the `tapscript` method, this also only adds the type and
doesn't change other functions to use it yet. Only the newly added
`taproot_leaf_script` method uses it now.

This is a part of #4073
2025-02-24 18:33:55 +01:00
..
contrib Remove rust-ordered dependency 2025-02-18 13:36:07 +11:00
embedded Move opcodes to primitives 2024-07-09 15:26:33 +10:00
examples Introduce monadic AmountOpResult 2025-02-10 10:06:59 +11:00
src Add `taproot_leaf_script` methood to `Witness` 2025-02-24 18:33:55 +01:00
tests Use MAX_MONEY in serde regression test 2025-01-24 12:15:13 +11:00
CHANGELOG.md Add unreleased changelog entry 2025-01-25 06:52:26 +11:00
Cargo.toml Remove rust-ordered dependency 2025-02-18 13:36:07 +11:00