Add Proofs trait to consolidate aggregate fns

This commit is contained in:
ok300
2024-10-16 21:31:12 +02:00
committed by thesimplekid
parent cd9c098bcc
commit f6533a08de
15 changed files with 70 additions and 87 deletions

View File

@@ -10,6 +10,7 @@ use bitcoin::bip32::DerivationPath;
use cdk::cdk_database::{self, MintDatabase};
use cdk::mint::{MintKeySetInfo, MintQuote};
use cdk::mint_url::MintUrl;
use cdk::nuts::nut00::ProofsMethods;
use cdk::nuts::nut05::QuoteState;
use cdk::nuts::{
BlindSignature, BlindSignatureDleq, CurrencyUnit, Id, MeltBolt11Request, MeltQuoteState,
@@ -838,10 +839,7 @@ WHERE quote_id=?;
.map(sqlite_row_to_proof)
.collect::<Result<Vec<Proof>, _>>()?;
proofs
.iter()
.map(|p| p.y())
.collect::<Result<Vec<PublicKey>, _>>()?
proofs.ys()?
}
Err(err) => match err {
sqlx::Error::RowNotFound => {