@@ -424,6 +424,34 @@ fn one_blinded_hop() {
424
424
pass_along_path ( & nodes) ;
425
425
}
426
426
427
+ #[ test]
428
+ fn blinded_path_with_dummy ( ) {
429
+ let nodes = create_nodes ( 2 ) ;
430
+ let test_msg = TestCustomMessage :: Pong ;
431
+
432
+ let secp_ctx = Secp256k1 :: new ( ) ;
433
+ let context = MessageContext :: Custom ( Vec :: new ( ) ) ;
434
+ let entropy = & * nodes[ 1 ] . entropy_source ;
435
+ let expanded_key = ExpandedKey :: new ( [ 42 ; 32 ] ) ;
436
+ let blinded_path = BlindedMessagePath :: new_with_dummy_hops (
437
+ & [ ] ,
438
+ 5 ,
439
+ nodes[ 1 ] . node_id ,
440
+ context,
441
+ entropy,
442
+ expanded_key,
443
+ & secp_ctx,
444
+ )
445
+ . unwrap ( ) ;
446
+ // Make sure that dummy hops are do added to the blinded path.
447
+ assert_eq ! ( blinded_path. blinded_hops( ) . len( ) , 6 ) ;
448
+ let destination = Destination :: BlindedPath ( blinded_path) ;
449
+ let instructions = MessageSendInstructions :: WithoutReplyPath { destination } ;
450
+ nodes[ 0 ] . messenger . send_onion_message ( test_msg, instructions) . unwrap ( ) ;
451
+ nodes[ 1 ] . custom_message_handler . expect_message ( TestCustomMessage :: Pong ) ;
452
+ pass_along_path ( & nodes) ;
453
+ }
454
+
427
455
#[ test]
428
456
fn two_unblinded_two_blinded ( ) {
429
457
let nodes = create_nodes ( 5 ) ;
@@ -648,8 +676,9 @@ fn test_blinded_path_padding_for_full_length_path() {
648
676
// Update the context to create a larger final receive TLVs, ensuring that
649
677
// the hop sizes vary before padding.
650
678
let context = MessageContext :: Custom ( vec ! [ 0u8 ; 42 ] ) ;
651
- let blinded_path = BlindedMessagePath :: new (
679
+ let blinded_path = BlindedMessagePath :: new_with_dummy_hops (
652
680
& intermediate_nodes,
681
+ 5 ,
653
682
nodes[ 3 ] . node_id ,
654
683
context,
655
684
& * nodes[ 3 ] . entropy_source ,
@@ -683,8 +712,9 @@ fn test_blinded_path_no_padding_for_compact_path() {
683
712
// Update the context to create a larger final receive TLVs, ensuring that
684
713
// the hop sizes vary before padding.
685
714
let context = MessageContext :: Custom ( vec ! [ 0u8 ; 42 ] ) ;
686
- let blinded_path = BlindedMessagePath :: new (
715
+ let blinded_path = BlindedMessagePath :: new_with_dummy_hops (
687
716
& intermediate_nodes,
717
+ 5 ,
688
718
nodes[ 3 ] . node_id ,
689
719
context,
690
720
& * nodes[ 3 ] . entropy_source ,
0 commit comments