@@ -158,7 +158,7 @@ where
158
158
159
159
let invoice = match description {
160
160
Bolt11InvoiceDescription :: Direct ( description) => {
161
- InvoiceBuilder :: new ( network) . description ( description. 0 . clone ( ) )
161
+ InvoiceBuilder :: new ( network) . description ( description. 0 . 0 . clone ( ) )
162
162
}
163
163
Bolt11InvoiceDescription :: Hash ( hash) => InvoiceBuilder :: new ( network) . description_hash ( hash. 0 ) ,
164
164
} ;
@@ -538,7 +538,7 @@ fn _create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_has
538
538
539
539
let invoice = match description {
540
540
Bolt11InvoiceDescription :: Direct ( description) => {
541
- InvoiceBuilder :: new ( network) . description ( description. 0 . clone ( ) )
541
+ InvoiceBuilder :: new ( network) . description ( description. 0 . 0 . clone ( ) )
542
542
}
543
543
Bolt11InvoiceDescription :: Hash ( hash) => InvoiceBuilder :: new ( network) . description_hash ( hash. 0 ) ,
544
544
} ;
@@ -808,6 +808,7 @@ mod test {
808
808
use lightning:: util:: config:: UserConfig ;
809
809
use crate :: utils:: { create_invoice_from_channelmanager_and_duration_since_epoch, rotate_through_iterators} ;
810
810
use std:: collections:: HashSet ;
811
+ use lightning:: util:: string:: UntrustedString ;
811
812
812
813
#[ test]
813
814
fn test_prefer_current_channel ( ) {
@@ -852,7 +853,7 @@ mod test {
852
853
assert_eq ! ( invoice. amount_pico_btc( ) , Some ( 100_000 ) ) ;
853
854
// If no `min_final_cltv_expiry_delta` is specified, then it should be `MIN_FINAL_CLTV_EXPIRY_DELTA`.
854
855
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( ) ) ) ) ) ;
856
857
assert_eq ! ( invoice. expiry_time( ) , Duration :: from_secs( non_default_invoice_expiry_secs. into( ) ) ) ;
857
858
858
859
// Invoice SCIDs should always use inbound SCID aliases over the real channel ID, if one is
@@ -963,7 +964,7 @@ mod test {
963
964
) . unwrap ( ) ;
964
965
assert_eq ! ( invoice. amount_pico_btc( ) , Some ( 100_000 ) ) ;
965
966
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( ) ) ) ) ) ;
967
968
assert_eq ! ( invoice. payment_hash( ) , & sha256:: Hash :: from_slice( & payment_hash. 0 [ ..] ) . unwrap( ) ) ;
968
969
}
969
970
@@ -1315,7 +1316,7 @@ mod test {
1315
1316
} ;
1316
1317
1317
1318
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( ) ) ) ) ) ;
1319
1320
assert_eq ! ( invoice. route_hints( ) . len( ) , 2 ) ;
1320
1321
assert_eq ! ( invoice. expiry_time( ) , Duration :: from_secs( non_default_invoice_expiry_secs. into( ) ) ) ;
1321
1322
assert ! ( !invoice. features( ) . unwrap( ) . supports_basic_mpp( ) ) ;
0 commit comments