diff --git a/crates/cdk-common/src/database/mint/mod.rs b/crates/cdk-common/src/database/mint/mod.rs index 922c9d29..9c08734c 100644 --- a/crates/cdk-common/src/database/mint/mod.rs +++ b/crates/cdk-common/src/database/mint/mod.rs @@ -170,8 +170,7 @@ pub trait QuotesTransaction<'a> { quote_id: &QuoteId, amount_issued: Amount, ) -> Result; - /// Remove [`MintMintQuote`] - async fn remove_mint_quote(&mut self, quote_id: &QuoteId) -> Result<(), Self::Err>; + /// Get [`mint::MeltQuote`] and lock it for update in this transaction async fn get_melt_quote( &mut self, @@ -196,8 +195,7 @@ pub trait QuotesTransaction<'a> { new_state: MeltQuoteState, payment_proof: Option, ) -> Result<(MeltQuoteState, mint::MeltQuote), Self::Err>; - /// Remove [`mint::MeltQuote`] - async fn remove_melt_quote(&mut self, quote_id: &QuoteId) -> Result<(), Self::Err>; + /// Get all [`MintMintQuote`]s and lock it for update in this transaction async fn get_mint_quote_by_request( &mut self, diff --git a/crates/cdk-sql-common/src/mint/mod.rs b/crates/cdk-sql-common/src/mint/mod.rs index 3bd0c4bf..b3bef8d8 100644 --- a/crates/cdk-sql-common/src/mint/mod.rs +++ b/crates/cdk-sql-common/src/mint/mod.rs @@ -878,14 +878,6 @@ VALUES (:quote_id, :amount, :timestamp); Ok(()) } - async fn remove_mint_quote(&mut self, quote_id: &QuoteId) -> Result<(), Self::Err> { - query(r#"DELETE FROM mint_quote WHERE id=:id"#)? - .bind("id", quote_id.to_string()) - .execute(&self.inner) - .await?; - Ok(()) - } - async fn add_melt_quote(&mut self, quote: mint::MeltQuote) -> Result<(), Self::Err> { // Now insert the new quote query( @@ -1020,20 +1012,6 @@ VALUES (:quote_id, :amount, :timestamp); Ok((old_state, quote)) } - async fn remove_melt_quote(&mut self, quote_id: &QuoteId) -> Result<(), Self::Err> { - query( - r#" - DELETE FROM melt_quote - WHERE id=:id - "#, - )? - .bind("id", quote_id.to_string()) - .execute(&self.inner) - .await?; - - Ok(()) - } - async fn get_mint_quote(&mut self, quote_id: &QuoteId) -> Result, Self::Err> { let payments = get_mint_quote_payments(&self.inner, quote_id).await?; let issuance = get_mint_quote_issuance(&self.inner, quote_id).await?; diff --git a/crates/cdk/src/mint/issue/mod.rs b/crates/cdk/src/mint/issue/mod.rs index 45c0268e..8104b2e3 100644 --- a/crates/cdk/src/mint/issue/mod.rs +++ b/crates/cdk/src/mint/issue/mod.rs @@ -376,39 +376,6 @@ impl Mint { result } - /// Removes a mint quote from the database - /// - /// # Arguments - /// * `quote_id` - The UUID of the quote to remove - /// - /// # Returns - /// * `Ok(())` if removal was successful - /// * `Error` if the quote doesn't exist or removal fails - #[instrument(skip_all)] - pub async fn remove_mint_quote(&self, quote_id: &QuoteId) -> Result<(), Error> { - #[cfg(feature = "prometheus")] - METRICS.inc_in_flight_requests("remove_mint_quote"); - - let result = async { - let mut tx = self.localstore.begin_transaction().await?; - tx.remove_mint_quote(quote_id).await?; - tx.commit().await?; - Ok(()) - } - .await; - - #[cfg(feature = "prometheus")] - { - METRICS.dec_in_flight_requests("remove_mint_quote"); - METRICS.record_mint_operation("remove_mint_quote", result.is_ok()); - if result.is_err() { - METRICS.record_error(); - } - } - - result - } - /// Marks a mint quote as paid based on the payment request ID /// /// Looks up the mint quote by the payment request ID and marks it as paid