@@ -51,7 +51,7 @@ use bitcoin::{Address, Network, PubkeyHash, ScriptHash};
5151use bitcoin:: util:: address:: { Payload , WitnessVersion } ;
5252use bitcoin_hashes:: { Hash , sha256} ;
5353use lightning:: ln:: PaymentSecret ;
54- use lightning:: ln:: features:: InvoiceFeatures ;
54+ use lightning:: ln:: features:: Bolt11InvoiceFeatures ;
5555#[ cfg( any( doc, test) ) ]
5656use lightning:: routing:: gossip:: RoutingFees ;
5757use lightning:: routing:: router:: RouteHint ;
@@ -448,7 +448,7 @@ pub enum TaggedField {
448448 PrivateRoute ( PrivateRoute ) ,
449449 PaymentSecret ( PaymentSecret ) ,
450450 PaymentMetadata ( Vec < u8 > ) ,
451- Features ( InvoiceFeatures ) ,
451+ Features ( Bolt11InvoiceFeatures ) ,
452452}
453453
454454/// SHA-256 hash
@@ -744,7 +744,7 @@ impl<D: tb::Bool, H: tb::Bool, T: tb::Bool, C: tb::Bool, M: tb::Bool> InvoiceBui
744744 }
745745 self . tagged_fields . push ( TaggedField :: PaymentSecret ( payment_secret) ) ;
746746 if !found_features {
747- let mut features = InvoiceFeatures :: empty ( ) ;
747+ let mut features = Bolt11InvoiceFeatures :: empty ( ) ;
748748 features. set_variable_length_onion_required ( ) ;
749749 features. set_payment_secret_required ( ) ;
750750 self . tagged_fields . push ( TaggedField :: Features ( features) ) ;
@@ -770,7 +770,7 @@ impl<D: tb::Bool, H: tb::Bool, T: tb::Bool, C: tb::Bool, S: tb::Bool> InvoiceBui
770770 }
771771 }
772772 if !found_features {
773- let mut features = InvoiceFeatures :: empty ( ) ;
773+ let mut features = Bolt11InvoiceFeatures :: empty ( ) ;
774774 features. set_payment_metadata_optional ( ) ;
775775 self . tagged_fields . push ( TaggedField :: Features ( features) ) ;
776776 }
@@ -1059,7 +1059,7 @@ impl RawBolt11Invoice {
10591059 find_extract ! ( self . known_tagged_fields( ) , TaggedField :: PaymentMetadata ( ref x) , x)
10601060 }
10611061
1062- pub fn features ( & self ) -> Option < & InvoiceFeatures > {
1062+ pub fn features ( & self ) -> Option < & Bolt11InvoiceFeatures > {
10631063 find_extract ! ( self . known_tagged_fields( ) , TaggedField :: Features ( ref x) , x)
10641064 }
10651065
@@ -1336,7 +1336,7 @@ impl Bolt11Invoice {
13361336 }
13371337
13381338 /// Get the invoice features if they were included in the invoice
1339- pub fn features ( & self ) -> Option < & InvoiceFeatures > {
1339+ pub fn features ( & self ) -> Option < & Bolt11InvoiceFeatures > {
13401340 self . signed_invoice . features ( )
13411341 }
13421342
@@ -1863,7 +1863,7 @@ mod test {
18631863 #[ test]
18641864 fn test_check_feature_bits ( ) {
18651865 use crate :: TaggedField :: * ;
1866- use lightning:: ln:: features:: InvoiceFeatures ;
1866+ use lightning:: ln:: features:: Bolt11InvoiceFeatures ;
18671867 use secp256k1:: Secp256k1 ;
18681868 use secp256k1:: SecretKey ;
18691869 use crate :: { Bolt11Invoice , RawBolt11Invoice , RawHrp , RawDataPart , Currency , Sha256 , PositiveTimestamp ,
@@ -1904,12 +1904,12 @@ mod test {
19041904 let invoice = {
19051905 let mut invoice = invoice_template. clone ( ) ;
19061906 invoice. data . tagged_fields . push ( PaymentSecret ( payment_secret) . into ( ) ) ;
1907- invoice. data . tagged_fields . push ( Features ( InvoiceFeatures :: empty ( ) ) . into ( ) ) ;
1907+ invoice. data . tagged_fields . push ( Features ( Bolt11InvoiceFeatures :: empty ( ) ) . into ( ) ) ;
19081908 invoice. sign :: < _ , ( ) > ( |hash| Ok ( Secp256k1 :: new ( ) . sign_ecdsa_recoverable ( hash, & private_key) ) )
19091909 } . unwrap ( ) ;
19101910 assert_eq ! ( Bolt11Invoice :: from_signed( invoice) , Err ( Bolt11SemanticError :: InvalidFeatures ) ) ;
19111911
1912- let mut payment_secret_features = InvoiceFeatures :: empty ( ) ;
1912+ let mut payment_secret_features = Bolt11InvoiceFeatures :: empty ( ) ;
19131913 payment_secret_features. set_payment_secret_required ( ) ;
19141914
19151915 // Including payment secret and feature bits
@@ -1931,7 +1931,7 @@ mod test {
19311931 // No payment secret or feature bits
19321932 let invoice = {
19331933 let mut invoice = invoice_template. clone ( ) ;
1934- invoice. data . tagged_fields . push ( Features ( InvoiceFeatures :: empty ( ) ) . into ( ) ) ;
1934+ invoice. data . tagged_fields . push ( Features ( Bolt11InvoiceFeatures :: empty ( ) ) . into ( ) ) ;
19351935 invoice. sign :: < _ , ( ) > ( |hash| Ok ( Secp256k1 :: new ( ) . sign_ecdsa_recoverable ( hash, & private_key) ) )
19361936 } . unwrap ( ) ;
19371937 assert_eq ! ( Bolt11Invoice :: from_signed( invoice) , Err ( Bolt11SemanticError :: NoPaymentSecret ) ) ;
@@ -2147,7 +2147,7 @@ mod test {
21472147 assert_eq ! ( invoice. payment_hash( ) , & sha256:: Hash :: from_slice( & [ 21 ; 32 ] [ ..] ) . unwrap( ) ) ;
21482148 assert_eq ! ( invoice. payment_secret( ) , & PaymentSecret ( [ 42 ; 32 ] ) ) ;
21492149
2150- let mut expected_features = InvoiceFeatures :: empty ( ) ;
2150+ let mut expected_features = Bolt11InvoiceFeatures :: empty ( ) ;
21512151 expected_features. set_variable_length_onion_required ( ) ;
21522152 expected_features. set_payment_secret_required ( ) ;
21532153 expected_features. set_basic_mpp_optional ( ) ;
0 commit comments