refactor: nut04 and nut05 (#749)

This commit is contained in:
thesimplekid
2025-05-19 09:49:11 +01:00
committed by GitHub
parent fc2b0b3ea2
commit b63dc1045d
40 changed files with 1133 additions and 603 deletions

View File

@@ -10,8 +10,8 @@ use super::Error;
use crate::common::{PaymentProcessorKey, QuoteTTL};
use crate::mint::{self, MintKeySetInfo, MintQuote as MintMintQuote};
use crate::nuts::{
BlindSignature, CurrencyUnit, Id, MeltBolt11Request, MeltQuoteState, MintQuoteState, Proof,
Proofs, PublicKey, State,
BlindSignature, CurrencyUnit, Id, MeltQuoteState, MeltRequest, MintQuoteState, Proof, Proofs,
PublicKey, State,
};
#[cfg(feature = "auth")]
@@ -96,14 +96,14 @@ pub trait QuotesDatabase {
/// Add melt request
async fn add_melt_request(
&self,
melt_request: MeltBolt11Request<Uuid>,
melt_request: MeltRequest<Uuid>,
ln_key: PaymentProcessorKey,
) -> Result<(), Self::Err>;
/// Get melt request
async fn get_melt_request(
&self,
quote_id: &Uuid,
) -> Result<Option<(MeltBolt11Request<Uuid>, PaymentProcessorKey)>, Self::Err>;
) -> Result<Option<(MeltRequest<Uuid>, PaymentProcessorKey)>, Self::Err>;
}
/// Mint Proof Database trait

View File

@@ -309,12 +309,15 @@ pub enum Error {
/// NUT20 Error
#[error(transparent)]
NUT20(#[from] crate::nuts::nut20::Error),
/// NUTXX Error
/// NUT21 Error
#[error(transparent)]
NUT21(#[from] crate::nuts::nut21::Error),
/// NUTXX1 Error
/// NUT22 Error
#[error(transparent)]
NUT22(#[from] crate::nuts::nut22::Error),
/// NUT23 Error
#[error(transparent)]
NUT23(#[from] crate::nuts::nut23::Error),
/// Database Error
#[error(transparent)]
Database(crate::database::Error),

View File

@@ -52,6 +52,9 @@ pub enum Error {
/// NUT05 Error
#[error(transparent)]
NUT05(#[from] crate::nuts::nut05::Error),
/// NUT23 Error
#[error(transparent)]
NUT23(#[from] crate::nuts::nut23::Error),
/// Custom
#[error("`{0}`")]
Custom(String),