diff --git a/crates/cdk/Cargo.toml b/crates/cdk/Cargo.toml index fd31c5e9..4896b0a7 100644 --- a/crates/cdk/Cargo.toml +++ b/crates/cdk/Cargo.toml @@ -10,12 +10,9 @@ license.workspace = true [features] -default = ["mint", "wallet", "all-nuts"] +default = ["mint", "wallet"] mint = ["dep:bip39"] -wallet = ["nut13", "dep:bip39", "dep:reqwest"] -all-nuts = ["nut13"] -nut13 = ["dep:bip39"] - +wallet = ["dep:bip39", "dep:reqwest"] [dependencies] async-trait = "0.1" diff --git a/crates/cdk/src/error.rs b/crates/cdk/src/error.rs index 5c654d02..272c8594 100644 --- a/crates/cdk/src/error.rs +++ b/crates/cdk/src/error.rs @@ -37,7 +37,6 @@ pub enum Error { #[error(transparent)] Secret(#[from] super::secret::Error), /// Bip32 error - #[cfg(feature = "nut13")] #[error(transparent)] Bip32(#[from] bitcoin::bip32::Error), /// Parse int error diff --git a/crates/cdk/src/nuts/mod.rs b/crates/cdk/src/nuts/mod.rs index 50115be7..2a3ce377 100644 --- a/crates/cdk/src/nuts/mod.rs +++ b/crates/cdk/src/nuts/mod.rs @@ -11,7 +11,6 @@ pub mod nut09; pub mod nut10; pub mod nut11; pub mod nut12; -#[cfg(feature = "nut13")] pub mod nut13; pub mod nut14; diff --git a/crates/cdk/src/wallet.rs b/crates/cdk/src/wallet.rs index 83393bca..a68f5dcc 100644 --- a/crates/cdk/src/wallet.rs +++ b/crates/cdk/src/wallet.rs @@ -426,11 +426,7 @@ impl Wallet { .get_keyset_counter(&active_keyset_id) .await?; - let count = if let Some(count) = count { - count + 1 - } else { - 0 - }; + let count = count.map_or(0, |c| c + 1); let premint_secrets = PreMintSecrets::from_xpriv( active_keyset_id, @@ -616,11 +612,7 @@ impl Wallet { .get_keyset_counter(&active_keyset_id) .await?; - let count = if let Some(count) = count { - count + 1 - } else { - 0 - }; + let count = count.map_or(0, |c| c + 1); let change_premint_secrets = PreMintSecrets::from_xpriv( active_keyset_id, @@ -641,11 +633,7 @@ impl Wallet { .get_keyset_counter(&active_keyset_id) .await?; - let count = if let Some(count) = count { - count + 1 - } else { - 0 - }; + let mut count = count.map_or(0, |c| c + 1); let premint_secrets = PreMintSecrets::from_xpriv( active_keyset_id, @@ -655,7 +643,7 @@ impl Wallet { false, )?; - let count = count + premint_secrets.len() as u32; + count += premint_secrets.len() as u32; let change_premint_secrets = PreMintSecrets::from_xpriv( active_keyset_id, @@ -867,11 +855,7 @@ impl Wallet { .get_keyset_counter(&active_keyset_id) .await?; - let count = if let Some(count) = count { - count + 1 - } else { - 0 - }; + let count = count.map_or(0, |c| c + 1); let premint_secrets = PreMintSecrets::from_xpriv(active_keyset_id, count, self.xpriv, proofs_amount, true)?; @@ -1084,7 +1068,6 @@ impl Wallet { Ok(Token::new(mint_url, proofs, memo, unit)?.to_string()) } - #[cfg(feature = "nut13")] #[instrument(skip(self), fields(mint_url = %mint_url))] pub async fn restore(&mut self, mint_url: UncheckedUrl) -> Result { // Check that mint is in store of mints @@ -1156,7 +1139,6 @@ impl Wallet { tracing::debug!("Restored {} proofs", proofs.len()); - #[cfg(feature = "nut13")] self.localstore .increment_keyset_counter(&keyset.id, proofs.len() as u32) .await?; diff --git a/misc/scripts/check-crates.sh b/misc/scripts/check-crates.sh index 998e4bf1..eb066cbe 100755 --- a/misc/scripts/check-crates.sh +++ b/misc/scripts/check-crates.sh @@ -27,7 +27,6 @@ buildargs=( "-p cdk --no-default-features" "-p cdk --no-default-features --features wallet" "-p cdk --no-default-features --features mint" - "-p cdk --no-default-features --features nut13" "-p cdk-redb" "-p cdk-redb --no-default-features --features wallet" "-p cdk-redb --no-default-features --features mint"