Skip to content

Commit 4a0010d

Browse files
Merge pull request #1738 from jkczyz/2022-09-invoice-request
BOLT 12 `invoice_request` encoding and building
2 parents 3d2c8f5 + b25c8df commit 4a0010d

File tree

9 files changed

+1802
-46
lines changed

9 files changed

+1802
-46
lines changed

lightning/src/ln/features.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ mod sealed {
158158
BasicMPP,
159159
]);
160160
define_context!(OfferContext, []);
161+
define_context!(InvoiceRequestContext, []);
161162
// This isn't a "real" feature context, and is only used in the channel_type field in an
162163
// `OpenChannel` message.
163164
define_context!(ChannelTypeContext, [
@@ -367,7 +368,8 @@ mod sealed {
367368
supports_keysend, requires_keysend);
368369

369370
#[cfg(test)]
370-
define_feature!(123456789, UnknownFeature, [NodeContext, ChannelContext, InvoiceContext, OfferContext],
371+
define_feature!(123456789, UnknownFeature,
372+
[NodeContext, ChannelContext, InvoiceContext, OfferContext, InvoiceRequestContext],
371373
"Feature flags for an unknown feature used in testing.", set_unknown_feature_optional,
372374
set_unknown_feature_required, supports_unknown_test_feature, requires_unknown_test_feature);
373375
}
@@ -426,8 +428,10 @@ pub type NodeFeatures = Features<sealed::NodeContext>;
426428
pub type ChannelFeatures = Features<sealed::ChannelContext>;
427429
/// Features used within an invoice.
428430
pub type InvoiceFeatures = Features<sealed::InvoiceContext>;
429-
/// Features used within an offer.
431+
/// Features used within an `offer`.
430432
pub type OfferFeatures = Features<sealed::OfferContext>;
433+
/// Features used within an `invoice_request`.
434+
pub type InvoiceRequestFeatures = Features<sealed::InvoiceRequestContext>;
431435

432436
/// Features used within the channel_type field in an OpenChannel message.
433437
///
@@ -735,6 +739,7 @@ macro_rules! impl_feature_tlv_write {
735739

736740
impl_feature_tlv_write!(ChannelTypeFeatures);
737741
impl_feature_tlv_write!(OfferFeatures);
742+
impl_feature_tlv_write!(InvoiceRequestFeatures);
738743

739744
#[cfg(test)]
740745
mod tests {

0 commit comments

Comments
 (0)