Skip to content

Conversation

tcharding
Copy link
Member

Manually backport PR #4111. Of note, here we put new_p2a on ScriptBuf instead of on the script::Builder because that seems to be where all the other new_foo methods are in this release.

From the original patch:

Add support for the newly created Pay2Anchor output-type.

See https://github.com/bitcoin/bitcoin/pull/30352

@github-actions github-actions bot added the C-bitcoin PRs modifying the bitcoin crate label Jul 8, 2025
@apoelstra
Copy link
Member

Does not compile with 1.56.1:

error[E0015]: calls in constant functions are limited to constant functions, tuple structs and tuple variants
   --> bitcoin/src/blockdata/script/witness_program.rs:108:64
    |
108 |         WitnessProgram { version: WitnessVersion::V1, program: ArrayVec::from_slice(&P2A_PROGRAM)}
    |                                                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

For more information about this error, try `rustc --explain E0015`.
error: could not compile `bitcoin` due to previous error

@apoelstra
Copy link
Member

Oh, it's specifically cargo test --all-features --locked --doc which fails, which is why CI didn't see it.

I would prefer we fix this because it will let me pass my local CI, though I don't really feel it's essential that our doctests meet MSRV.

@tcharding
Copy link
Member Author

In bitcoin this now works for me locally: cargo +1.51.1 test --all-features --locked --doc

@apoelstra
Copy link
Member

Oof, sorry for the long delay. But now I get

error: unexpected `cfg` condition name: `rust_v_1_61`

This is "just clippy" but it wasn't happening before and the fix is easy: just add cfg(rust_v_1_61) to the whitelist of cfg parameters in bitcoin/Cargo.toml.

Manually backport PR rust-bitcoin#4111. Of note, here we put `new_p2a` on
`ScriptBuf` instead of on the `script::Builder` because that seems to
be where all the other `new_foo` methods are in this release. 

Note the `WitnessProgram::p2a` is conditionally const on Rust `v1.61`
because MSRV is only `v1.56.1`.
    
From the original patch:

    Add support for the newly created Pay2Anchor output-type.
    
    See bitcoin/bitcoin#30352
@tcharding
Copy link
Member Author

Added. No other changes.

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 c2481e4; successfully ran local tests

@apoelstra apoelstra merged commit d31d17e into rust-bitcoin:0.32.x Jul 16, 2025
19 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bitcoin PRs modifying the bitcoin crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants