From 4e3196776630ff4c39b0f6cbd736b8778ee55171 Mon Sep 17 00:00:00 2001 From: Elias Rohrer Date: Mon, 6 Jan 2025 10:59:56 +0100 Subject: [PATCH] DROPME: Throw in some `to_lowercases` to make CI pass We should drop this commit once https://github.com/lightningdevkit/rust-lightning/pull/3505 got in. --- src/payment/unified_qr.rs | 8 +++++--- tests/integration_tests_rust.rs | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/payment/unified_qr.rs b/src/payment/unified_qr.rs index 029416b84..e6e2a2e73 100644 --- a/src/payment/unified_qr.rs +++ b/src/payment/unified_qr.rs @@ -265,8 +265,10 @@ impl<'a> bip21::de::DeserializationState<'a> for DeserializationState { "lno" => { let bolt12_value = String::try_from(value).map_err(|_| Error::UriParameterParsingFailed)?; - let offer = - bolt12_value.parse::().map_err(|_| Error::UriParameterParsingFailed)?; + let offer = bolt12_value + .to_lowercase() + .parse::() + .map_err(|_| Error::UriParameterParsingFailed)?; self.bolt12_offer = Some(offer); Ok(bip21::de::ParamKind::Known) }, @@ -342,7 +344,7 @@ mod tests { } if let Some(offer) = parsed_uri_with_offer.extras.bolt12_offer { - assert_eq!(offer, Offer::from_str(expected_bolt12_offer_2).unwrap()); + assert_eq!(offer, Offer::from_str(&expected_bolt12_offer_2.to_lowercase()).unwrap()); } else { panic!("No offer found."); } diff --git a/tests/integration_tests_rust.rs b/tests/integration_tests_rust.rs index 2737a3d18..170812fb0 100644 --- a/tests/integration_tests_rust.rs +++ b/tests/integration_tests_rust.rs @@ -849,7 +849,7 @@ fn unified_qr_send_receive() { let expiry_sec = 4_000; let uqr_payment = node_b.unified_qr_payment().receive(expected_amount_sats, "asdf", expiry_sec); - let uri_str = uqr_payment.clone().unwrap(); + let uri_str = uqr_payment.clone().unwrap().to_lowercase(); let offer_payment_id: PaymentId = match node_a.unified_qr_payment().send(&uri_str) { Ok(QrPaymentResult::Bolt12 { payment_id }) => { println!("\nBolt12 payment sent successfully with PaymentID: {:?}", payment_id);