From 5b23ade6c32ae4f422f61c2c76ab62a9746349bb Mon Sep 17 00:00:00 2001 From: DanGould Date: Thu, 18 Aug 2022 11:54:13 +0800 Subject: [PATCH] Upgrade bitcoin v0.29 Use minimal representation when displaying Amount --- Cargo.toml | 2 +- src/lib.rs | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 8fa9255..eeae087 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,4 +23,4 @@ non-compliant-bytes = ["either"] [dependencies] either = { version = "1.6.1", optional = true } percent-encoding-rfc3986 = "0.1.3" -bitcoin = "0.27.1" +bitcoin = "0.29.0" diff --git a/src/lib.rs b/src/lib.rs index 1540b40..ec013d2 100755 --- a/src/lib.rs +++ b/src/lib.rs @@ -358,9 +358,7 @@ mod tests { #[allow(clippy::inconsistent_digit_grouping)] // Use sats/bitcoin when grouping. #[test] fn request_20_point_30_btc_to_luke_dash_jr() { - // See https://github.com/rust-bitcoin/rust-bitcoin/issues/709 - // let input = "bitcoin:1andreas3batLhQa2FawWjeyjCqyBzypd?amount=20.3&label=Luke-Jr"; - let input = "bitcoin:1andreas3batLhQa2FawWjeyjCqyBzypd?amount=20.30000000&label=Luke-Jr"; + let input = "bitcoin:1andreas3batLhQa2FawWjeyjCqyBzypd?amount=20.3&label=Luke-Jr"; let uri = input.parse::>().unwrap(); let label: Cow<'_, str> = uri.label.clone().unwrap().try_into().unwrap(); assert_eq!(uri.address.to_string(), "1andreas3batLhQa2FawWjeyjCqyBzypd"); @@ -374,9 +372,7 @@ mod tests { #[allow(clippy::inconsistent_digit_grouping)] // Use sats/bitcoin when grouping. #[test] fn request_50_btc_with_message() { - // See https://github.com/rust-bitcoin/rust-bitcoin/issues/709 - // let input = "bitcoin:1andreas3batLhQa2FawWjeyjCqyBzypd?amount=50&label=Luke-Jr&message=Donation%20for%20project%20xyz"; - let input = "bitcoin:1andreas3batLhQa2FawWjeyjCqyBzypd?amount=50.00000000&label=Luke-Jr&message=Donation%20for%20project%20xyz"; + let input = "bitcoin:1andreas3batLhQa2FawWjeyjCqyBzypd?amount=50&label=Luke-Jr&message=Donation%20for%20project%20xyz"; let uri = input.parse::>().unwrap(); let label: Cow<'_, str> = uri.label.clone().unwrap().try_into().unwrap(); let message: Cow<'_, str> = uri.message.clone().unwrap().try_into().unwrap();