Skip to content

Commit 3713285

Browse files
committed
bindings: descriptor: is_mainnet
1 parent 434e085 commit 3713285

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

lwk_bindings/src/desc.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ impl WolletDescriptor {
3434
let inner = lwk_wollet::WolletDescriptor::from_str(descriptor)?;
3535
Ok(Arc::new(WolletDescriptor { inner }))
3636
}
37+
38+
pub fn is_mainnet(&self) -> bool {
39+
self.inner.is_mainnet()
40+
}
3741
}
3842

3943
impl fmt::Display for WolletDescriptor {
@@ -62,5 +66,7 @@ mod tests {
6266
let wollet_desc = lwk_wollet::WolletDescriptor::from_str(exp).unwrap();
6367
let desc: WolletDescriptor = wollet_desc.into();
6468
assert_eq!(desc.to_string(), exp);
69+
70+
assert!(!desc.is_mainnet());
6571
}
6672
}

0 commit comments

Comments
 (0)