diff --git a/CHANGELOG.md b/CHANGELOG.md index ed171e15..985daf14 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,8 @@ - cdk-integration-tests: Updated integration tests to use proper temp directory management ([thesimplekid]). - cdk-integration-tests: Simplified regtest shell scripts to use new binaries ([thesimplekid]). - crates/cdk-mintd: Moved mintd library functions to separate module for better organization and testability ([thesimplekid]). +- Updated MSRV to 1.85.0 ([thesimplekid]). +- dev: Simplified Nix flake configuration by removing specific dependency version constraints from MSRV shell hook ([thesimplekid]). ### Fixed - cashu: Fixed CurrencyUnit custom units preserving original case instead of being converted to uppercase ([thesimplekid]). diff --git a/Cargo.toml b/Cargo.toml index 08fc3c4a..e58db5d3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,7 +29,7 @@ bare_urls = "warn" [workspace.package] edition = "2021" -rust-version = "1.75.0" +rust-version = "1.85.0" license = "MIT" homepage = "https://github.com/cashubtc/cdk" repository = "https://github.com/cashubtc/cdk.git" diff --git a/crates/cashu/src/nuts/nut04.rs b/crates/cashu/src/nuts/nut04.rs index 475c590c..545cb7a3 100644 --- a/crates/cashu/src/nuts/nut04.rs +++ b/crates/cashu/src/nuts/nut04.rs @@ -331,7 +331,7 @@ mod tests { match settings.options { Some(MintMethodOptions::Bolt11 { description }) => { - assert_eq!(description, true); + assert!(description); } _ => panic!("Expected Bolt11 options with description = true"), } @@ -363,10 +363,7 @@ mod tests { match settings.options { Some(MintMethodOptions::Bolt11 { description }) => { - assert_eq!( - description, true, - "Top-level description should take precedence" - ); + assert!(description, "Top-level description should take precedence"); } _ => panic!("Expected Bolt11 options with description = true"), } diff --git a/crates/cashu/src/nuts/nut05.rs b/crates/cashu/src/nuts/nut05.rs index 34ec338e..fd8c4295 100644 --- a/crates/cashu/src/nuts/nut05.rs +++ b/crates/cashu/src/nuts/nut05.rs @@ -405,7 +405,7 @@ mod tests { match settings.options { Some(MeltMethodOptions::Bolt11 { amountless }) => { - assert_eq!(amountless, true); + assert!(amountless); } _ => panic!("Expected Bolt11 options with amountless = true"), } @@ -437,10 +437,7 @@ mod tests { match settings.options { Some(MeltMethodOptions::Bolt11 { amountless }) => { - assert_eq!( - amountless, true, - "Top-level amountless should take precedence" - ); + assert!(amountless, "Top-level amountless should take precedence"); } _ => panic!("Expected Bolt11 options with amountless = true"), } diff --git a/crates/cashu/src/nuts/nut18/payment_request.rs b/crates/cashu/src/nuts/nut18/payment_request.rs index 8408a952..65d90f80 100644 --- a/crates/cashu/src/nuts/nut18/payment_request.rs +++ b/crates/cashu/src/nuts/nut18/payment_request.rs @@ -404,7 +404,7 @@ mod tests { let bolt11 = Bolt11Invoice::from_str(bolt11).unwrap(); let nut10 = SpendingConditions::HTLCConditions { - data: bolt11.payment_hash().clone(), + data: *bolt11.payment_hash(), conditions: None, }; diff --git a/crates/cdk-cln/src/lib.rs b/crates/cdk-cln/src/lib.rs index a52dae61..d3c8d53c 100644 --- a/crates/cdk-cln/src/lib.rs +++ b/crates/cdk-cln/src/lib.rs @@ -97,9 +97,8 @@ impl MintPayment for Cln { self.rpc_socket ); - let last_pay_index = self.get_last_pay_index().await?.map(|idx| { + let last_pay_index = self.get_last_pay_index().await?.inspect(|&idx| { tracing::info!("CLN: Found last payment index: {}", idx); - idx }); tracing::debug!("CLN: Connecting to CLN node..."); diff --git a/crates/cdk-sql-common/src/mint/mod.rs b/crates/cdk-sql-common/src/mint/mod.rs index 2d31f02e..3b77c8d7 100644 --- a/crates/cdk-sql-common/src/mint/mod.rs +++ b/crates/cdk-sql-common/src/mint/mod.rs @@ -564,9 +564,8 @@ where .bind("quote_id", quote_id.as_hyphenated().to_string()) .fetch_one(&self.inner) .await - .map_err(|err| { - tracing::error!("SQLite could not get mint quote amount_paid"); - err + .inspect_err(|err| { + tracing::error!("SQLite could not get mint quote amount_paid: {}", err); })?; let current_amount_paid = if let Some(current_amount) = current_amount { @@ -593,9 +592,8 @@ where .bind("quote_id", quote_id.as_hyphenated().to_string()) .execute(&self.inner) .await - .map_err(|err| { - tracing::error!("SQLite could not update mint quote amount_paid"); - err + .inspect_err(|err| { + tracing::error!("SQLite could not update mint quote amount_paid: {}", err); })?; // Add payment_id to mint_quote_payments table @@ -638,9 +636,8 @@ where .bind("quote_id", quote_id.as_hyphenated().to_string()) .fetch_one(&self.inner) .await - .map_err(|err| { - tracing::error!("SQLite could not get mint quote amount_issued"); - err + .inspect_err(|err| { + tracing::error!("SQLite could not get mint quote amount_issued: {}", err); })?; let current_amount_issued = if let Some(current_amount) = current_amount { @@ -668,9 +665,8 @@ where .bind("quote_id", quote_id.as_hyphenated().to_string()) .execute(&self.inner) .await - .map_err(|err| { - tracing::error!("SQLite could not update mint quote amount_issued"); - err + .inspect_err(|err| { + tracing::error!("SQLite could not update mint quote amount_issued: {}", err); })?; let current_time = unix_time(); diff --git a/crates/cdk/src/wallet/subscription/ws.rs b/crates/cdk/src/wallet/subscription/ws.rs index 2b5a7d06..4eb78bad 100644 --- a/crates/cdk/src/wallet/subscription/ws.rs +++ b/crates/cdk/src/wallet/subscription/ws.rs @@ -46,19 +46,17 @@ pub async fn ws_main( mut on_drop: mpsc::Receiver, wallet: Arc, ) { - let url = mint_url + let mut url = mint_url .join_paths(&["v1", "ws"]) - .as_mut() - .map(|url| { - if url.scheme() == "https" { - url.set_scheme("wss").expect("Could not set scheme"); - } else { - url.set_scheme("ws").expect("Could not set scheme"); - } - url - }) - .expect("Could not join paths") - .to_string(); + .expect("Could not join paths"); + + if url.scheme() == "https" { + url.set_scheme("wss").expect("Could not set scheme"); + } else { + url.set_scheme("ws").expect("Could not set scheme"); + } + + let url = url.to_string(); let mut active_subscriptions = HashMap::>::new(); let mut failure_count = 0; diff --git a/flake.nix b/flake.nix index 5790c106..d90c42f1 100644 --- a/flake.nix +++ b/flake.nix @@ -55,7 +55,7 @@ }; # MSRV stable - msrv_toolchain = pkgs.rust-bin.stable."1.75.0".default.override { + msrv_toolchain = pkgs.rust-bin.stable."1.85.0".default.override { targets = [ "wasm32-unknown-unknown" ]; # wasm }; @@ -139,17 +139,6 @@ msrv = pkgs.mkShell ({ shellHook = " ${_shellHook} - cargo update - # cargo update -p async-compression --precise 0.4.3 - cargo update -p home --precise 0.5.9 - cargo update -p zerofrom --precise 0.1.5 - cargo update -p half --precise 2.4.1 - cargo update -p base64ct --precise 1.7.3 - cargo update -p url --precise 2.5.2 - cargo update -p pest_derive --precise 2.8.0 - cargo update -p pest_generator --precise 2.8.0 - cargo update -p pest_meta --precise 2.8.0 - cargo update -p pest --precise 2.8.0 "; buildInputs = buildInputs ++ [ msrv_toolchain ]; inherit nativeBuildInputs;