Skip to content

Commit 8cdbf75

Browse files
committed
Make Script::witness_version public
1 parent 8656cda commit 8cdbf75

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/blockdata/script.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,8 +410,9 @@ impl Script {
410410
Script::new_v1_p2tr(&secp, internal_key, Some(merkle_root))
411411
}
412412

413+
/// Returns witness version of the script, if any, assuming the script is a `scriptPubkey`.
413414
#[inline]
414-
fn witness_version(&self) -> Option<WitnessVersion> {
415+
pub fn witness_version(&self) -> Option<WitnessVersion> {
415416
self.0.get(0).and_then(|opcode| WitnessVersion::from_opcode(opcodes::All::from(*opcode)).ok())
416417
}
417418

0 commit comments

Comments
 (0)