-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into ok300-mintd-swagger-ui
# Conflicts: # crates/cdk/src/nuts/nut01/mod.rs
- Loading branch information
Showing
24 changed files
with
245 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
use std::collections::BTreeMap; | ||
|
||
use anyhow::Result; | ||
use cdk::{ | ||
mint_url::MintUrl, | ||
nuts::{CurrencyUnit, Proof}, | ||
wallet::multi_mint_wallet::MultiMintWallet, | ||
}; | ||
|
||
pub async fn proofs(multi_mint_wallet: &MultiMintWallet) -> Result<()> { | ||
list_proofs(multi_mint_wallet).await?; | ||
Ok(()) | ||
} | ||
|
||
async fn list_proofs( | ||
multi_mint_wallet: &MultiMintWallet, | ||
) -> Result<Vec<(MintUrl, (Vec<Proof>, CurrencyUnit))>> { | ||
let wallets_proofs: BTreeMap<MintUrl, (Vec<Proof>, CurrencyUnit)> = | ||
multi_mint_wallet.list_proofs().await?; | ||
|
||
let mut proofs_vec = Vec::with_capacity(wallets_proofs.len()); | ||
|
||
for (i, (mint_url, proofs)) in wallets_proofs.iter().enumerate() { | ||
let mint_url = mint_url.clone(); | ||
println!("{i}: {mint_url}"); | ||
println!("| Amount | Unit | Secret | DLEQ proof included"); | ||
println!("|----------|------|------------------------------------------------------------------|--------------------"); | ||
for proof in &proofs.0 { | ||
println!( | ||
"| {:8} | {:4} | {:64} | {}", | ||
proof.amount, | ||
proofs.1, | ||
proof.secret, | ||
proof.dleq.is_some() | ||
); | ||
} | ||
println!(); | ||
proofs_vec.push((mint_url, proofs.clone())) | ||
} | ||
Ok(proofs_vec) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.