mirror of
https://github.com/aljazceru/cdk.git
synced 2025-12-23 07:35:03 +01:00
Revert "fix: creating auth keyset when auth disabled"
This commit is contained in:
@@ -26,7 +26,7 @@ pub async fn check_pending(multi_mint_wallet: &MultiMintWallet) -> Result<()> {
|
||||
// Try to reclaim any proofs that are no longer pending
|
||||
match wallet.reclaim_unspent(pending_proofs).await {
|
||||
Ok(()) => println!("Successfully reclaimed pending proofs"),
|
||||
Err(e) => println!("Error reclaimed pending proofs: {e}"),
|
||||
Err(e) => println!("Error reclaimed pending proofs: {}", e),
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
|
||||
@@ -37,7 +37,7 @@ impl DbSignatory {
|
||||
pub async fn new(
|
||||
localstore: Arc<dyn database::MintKeysDatabase<Err = database::Error> + Send + Sync>,
|
||||
seed: &[u8],
|
||||
supported_units: HashMap<CurrencyUnit, (u64, u8)>,
|
||||
mut supported_units: HashMap<CurrencyUnit, (u64, u8)>,
|
||||
custom_paths: HashMap<CurrencyUnit, DerivationPath>,
|
||||
) -> Result<Self, Error> {
|
||||
let secp_ctx = Secp256k1::new();
|
||||
@@ -52,6 +52,8 @@ impl DbSignatory {
|
||||
)
|
||||
.await?;
|
||||
|
||||
supported_units.entry(CurrencyUnit::Auth).or_insert((0, 1));
|
||||
|
||||
// Create new keysets for supported units that aren't covered by the current keysets
|
||||
for (unit, (fee, max_order)) in supported_units {
|
||||
if !active_keyset_units.contains(&unit) {
|
||||
|
||||
@@ -340,14 +340,6 @@ impl MintBuilder {
|
||||
.ok_or(anyhow!("Localstore not set"))?;
|
||||
let ln = self.ln.clone().ok_or(anyhow!("Ln backends not set"))?;
|
||||
|
||||
#[allow(unused_mut)]
|
||||
let mut supported_units = self.supported_units.clone();
|
||||
|
||||
#[cfg(feature = "auth")]
|
||||
if self.openid_discovery.is_some() {
|
||||
supported_units.entry(CurrencyUnit::Auth).or_insert((0, 1));
|
||||
}
|
||||
|
||||
let signatory = if let Some(signatory) = self.signatory.as_ref() {
|
||||
signatory.clone()
|
||||
} else {
|
||||
@@ -355,7 +347,7 @@ impl MintBuilder {
|
||||
let in_memory_signatory = cdk_signatory::db_signatory::DbSignatory::new(
|
||||
self.keystore.clone().ok_or(anyhow!("keystore not set"))?,
|
||||
seed,
|
||||
supported_units,
|
||||
self.supported_units.clone(),
|
||||
HashMap::new(),
|
||||
)
|
||||
.await?;
|
||||
|
||||
Reference in New Issue
Block a user