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()) }