@@ -3352,7 +3352,8 @@ mod tests {
3352
3352
3353
3353
#[ cfg( feature = "std" ) ]
3354
3354
use std:: net:: { Ipv4Addr , Ipv6Addr , SocketAddr , SocketAddrV4 , SocketAddrV6 , ToSocketAddrs } ;
3355
- use crate :: blinded_path:: { BlindedPath , Direction , IntroductionNode } ;
3355
+ use types:: features:: { BlindedHopFeatures , Bolt12InvoiceFeatures } ;
3356
+ use crate :: blinded_path:: payment:: { BlindedPayInfo , BlindedPaymentPath } ;
3356
3357
#[ cfg( feature = "std" ) ]
3357
3358
use crate :: ln:: msgs:: SocketAddressParseError ;
3358
3359
@@ -4702,21 +4703,32 @@ mod tests {
4702
4703
4703
4704
#[ test]
4704
4705
fn encoding_outbound_trampoline_payload ( ) {
4705
- let public_key = PublicKey :: from_slice ( & <Vec < u8 > >:: from_hex ( "02eec7245d6b7d2ccb30380bfbe2a3648cd7a942653f5aa340edcea1f283686619" ) . unwrap ( ) ) . unwrap ( ) ;
4706
+ let mut trampoline_features = Bolt12InvoiceFeatures :: empty ( ) ;
4707
+ trampoline_features. set_basic_mpp_optional ( ) ;
4708
+ let introduction_node = PublicKey :: from_slice ( & <Vec < u8 > >:: from_hex ( "032c0b7cf95324a07d05398b240174dc0c2be444d96b159aa6c7f7b1e668680991" ) . unwrap ( ) ) . unwrap ( ) ;
4709
+ let blinding_point = PublicKey :: from_slice ( & <Vec < u8 > >:: from_hex ( "02eec7245d6b7d2ccb30380bfbe2a3648cd7a942653f5aa340edcea1f283686619" ) . unwrap ( ) ) . unwrap ( ) ;
4706
4710
let trampoline_payload = OutboundTrampolinePayload :: BlindedForward {
4707
- amt_to_forward : 100000000 ,
4708
- outgoing_cltv_value : 800000 ,
4711
+ amt_to_forward : 150_000_000 ,
4712
+ outgoing_cltv_value : 800_000 ,
4709
4713
payment_paths : vec ! [
4710
- BlindedPath {
4711
- introduction_node: IntroductionNode :: DirectedShortChannelId ( Direction :: NodeOne , 12 ) ,
4712
- blinding_point: public_key,
4713
- blinded_hops: vec![ ] ,
4714
- }
4714
+ BlindedPaymentPath :: from_raw(
4715
+ introduction_node,
4716
+ blinding_point,
4717
+ vec![ ] ,
4718
+ BlindedPayInfo {
4719
+ fee_base_msat: 500 ,
4720
+ fee_proportional_millionths: 1_000 ,
4721
+ cltv_expiry_delta: 36 ,
4722
+ htlc_minimum_msat: 1 ,
4723
+ htlc_maximum_msat: 500_000_000 ,
4724
+ features: BlindedHopFeatures :: empty( ) ,
4725
+ }
4726
+ )
4715
4727
] ,
4716
- invoice_features : None ,
4728
+ invoice_features : Some ( trampoline_features ) ,
4717
4729
} ;
4718
4730
let serialized_payload = trampoline_payload. encode ( ) . to_lower_hex_string ( ) ;
4719
- assert_eq ! ( serialized_payload, "3c020405f5e10004030c3500fe000102362b00000000000000000c02eec7245d6b7d2ccb30380bfbe2a3648cd7a942653f5aa340edcea1f28368661900 " ) ;
4731
+ assert_eq ! ( serialized_payload, "71020408f0d18004030c35001503020000165f032c0b7cf95324a07d05398b240174dc0c2be444d96b159aa6c7f7b1e66868099102eec7245d6b7d2ccb30380bfbe2a3648cd7a942653f5aa340edcea1f28368661900000001f4000003e800240000000000000001000000001dcd65000000 " ) ;
4720
4732
}
4721
4733
4722
4734
#[ test]
0 commit comments