@@ -223,7 +223,7 @@ fn two_unblinded_two_blinded() {
223
223
let test_msg = OnionMessageContents :: Custom ( TestCustomMessage :: Response ) ;
224
224
225
225
let secp_ctx = Secp256k1 :: new ( ) ;
226
- let blinded_path = BlindedPath :: new ( & [ nodes[ 3 ] . get_node_pk ( ) , nodes[ 4 ] . get_node_pk ( ) ] , & * nodes[ 4 ] . keys_manager , & secp_ctx) . unwrap ( ) ;
226
+ let blinded_path = BlindedPath :: without_id ( & [ nodes[ 3 ] . get_node_pk ( ) , nodes[ 4 ] . get_node_pk ( ) ] , & * nodes[ 4 ] . keys_manager , & secp_ctx) . unwrap ( ) ;
227
227
228
228
nodes[ 0 ] . messenger . send_onion_message ( & [ nodes[ 1 ] . get_node_pk ( ) , nodes[ 2 ] . get_node_pk ( ) ] , Destination :: BlindedPath ( blinded_path) , test_msg, None ) . unwrap ( ) ;
229
229
nodes[ 4 ] . custom_handler . expect_message ( TestCustomMessage :: Response ) ;
@@ -236,7 +236,7 @@ fn three_blinded_hops() {
236
236
let test_msg = OnionMessageContents :: Custom ( TestCustomMessage :: Response ) ;
237
237
238
238
let secp_ctx = Secp256k1 :: new ( ) ;
239
- let blinded_path = BlindedPath :: new ( & [ nodes[ 1 ] . get_node_pk ( ) , nodes[ 2 ] . get_node_pk ( ) , nodes[ 3 ] . get_node_pk ( ) ] , & * nodes[ 3 ] . keys_manager , & secp_ctx) . unwrap ( ) ;
239
+ let blinded_path = BlindedPath :: without_id ( & [ nodes[ 1 ] . get_node_pk ( ) , nodes[ 2 ] . get_node_pk ( ) , nodes[ 3 ] . get_node_pk ( ) ] , & * nodes[ 3 ] . keys_manager , & secp_ctx) . unwrap ( ) ;
240
240
241
241
nodes[ 0 ] . messenger . send_onion_message ( & [ ] , Destination :: BlindedPath ( blinded_path) , test_msg, None ) . unwrap ( ) ;
242
242
nodes[ 3 ] . custom_handler . expect_message ( TestCustomMessage :: Response ) ;
@@ -263,14 +263,14 @@ fn we_are_intro_node() {
263
263
let test_msg = TestCustomMessage :: Response ;
264
264
265
265
let secp_ctx = Secp256k1 :: new ( ) ;
266
- let blinded_path = BlindedPath :: new ( & [ nodes[ 0 ] . get_node_pk ( ) , nodes[ 1 ] . get_node_pk ( ) , nodes[ 2 ] . get_node_pk ( ) ] , & * nodes[ 2 ] . keys_manager , & secp_ctx) . unwrap ( ) ;
266
+ let blinded_path = BlindedPath :: without_id ( & [ nodes[ 0 ] . get_node_pk ( ) , nodes[ 1 ] . get_node_pk ( ) , nodes[ 2 ] . get_node_pk ( ) ] , & * nodes[ 2 ] . keys_manager , & secp_ctx) . unwrap ( ) ;
267
267
268
268
nodes[ 0 ] . messenger . send_onion_message ( & [ ] , Destination :: BlindedPath ( blinded_path) , OnionMessageContents :: Custom ( test_msg. clone ( ) ) , None ) . unwrap ( ) ;
269
269
nodes[ 2 ] . custom_handler . expect_message ( TestCustomMessage :: Response ) ;
270
270
pass_along_path ( & nodes) ;
271
271
272
272
// Try with a two-hop blinded path where we are the introduction node.
273
- let blinded_path = BlindedPath :: new ( & [ nodes[ 0 ] . get_node_pk ( ) , nodes[ 1 ] . get_node_pk ( ) ] , & * nodes[ 1 ] . keys_manager , & secp_ctx) . unwrap ( ) ;
273
+ let blinded_path = BlindedPath :: without_id ( & [ nodes[ 0 ] . get_node_pk ( ) , nodes[ 1 ] . get_node_pk ( ) ] , & * nodes[ 1 ] . keys_manager , & secp_ctx) . unwrap ( ) ;
274
274
nodes[ 0 ] . messenger . send_onion_message ( & [ ] , Destination :: BlindedPath ( blinded_path) , OnionMessageContents :: Custom ( test_msg) , None ) . unwrap ( ) ;
275
275
nodes[ 1 ] . custom_handler . expect_message ( TestCustomMessage :: Response ) ;
276
276
nodes. remove ( 2 ) ;
@@ -285,13 +285,13 @@ fn invalid_blinded_path_error() {
285
285
286
286
// 0 hops
287
287
let secp_ctx = Secp256k1 :: new ( ) ;
288
- let mut blinded_path = BlindedPath :: new ( & [ nodes[ 1 ] . get_node_pk ( ) , nodes[ 2 ] . get_node_pk ( ) ] , & * nodes[ 2 ] . keys_manager , & secp_ctx) . unwrap ( ) ;
288
+ let mut blinded_path = BlindedPath :: without_id ( & [ nodes[ 1 ] . get_node_pk ( ) , nodes[ 2 ] . get_node_pk ( ) ] , & * nodes[ 2 ] . keys_manager , & secp_ctx) . unwrap ( ) ;
289
289
blinded_path. blinded_hops . clear ( ) ;
290
290
let err = nodes[ 0 ] . messenger . send_onion_message ( & [ ] , Destination :: BlindedPath ( blinded_path) , OnionMessageContents :: Custom ( test_msg. clone ( ) ) , None ) . unwrap_err ( ) ;
291
291
assert_eq ! ( err, SendError :: TooFewBlindedHops ) ;
292
292
293
293
// 1 hop
294
- let mut blinded_path = BlindedPath :: new ( & [ nodes[ 1 ] . get_node_pk ( ) , nodes[ 2 ] . get_node_pk ( ) ] , & * nodes[ 2 ] . keys_manager , & secp_ctx) . unwrap ( ) ;
294
+ let mut blinded_path = BlindedPath :: without_id ( & [ nodes[ 1 ] . get_node_pk ( ) , nodes[ 2 ] . get_node_pk ( ) ] , & * nodes[ 2 ] . keys_manager , & secp_ctx) . unwrap ( ) ;
295
295
blinded_path. blinded_hops . remove ( 0 ) ;
296
296
assert_eq ! ( blinded_path. blinded_hops. len( ) , 1 ) ;
297
297
let err = nodes[ 0 ] . messenger . send_onion_message ( & [ ] , Destination :: BlindedPath ( blinded_path) , OnionMessageContents :: Custom ( test_msg) , None ) . unwrap_err ( ) ;
@@ -305,7 +305,7 @@ fn reply_path() {
305
305
let secp_ctx = Secp256k1 :: new ( ) ;
306
306
307
307
// Destination::Node
308
- let reply_path = BlindedPath :: new ( & [ nodes[ 2 ] . get_node_pk ( ) , nodes[ 1 ] . get_node_pk ( ) , nodes[ 0 ] . get_node_pk ( ) ] , & * nodes[ 0 ] . keys_manager , & secp_ctx) . unwrap ( ) ;
308
+ let reply_path = BlindedPath :: without_id ( & [ nodes[ 2 ] . get_node_pk ( ) , nodes[ 1 ] . get_node_pk ( ) , nodes[ 0 ] . get_node_pk ( ) ] , & * nodes[ 0 ] . keys_manager , & secp_ctx) . unwrap ( ) ;
309
309
nodes[ 0 ] . messenger . send_onion_message ( & [ nodes[ 1 ] . get_node_pk ( ) , nodes[ 2 ] . get_node_pk ( ) ] , Destination :: Node ( nodes[ 3 ] . get_node_pk ( ) ) , OnionMessageContents :: Custom ( test_msg. clone ( ) ) , Some ( reply_path) ) . unwrap ( ) ;
310
310
nodes[ 3 ] . custom_handler . expect_message ( TestCustomMessage :: Request ) ;
311
311
pass_along_path ( & nodes) ;
@@ -315,8 +315,8 @@ fn reply_path() {
315
315
pass_along_path ( & nodes) ;
316
316
317
317
// Destination::BlindedPath
318
- let blinded_path = BlindedPath :: new ( & [ nodes[ 1 ] . get_node_pk ( ) , nodes[ 2 ] . get_node_pk ( ) , nodes[ 3 ] . get_node_pk ( ) ] , & * nodes[ 3 ] . keys_manager , & secp_ctx) . unwrap ( ) ;
319
- let reply_path = BlindedPath :: new ( & [ nodes[ 2 ] . get_node_pk ( ) , nodes[ 1 ] . get_node_pk ( ) , nodes[ 0 ] . get_node_pk ( ) ] , & * nodes[ 0 ] . keys_manager , & secp_ctx) . unwrap ( ) ;
318
+ let blinded_path = BlindedPath :: without_id ( & [ nodes[ 1 ] . get_node_pk ( ) , nodes[ 2 ] . get_node_pk ( ) , nodes[ 3 ] . get_node_pk ( ) ] , & * nodes[ 3 ] . keys_manager , & secp_ctx) . unwrap ( ) ;
319
+ let reply_path = BlindedPath :: without_id ( & [ nodes[ 2 ] . get_node_pk ( ) , nodes[ 1 ] . get_node_pk ( ) , nodes[ 0 ] . get_node_pk ( ) ] , & * nodes[ 0 ] . keys_manager , & secp_ctx) . unwrap ( ) ;
320
320
321
321
nodes[ 0 ] . messenger . send_onion_message ( & [ ] , Destination :: BlindedPath ( blinded_path) , OnionMessageContents :: Custom ( test_msg) , Some ( reply_path) ) . unwrap ( ) ;
322
322
nodes[ 3 ] . custom_handler . expect_message ( TestCustomMessage :: Request ) ;
0 commit comments