Struct revault_tx::scripts::DerivedCpfpDescriptor [−][src]
pub struct DerivedCpfpDescriptor(_);
Expand description
A concrete (with raw public keys) CPFP miniscript descriptor.
Implementations
Get all the keys and key source used in this derived descriptor
pub fn new(
managers: Vec<DerivedPublicKey>
) -> Result<DerivedCpfpDescriptor, ScriptCreationError>
pub fn new(
managers: Vec<DerivedPublicKey>
) -> Result<DerivedCpfpDescriptor, ScriptCreationError>
Get the miniscript descriptor for the Unvault transaction CPFP output.
It’s a basic 1-of-N between the fund managers.
Examples
use revault_tx::{scripts, miniscript::{bitcoin::{self, secp256k1, util::bip32}, DescriptorTrait}};
use std::str::FromStr;
let first_manager = scripts::DerivedPublicKey::from_str("[0f0f0f0f/21]02a17786aca5ea2118e9209702454ab432d5b2c656f8ae19447d4ff3e7317d3b41").unwrap();
let second_manager = scripts::DerivedPublicKey::from_str("[0f0f0f0f/21]036edaec85bb1eee1a19ca9f9fd5620134ec98bc21cc14c4e8e3d0f8f121e1b6d1").unwrap();
let cpfp_descriptor =
scripts::DerivedCpfpDescriptor::new(vec![first_manager, second_manager]).expect("Compiling descriptor");
println!("Concrete CPFP descriptor: {}", cpfp_descriptor);
let desc_str = cpfp_descriptor.to_string();
assert_eq!(cpfp_descriptor, scripts::DerivedCpfpDescriptor::from_str(&desc_str).unwrap());
Errors
- If you attempt to create a DerivedCpfpDescriptor with more than 20 managers.
- If the policy compilation to miniscript failed, which should not happen (tm) and would be a bug.
Trait Implementations
type Err = ScriptCreationError
type Err = ScriptCreationError
The associated error which can be returned from parsing.
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for DerivedCpfpDescriptor
impl Send for DerivedCpfpDescriptor
impl Sync for DerivedCpfpDescriptor
impl Unpin for DerivedCpfpDescriptor
impl UnwindSafe for DerivedCpfpDescriptor
Blanket Implementations
Mutably borrows from an owned value. Read more