Skip to content

Improve error logging for get melt quote of get melt quote #1390

@thesimplekid

Description

@thesimplekid

/// Implementation of get_melt_bolt12_quote
#[instrument(skip_all)]
async fn get_melt_bolt12_quote_impl(
&self,
melt_request: &MeltQuoteBolt12Request,
) -> Result<MeltQuoteBolt11Response<QuoteId>, Error> {
let MeltQuoteBolt12Request {
request,
unit,
options,
} = melt_request;
let offer = Offer::from_str(request).map_err(|_| Error::InvalidPaymentRequest)?;
let amount = match options {
Some(options) => match options {
MeltOptions::Amountless { amountless } => {
to_unit(amountless.amount_msat, &CurrencyUnit::Msat, unit)?
}
_ => return Err(Error::UnsupportedUnit),
},
None => amount_for_offer(&offer, unit).map_err(|_| Error::UnsupportedUnit)?,
};

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions