From 7554d76dfe90e0f6a02c296f311d2459ebf6e243 Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Sun, 13 Mar 2022 14:40:03 +0100 Subject: [PATCH] Make Script::witness_version public --- src/blockdata/script.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/blockdata/script.rs b/src/blockdata/script.rs index 372efa60..c190f6ef 100644 --- a/src/blockdata/script.rs +++ b/src/blockdata/script.rs @@ -410,8 +410,9 @@ impl Script { Script::new_v1_p2tr(&secp, internal_key, Some(merkle_root)) } + /// Returns witness version of the script, if any, assuming the script is a `scriptPubkey`. #[inline] - fn witness_version(&self) -> Option { + pub fn witness_version(&self) -> Option { self.0.get(0).and_then(|opcode| WitnessVersion::from_opcode(opcodes::All::from(*opcode)).ok()) }