@@ -158,7 +158,7 @@ where
158158
159159 let invoice = match description {
160160 Bolt11InvoiceDescription :: Direct ( description) => {
161- InvoiceBuilder :: new ( network) . description ( description. 0 . clone ( ) )
161+ InvoiceBuilder :: new ( network) . description ( description. 0 . 0 . clone ( ) )
162162 }
163163 Bolt11InvoiceDescription :: Hash ( hash) => InvoiceBuilder :: new ( network) . description_hash ( hash. 0 ) ,
164164 } ;
@@ -538,7 +538,7 @@ fn _create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_has
538538
539539 let invoice = match description {
540540 Bolt11InvoiceDescription :: Direct ( description) => {
541- InvoiceBuilder :: new ( network) . description ( description. 0 . clone ( ) )
541+ InvoiceBuilder :: new ( network) . description ( description. 0 . 0 . clone ( ) )
542542 }
543543 Bolt11InvoiceDescription :: Hash ( hash) => InvoiceBuilder :: new ( network) . description_hash ( hash. 0 ) ,
544544 } ;
@@ -808,6 +808,7 @@ mod test {
808808 use lightning:: util:: config:: UserConfig ;
809809 use crate :: utils:: { create_invoice_from_channelmanager_and_duration_since_epoch, rotate_through_iterators} ;
810810 use std:: collections:: HashSet ;
811+ use lightning:: util:: string:: UntrustedString ;
811812
812813 #[ test]
813814 fn test_prefer_current_channel ( ) {
@@ -852,7 +853,7 @@ mod test {
852853 assert_eq ! ( invoice. amount_pico_btc( ) , Some ( 100_000 ) ) ;
853854 // If no `min_final_cltv_expiry_delta` is specified, then it should be `MIN_FINAL_CLTV_EXPIRY_DELTA`.
854855 assert_eq ! ( invoice. min_final_cltv_expiry_delta( ) , MIN_FINAL_CLTV_EXPIRY_DELTA as u64 ) ;
855- assert_eq ! ( invoice. description( ) , Bolt11InvoiceDescription :: Direct ( & Description ( "test" . to_string( ) ) ) ) ;
856+ assert_eq ! ( invoice. description( ) , Bolt11InvoiceDescription :: Direct ( & Description ( UntrustedString ( "test" . to_string( ) ) ) ) ) ;
856857 assert_eq ! ( invoice. expiry_time( ) , Duration :: from_secs( non_default_invoice_expiry_secs. into( ) ) ) ;
857858
858859 // Invoice SCIDs should always use inbound SCID aliases over the real channel ID, if one is
@@ -963,7 +964,7 @@ mod test {
963964 ) . unwrap ( ) ;
964965 assert_eq ! ( invoice. amount_pico_btc( ) , Some ( 100_000 ) ) ;
965966 assert_eq ! ( invoice. min_final_cltv_expiry_delta( ) , MIN_FINAL_CLTV_EXPIRY_DELTA as u64 ) ;
966- assert_eq ! ( invoice. description( ) , Bolt11InvoiceDescription :: Direct ( & Description ( "test" . to_string( ) ) ) ) ;
967+ assert_eq ! ( invoice. description( ) , Bolt11InvoiceDescription :: Direct ( & Description ( UntrustedString ( "test" . to_string( ) ) ) ) ) ;
967968 assert_eq ! ( invoice. payment_hash( ) , & sha256:: Hash :: from_slice( & payment_hash. 0 [ ..] ) . unwrap( ) ) ;
968969 }
969970
@@ -1315,7 +1316,7 @@ mod test {
13151316 } ;
13161317
13171318 assert_eq ! ( invoice. min_final_cltv_expiry_delta( ) , MIN_FINAL_CLTV_EXPIRY_DELTA as u64 ) ;
1318- assert_eq ! ( invoice. description( ) , Bolt11InvoiceDescription :: Direct ( & Description ( "test" . to_string( ) ) ) ) ;
1319+ assert_eq ! ( invoice. description( ) , Bolt11InvoiceDescription :: Direct ( & Description ( UntrustedString ( "test" . to_string( ) ) ) ) ) ;
13191320 assert_eq ! ( invoice. route_hints( ) . len( ) , 2 ) ;
13201321 assert_eq ! ( invoice. expiry_time( ) , Duration :: from_secs( non_default_invoice_expiry_secs. into( ) ) ) ;
13211322 assert ! ( !invoice. features( ) . unwrap( ) . supports_basic_mpp( ) ) ;
0 commit comments