Make Script::witness_version public
This commit is contained in:
parent
93daed95bd
commit
7554d76dfe
|
@ -410,8 +410,9 @@ impl Script {
|
||||||
Script::new_v1_p2tr(&secp, internal_key, Some(merkle_root))
|
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]
|
#[inline]
|
||||||
fn witness_version(&self) -> Option<WitnessVersion> {
|
pub fn witness_version(&self) -> Option<WitnessVersion> {
|
||||||
self.0.get(0).and_then(|opcode| WitnessVersion::from_opcode(opcodes::All::from(*opcode)).ok())
|
self.0.get(0).and_then(|opcode| WitnessVersion::from_opcode(opcodes::All::from(*opcode)).ok())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue