We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
RawHrp
1 parent 0abf068 commit c5658f6Copy full SHA for c5658f6
lightning-invoice/src/lib.rs
@@ -313,6 +313,7 @@ impl RawHrp {
313
pub fn to_hrp(&self) -> bech32::Hrp {
314
let hrp_str = self.to_string();
315
let s = core::str::from_utf8(&hrp_str.as_bytes()).expect("HRP bytes should be ASCII");
316
+ debug_assert!(bech32::Hrp::parse(s).is_ok(), "We should always build BIP 173-valid HRPs");
317
bech32::Hrp::parse_unchecked(s)
318
}
319
0 commit comments