Cesar Rodas 4 周之前
父节点
当前提交
815ce771d6
共有 2 个文件被更改,包括 1 次插入51 次删除
  1. 1 1
      crates/cdk-integration-tests/tests/regtest.rs
  2. 0 50
      crates/cdk/src/wallet/auth/auth_wallet.rs

+ 1 - 1
crates/cdk-integration-tests/tests/regtest.rs

@@ -314,7 +314,7 @@ async fn test_cached_mint() {
         .await
         .expect("payment");
 
-    let active_keyset_id = wallet.fetch_active_keyset(None).await.unwrap().id;
+    let active_keyset_id = wallet.fetch_active_keyset().await.unwrap().id;
     let fee_and_amounts = (0, ((0..32).map(|x| 2u64.pow(x)).collect::<Vec<_>>())).into();
     let http_client = HttpClient::new(get_mint_url_from_env().parse().unwrap(), None);
     let premint_secrets = PreMintSecrets::random(

+ 0 - 50
crates/cdk/src/wallet/auth/auth_wallet.rs

@@ -192,39 +192,6 @@ impl AuthWallet {
         Ok(keys)
     }
 
-    /// Get blind auth keysets from local database or go online if missing (with transaction)
-    ///
-    /// First checks the local database for cached blind auth keysets. If keysets are not found locally,
-    /// goes online to refresh keysets from the mint and updates the local database.
-    /// This is the main method for getting auth keysets in operations that can work offline
-    /// but will fall back to online if needed.
-    ///
-    /// This version requires a database transaction to be passed in.
-    #[instrument(skip(self, tx))]
-    pub(crate) async fn load_mint_keysets_with_tx(
-        &self,
-        tx: &mut Tx<'_, '_>,
-    ) -> Result<Vec<KeySetInfo>, Error> {
-        match tx.get_mint_keysets(self.mint_url.clone()).await? {
-            Some(keysets_info) => {
-                let auth_keysets: Vec<KeySetInfo> =
-                    keysets_info.unit(CurrencyUnit::Sat).cloned().collect();
-                if auth_keysets.is_empty() {
-                    // If we don't have any auth keysets, fetch them from the mint
-                    let keysets = self.refresh_keysets_with_tx(tx).await?;
-                    Ok(keysets)
-                } else {
-                    Ok(auth_keysets)
-                }
-            }
-            None => {
-                // If we don't have any keysets, fetch them from the mint
-                let keysets = self.refresh_keysets_with_tx(tx).await?;
-                Ok(keysets)
-            }
-        }
-    }
-
     /// Get blind auth keysets from local database or go online if missing
     ///
     /// First checks the local database for cached blind auth keysets. If keysets are not found locally,
@@ -330,23 +297,6 @@ impl AuthWallet {
         Ok(auth_keysets)
     }
 
-    /// Get the first active blind auth keyset - always goes online (with transaction)
-    ///
-    /// This method always goes online to refresh keysets from the mint and then returns
-    /// the first active keyset found. Use this when you need the most up-to-date
-    /// keyset information for blind auth operations.
-    ///
-    /// This version requires a database transaction to be passed in.
-    #[instrument(skip(self, tx))]
-    pub(crate) async fn fetch_active_keyset_with_tx(
-        &self,
-        tx: &mut Tx<'_, '_>,
-    ) -> Result<KeySetInfo, Error> {
-        let auth_keysets = self.refresh_keysets_with_tx(tx).await?;
-        let keyset = auth_keysets.first().ok_or(Error::NoActiveKeyset)?;
-        Ok(keyset.clone())
-    }
-
     /// Get the first active blind auth keyset - always goes online
     ///
     /// This method always goes online to refresh keysets from the mint and then returns