Struct bdk::descriptor::policy::Policy
source · pub struct Policy {
pub id: String,
pub item: SatisfiableItem,
pub satisfaction: Satisfaction,
pub contribution: Satisfaction,
}
Expand description
Descriptor spending policy
Fields§
§id: String
Identifier for this policy node
item: SatisfiableItem
Type of this policy node
satisfaction: Satisfaction
How much a given PSBT already satisfies this policy node in terms of signatures
contribution: Satisfaction
How the wallet’s descriptor can satisfy this policy node
Implementations§
source§impl Policy
impl Policy
sourcepub fn requires_path(&self) -> bool
pub fn requires_path(&self) -> bool
Return whether or not a specific path in the policy tree is required to unambiguously create a transaction
What this means is that for some spending policies the user should select which paths in the tree it intends to satisfy while signing, because the transaction must be created differently based on that.
sourcepub fn get_condition(
&self,
path: &BTreeMap<String, Vec<usize>>
) -> Result<Condition, PolicyError>
pub fn get_condition(
&self,
path: &BTreeMap<String, Vec<usize>>
) -> Result<Condition, PolicyError>
Return the conditions that are set by the spending policy for a given path in the policy tree
Trait Implementations§
source§impl From<SatisfiableItem> for Policy
impl From<SatisfiableItem> for Policy
source§fn from(other: SatisfiableItem) -> Self
fn from(other: SatisfiableItem) -> Self
Converts to this type from the input type.