Skip to content

Commit

Permalink
bindings: descriptor: is_mainnet
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoComandini committed Sep 19, 2024
1 parent 434e085 commit 3713285
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lwk_bindings/src/desc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ impl WolletDescriptor {
let inner = lwk_wollet::WolletDescriptor::from_str(descriptor)?;
Ok(Arc::new(WolletDescriptor { inner }))
}

pub fn is_mainnet(&self) -> bool {
self.inner.is_mainnet()
}
}

impl fmt::Display for WolletDescriptor {
Expand Down Expand Up @@ -62,5 +66,7 @@ mod tests {
let wollet_desc = lwk_wollet::WolletDescriptor::from_str(exp).unwrap();
let desc: WolletDescriptor = wollet_desc.into();
assert_eq!(desc.to_string(), exp);

assert!(!desc.is_mainnet());
}
}

0 comments on commit 3713285

Please sign in to comment.