@@ -740,6 +740,32 @@ mod tests {
740
740
}
741
741
}
742
742
743
+ #[ test]
744
+ fn builds_invoice_request_with_features ( ) {
745
+ let invoice_request = OfferBuilder :: new ( "foo" . into ( ) , recipient_pubkey ( ) )
746
+ . amount_msats ( 1000 )
747
+ . build ( ) . unwrap ( )
748
+ . request_invoice ( vec ! [ 1 ; 32 ] , payer_pubkey ( ) ) . unwrap ( )
749
+ . features ( InvoiceRequestFeatures :: unknown ( ) )
750
+ . build ( ) . unwrap ( )
751
+ . sign ( payer_sign) . unwrap ( ) ;
752
+ let ( _, _, tlv_stream, _) = invoice_request. as_tlv_stream ( ) ;
753
+ assert_eq ! ( invoice_request. features( ) , & InvoiceRequestFeatures :: unknown( ) ) ;
754
+ assert_eq ! ( tlv_stream. features, Some ( & InvoiceRequestFeatures :: unknown( ) ) ) ;
755
+
756
+ let invoice_request = OfferBuilder :: new ( "foo" . into ( ) , recipient_pubkey ( ) )
757
+ . amount_msats ( 1000 )
758
+ . build ( ) . unwrap ( )
759
+ . request_invoice ( vec ! [ 1 ; 32 ] , payer_pubkey ( ) ) . unwrap ( )
760
+ . features ( InvoiceRequestFeatures :: unknown ( ) )
761
+ . features ( InvoiceRequestFeatures :: empty ( ) )
762
+ . build ( ) . unwrap ( )
763
+ . sign ( payer_sign) . unwrap ( ) ;
764
+ let ( _, _, tlv_stream, _) = invoice_request. as_tlv_stream ( ) ;
765
+ assert_eq ! ( invoice_request. features( ) , & InvoiceRequestFeatures :: empty( ) ) ;
766
+ assert_eq ! ( tlv_stream. features, None ) ;
767
+ }
768
+
743
769
#[ test]
744
770
fn builds_invoice_request_with_quantity ( ) {
745
771
let ten = NonZeroU64 :: new ( 10 ) . unwrap ( ) ;
0 commit comments