Skip to content

Commit 9036cda

Browse files
committed
Implement Tr lifting
1 parent b786cf0 commit 9036cda

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/descriptor/tr.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,13 @@ impl<Pk: MiniscriptKey> Liftable<Pk> for TapTree<Pk> {
546546
impl<Pk: MiniscriptKey> Liftable<Pk> for Tr<Pk> {
547547
fn lift(&self) -> Result<Policy<Pk>, Error> {
548548
match &self.tree {
549-
Some(root) => root.lift(),
549+
Some(root) => Ok(Policy::Threshold(
550+
1,
551+
vec![
552+
Policy::KeyHash(self.internal_key.to_pubkeyhash()),
553+
root.lift()?,
554+
],
555+
)),
550556
None => Ok(Policy::KeyHash(self.internal_key.to_pubkeyhash())),
551557
}
552558
}

src/policy/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ impl<Pk: MiniscriptKey> Liftable<Pk> for Descriptor<Pk> {
181181
Descriptor::Wpkh(ref wpkh) => wpkh.lift(),
182182
Descriptor::Wsh(ref wsh) => wsh.lift(),
183183
Descriptor::Sh(ref sh) => sh.lift(),
184-
Descriptor::Tr(ref _tr) => unimplemented!(),
184+
Descriptor::Tr(ref tr) => tr.lift(),
185185
}
186186
}
187187
}

0 commit comments

Comments
 (0)