script: make new_p2wsh available on hashable scripts
What changed, and why it matters
This commit only updates two public API listing files (text snapshots of the crate's public interface). It widens which script types can call a helper that builds a Pay-to-Witness-Script-Hash output. There is no code change, no bug fix, and no security behavior change visible in the diff.
No security action needed. Treat as a routine API-snapshot update.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff updates primitives/api/all-features.txt and primitives/api/alloc-only.txt to reflect that ScriptBuf<T>::new_p2wsh is now implemented for any T: ScriptHashableTag rather than only ScriptPubKeyTag. These files are generated API snapshots, not source code. No implementation, validation, or cryptographic logic is modified.
Changed components
primitives/api/all-features.txtprimitives/api/alloc-only.txtInspect captured patch +4 / −2
diff --git a/primitives/api/all-features.txt b/primitives/api/all-features.txt
index 3e010bf7..a888da46 100644
--- a/primitives/api/all-features.txt
+++ b/primitives/api/all-features.txt
@@ -3663,7 +3663,8 @@ impl bitcoin_primitives::script::ScriptBuf<bitcoin_primitives::script::ScriptPub
pub fn bitcoin_primitives::script::ScriptBuf<bitcoin_primitives::script::ScriptPubKeyTag>::new_op_return<T: core::convert::AsRef<bitcoin_primitives::script::PushBytes>>(data: T) -> Self
pub fn bitcoin_primitives::script::ScriptBuf<bitcoin_primitives::script::ScriptPubKeyTag>::new_p2a() -> Self
pub fn bitcoin_primitives::script::ScriptBuf<bitcoin_primitives::script::ScriptPubKeyTag>::new_p2sh(script_hash: bitcoin_primitives::script::ScriptHash) -> Self
-pub fn bitcoin_primitives::script::ScriptBuf<bitcoin_primitives::script::ScriptPubKeyTag>::new_p2wsh(script_hash: bitcoin_primitives::script::WScriptHash) -> Self
+impl<T: bitcoin_primitives::script::ScriptHashableTag> bitcoin_primitives::script::ScriptBuf<T>
+pub fn bitcoin_primitives::script::ScriptBuf<T>::new_p2wsh(script_hash: bitcoin_primitives::script::WScriptHash) -> Self
impl<T> bitcoin_primitives::script::ScriptBuf<T>
pub fn bitcoin_primitives::script::ScriptBuf<T>::as_mut_script(&mut self) -> &mut bitcoin_primitives::script::Script<T>
pub fn bitcoin_primitives::script::ScriptBuf<T>::as_script(&self) -> &bitcoin_primitives::script::Script<T>
diff --git a/primitives/api/alloc-only.txt b/primitives/api/alloc-only.txt
index bfa4f88c..65585365 100644
--- a/primitives/api/alloc-only.txt
+++ b/primitives/api/alloc-only.txt
@@ -3508,7 +3508,8 @@ impl bitcoin_primitives::script::ScriptBuf<bitcoin_primitives::script::ScriptPub
pub fn bitcoin_primitives::script::ScriptBuf<bitcoin_primitives::script::ScriptPubKeyTag>::new_op_return<T: core::convert::AsRef<bitcoin_primitives::script::PushBytes>>(data: T) -> Self
pub fn bitcoin_primitives::script::ScriptBuf<bitcoin_primitives::script::ScriptPubKeyTag>::new_p2a() -> Self
pub fn bitcoin_primitives::script::ScriptBuf<bitcoin_primitives::script::ScriptPubKeyTag>::new_p2sh(script_hash: bitcoin_primitives::script::ScriptHash) -> Self
-pub fn bitcoin_primitives::script::ScriptBuf<bitcoin_primitives::script::ScriptPubKeyTag>::new_p2wsh(script_hash: bitcoin_primitives::script::WScriptHash) -> Self
+impl<T: bitcoin_primitives::script::ScriptHashableTag> bitcoin_primitives::script::ScriptBuf<T>
+pub fn bitcoin_primitives::script::ScriptBuf<T>::new_p2wsh(script_hash: bitcoin_primitives::script::WScriptHash) -> Self
impl<T> bitcoin_primitives::script::ScriptBuf<T>
pub fn bitcoin_primitives::script::ScriptBuf<T>::as_mut_script(&mut self) -> &mut bitcoin_primitives::script::Script<T>
pub fn bitcoin_primitives::script::ScriptBuf<T>::as_script(&self) -> &bitcoin_primitives::script::Script<T>
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.