@@ -160,6 +160,14 @@ mod sealed {
160
160
VariableLengthOnion | PaymentSecret ,
161
161
// Byte 2
162
162
BasicMPP ,
163
+ // Byte 3
164
+ ,
165
+ // Byte 4
166
+ ,
167
+ // Byte 5
168
+ ,
169
+ // Byte 6
170
+ PaymentMetadata ,
163
171
] ) ;
164
172
define_context ! ( OfferContext , [ ] ) ;
165
173
define_context ! ( InvoiceRequestContext , [ ] ) ;
@@ -376,6 +384,9 @@ mod sealed {
376
384
define_feature ! ( 47 , SCIDPrivacy , [ InitContext , NodeContext , ChannelTypeContext ] ,
377
385
"Feature flags for only forwarding with SCID aliasing. Called `option_scid_alias` in the BOLTs" ,
378
386
set_scid_privacy_optional, set_scid_privacy_required, supports_scid_privacy, requires_scid_privacy) ;
387
+ define_feature ! ( 49 , PaymentMetadata , [ InvoiceContext ] ,
388
+ "Feature flags for payment metadata in invoices." , set_payment_metadata_optional,
389
+ set_payment_metadata_required, supports_payment_metadata, requires_payment_metadata) ;
379
390
define_feature ! ( 51 , ZeroConf , [ InitContext , NodeContext , ChannelTypeContext ] ,
380
391
"Feature flags for accepting channels with zero confirmations. Called `option_zeroconf` in the BOLTs" ,
381
392
set_zero_conf_optional, set_zero_conf_required, supports_zero_conf, requires_zero_conf) ;
@@ -885,13 +896,13 @@ mod tests {
885
896
#[ test]
886
897
fn convert_to_context_with_unknown_flags ( ) {
887
898
// Ensure the `from` context has fewer known feature bytes than the `to` context.
888
- assert ! ( <sealed:: InvoiceContext as sealed:: Context >:: KNOWN_FEATURE_MASK . len( ) <
889
- <sealed:: NodeContext as sealed:: Context >:: KNOWN_FEATURE_MASK . len( ) ) ;
890
- let mut invoice_features = InvoiceFeatures :: empty ( ) ;
891
- invoice_features . set_unknown_feature_optional ( ) ;
892
- assert ! ( invoice_features . supports_unknown_bits( ) ) ;
893
- let node_features : NodeFeatures = invoice_features . to_context ( ) ;
894
- assert ! ( !node_features . supports_unknown_bits( ) ) ;
899
+ assert ! ( <sealed:: ChannelContext as sealed:: Context >:: KNOWN_FEATURE_MASK . len( ) <
900
+ <sealed:: InvoiceContext as sealed:: Context >:: KNOWN_FEATURE_MASK . len( ) ) ;
901
+ let mut channel_features = ChannelFeatures :: empty ( ) ;
902
+ channel_features . set_unknown_feature_optional ( ) ;
903
+ assert ! ( channel_features . supports_unknown_bits( ) ) ;
904
+ let invoice_features : InvoiceFeatures = channel_features . to_context_internal ( ) ;
905
+ assert ! ( !invoice_features . supports_unknown_bits( ) ) ;
895
906
}
896
907
897
908
#[ test]
0 commit comments