Skip to content

Commit 0ca166e

Browse files
committed
f - add offer metadata
1 parent f1640f7 commit 0ca166e

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
@@ -481,8 +481,8 @@ impl TryFrom<ParsedOffer> for Offer {
481481

482482
fn try_from(offer: ParsedOffer) -> Result<Self, Self::Error> {
483483
let ParsedOffer(OfferTlvStream {
484-
chains, currency, amount, description, features, absolute_expiry, paths, issuer,
485-
quantity_min, quantity_max, node_id, send_invoice, signature,
484+
chains, metadata, currency, amount, description, features, absolute_expiry, paths,
485+
issuer, quantity_min, quantity_max, node_id, send_invoice, signature,
486486
}, data) = offer;
487487

488488
let supported_chains = [
@@ -500,6 +500,8 @@ impl TryFrom<ParsedOffer> for Offer {
500500
},
501501
};
502502

503+
let metadata = metadata.map(Into::into);
504+
503505
let amount = match (currency, amount.map(Into::into)) {
504506
(None, None) => None,
505507
(None, Some(amount_msats)) => Some(Amount::Bitcoin { amount_msats }),
@@ -555,8 +557,8 @@ impl TryFrom<ParsedOffer> for Offer {
555557
}
556558

557559
Ok(Offer {
558-
id, chains, amount, description, features, absolute_expiry, issuer, paths, quantity_min,
559-
quantity_max, node_id, send_invoice, signature,
560+
id, chains, metadata, amount, description, features, absolute_expiry, issuer, paths,
561+
quantity_min, quantity_max, node_id, send_invoice, signature,
560562
})
561563
}
562564
}

0 commit comments

Comments
 (0)