Skip to content

Commit e77e38d

Browse files
committed
f - add offer metadata
1 parent cb81425 commit e77e38d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lightning/src/offers/offer.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -440,8 +440,8 @@ impl TryFrom<ParsedOffer> for Offer {
440440

441441
fn try_from(offer: ParsedOffer) -> Result<Self, Self::Error> {
442442
let ParsedOffer(OfferTlvStream {
443-
chains, currency, amount, description, features, absolute_expiry, paths, issuer,
444-
quantity_min, quantity_max, node_id, send_invoice, signature,
443+
chains, metadata, currency, amount, description, features, absolute_expiry, paths,
444+
issuer, quantity_min, quantity_max, node_id, send_invoice, signature,
445445
}, data) = offer;
446446

447447
let supported_chains = [
@@ -459,6 +459,8 @@ impl TryFrom<ParsedOffer> for Offer {
459459
},
460460
};
461461

462+
let metadata = metadata.map(Into::into);
463+
462464
let amount = match (currency, amount.map(Into::into)) {
463465
(None, None) => None,
464466
(None, Some(amount_msats)) => Some(Amount::Bitcoin { amount_msats }),
@@ -514,8 +516,8 @@ impl TryFrom<ParsedOffer> for Offer {
514516
}
515517

516518
Ok(Offer {
517-
id, chains, amount, description, features, absolute_expiry, issuer, paths, quantity_min,
518-
quantity_max, node_id, send_invoice, signature,
519+
id, chains, metadata, amount, description, features, absolute_expiry, issuer, paths,
520+
quantity_min, quantity_max, node_id, send_invoice, signature,
519521
})
520522
}
521523
}

0 commit comments

Comments
 (0)