@@ -51,7 +51,8 @@ impl MessageRouter for TestMessageRouter {
5151		Ok ( OnionMessagePath  { 
5252			intermediate_nodes :  vec ! [ ] , 
5353			destination, 
54- 			addresses :  Some ( vec ! [ SocketAddress :: TcpIpV4  {  addr:  [ 127 ,  0 ,  0 ,  1 ] ,  port:  1000  } ] ) , 
54+ 			first_node_addresses : 
55+ 				Some ( vec ! [ SocketAddress :: TcpIpV4  {  addr:  [ 127 ,  0 ,  0 ,  1 ] ,  port:  1000  } ] ) , 
5556		} ) 
5657	} 
5758} 
@@ -227,7 +228,7 @@ fn one_unblinded_hop() {
227228	let  path = OnionMessagePath  { 
228229		intermediate_nodes :  vec ! [ ] , 
229230		destination :  Destination :: Node ( nodes[ 1 ] . node_id ) , 
230- 		addresses :  None , 
231+ 		first_node_addresses :  None , 
231232	} ; 
232233	nodes[ 0 ] . messenger . send_onion_message_using_path ( path,  test_msg,  None ) . unwrap ( ) ; 
233234	nodes[ 1 ] . custom_message_handler . expect_message ( TestCustomMessage :: Response ) ; 
@@ -242,7 +243,7 @@ fn two_unblinded_hops() {
242243	let  path = OnionMessagePath  { 
243244		intermediate_nodes :  vec ! [ nodes[ 1 ] . node_id] , 
244245		destination :  Destination :: Node ( nodes[ 2 ] . node_id ) , 
245- 		addresses :  None , 
246+ 		first_node_addresses :  None , 
246247	} ; 
247248	nodes[ 0 ] . messenger . send_onion_message_using_path ( path,  test_msg,  None ) . unwrap ( ) ; 
248249	nodes[ 2 ] . custom_message_handler . expect_message ( TestCustomMessage :: Response ) ; 
@@ -259,7 +260,7 @@ fn one_blinded_hop() {
259260	let  path = OnionMessagePath  { 
260261		intermediate_nodes :  vec ! [ ] , 
261262		destination :  Destination :: BlindedPath ( blinded_path) , 
262- 		addresses :  None , 
263+ 		first_node_addresses :  None , 
263264	} ; 
264265	nodes[ 0 ] . messenger . send_onion_message_using_path ( path,  test_msg,  None ) . unwrap ( ) ; 
265266	nodes[ 1 ] . custom_message_handler . expect_message ( TestCustomMessage :: Response ) ; 
@@ -276,7 +277,7 @@ fn two_unblinded_two_blinded() {
276277	let  path = OnionMessagePath  { 
277278		intermediate_nodes :  vec ! [ nodes[ 1 ] . node_id,  nodes[ 2 ] . node_id] , 
278279		destination :  Destination :: BlindedPath ( blinded_path) , 
279- 		addresses :  None , 
280+ 		first_node_addresses :  None , 
280281	} ; 
281282
282283	nodes[ 0 ] . messenger . send_onion_message_using_path ( path,  test_msg,  None ) . unwrap ( ) ; 
@@ -294,7 +295,7 @@ fn three_blinded_hops() {
294295	let  path = OnionMessagePath  { 
295296		intermediate_nodes :  vec ! [ ] , 
296297		destination :  Destination :: BlindedPath ( blinded_path) , 
297- 		addresses :  None , 
298+ 		first_node_addresses :  None , 
298299	} ; 
299300
300301	nodes[ 0 ] . messenger . send_onion_message_using_path ( path,  test_msg,  None ) . unwrap ( ) ; 
@@ -313,7 +314,7 @@ fn too_big_packet_error() {
313314	let  path = OnionMessagePath  { 
314315		intermediate_nodes :  hops, 
315316		destination :  Destination :: Node ( hop_node_id) , 
316- 		addresses :  None , 
317+ 		first_node_addresses :  None , 
317318	} ; 
318319	let  err = nodes[ 0 ] . messenger . send_onion_message_using_path ( path,  test_msg,  None ) . unwrap_err ( ) ; 
319320	assert_eq ! ( err,  SendError :: TooBigPacket ) ; 
@@ -331,7 +332,7 @@ fn we_are_intro_node() {
331332	let  path = OnionMessagePath  { 
332333		intermediate_nodes :  vec ! [ ] , 
333334		destination :  Destination :: BlindedPath ( blinded_path) , 
334- 		addresses :  None , 
335+ 		first_node_addresses :  None , 
335336	} ; 
336337
337338	nodes[ 0 ] . messenger . send_onion_message_using_path ( path,  test_msg. clone ( ) ,  None ) . unwrap ( ) ; 
@@ -343,7 +344,7 @@ fn we_are_intro_node() {
343344	let  path = OnionMessagePath  { 
344345		intermediate_nodes :  vec ! [ ] , 
345346		destination :  Destination :: BlindedPath ( blinded_path) , 
346- 		addresses :  None , 
347+ 		first_node_addresses :  None , 
347348	} ; 
348349	nodes[ 0 ] . messenger . send_onion_message_using_path ( path,  test_msg,  None ) . unwrap ( ) ; 
349350	nodes[ 1 ] . custom_message_handler . expect_message ( TestCustomMessage :: Response ) ; 
@@ -364,7 +365,7 @@ fn invalid_blinded_path_error() {
364365	let  path = OnionMessagePath  { 
365366		intermediate_nodes :  vec ! [ ] , 
366367		destination :  Destination :: BlindedPath ( blinded_path) , 
367- 		addresses :  None , 
368+ 		first_node_addresses :  None , 
368369	} ; 
369370	let  err = nodes[ 0 ] . messenger . send_onion_message_using_path ( path,  test_msg. clone ( ) ,  None ) . unwrap_err ( ) ; 
370371	assert_eq ! ( err,  SendError :: TooFewBlindedHops ) ; 
@@ -380,7 +381,7 @@ fn reply_path() {
380381	let  path = OnionMessagePath  { 
381382		intermediate_nodes :  vec ! [ nodes[ 1 ] . node_id,  nodes[ 2 ] . node_id] , 
382383		destination :  Destination :: Node ( nodes[ 3 ] . node_id ) , 
383- 		addresses :  None , 
384+ 		first_node_addresses :  None , 
384385	} ; 
385386	let  reply_path = BlindedPath :: new_for_message ( & [ nodes[ 2 ] . node_id ,  nodes[ 1 ] . node_id ,  nodes[ 0 ] . node_id ] ,  & * nodes[ 0 ] . entropy_source ,  & secp_ctx) . unwrap ( ) ; 
386387	nodes[ 0 ] . messenger . send_onion_message_using_path ( path,  test_msg. clone ( ) ,  Some ( reply_path) ) . unwrap ( ) ; 
@@ -396,7 +397,7 @@ fn reply_path() {
396397	let  path = OnionMessagePath  { 
397398		intermediate_nodes :  vec ! [ ] , 
398399		destination :  Destination :: BlindedPath ( blinded_path) , 
399- 		addresses :  None , 
400+ 		first_node_addresses :  None , 
400401	} ; 
401402	let  reply_path = BlindedPath :: new_for_message ( & [ nodes[ 2 ] . node_id ,  nodes[ 1 ] . node_id ,  nodes[ 0 ] . node_id ] ,  & * nodes[ 0 ] . entropy_source ,  & secp_ctx) . unwrap ( ) ; 
402403
@@ -431,7 +432,7 @@ fn invalid_custom_message_type() {
431432	let  path = OnionMessagePath  { 
432433		intermediate_nodes :  vec ! [ ] , 
433434		destination :  Destination :: Node ( nodes[ 1 ] . node_id ) , 
434- 		addresses :  None , 
435+ 		first_node_addresses :  None , 
435436	} ; 
436437	let  err = nodes[ 0 ] . messenger . send_onion_message_using_path ( path,  test_msg,  None ) . unwrap_err ( ) ; 
437438	assert_eq ! ( err,  SendError :: InvalidMessage ) ; 
@@ -444,7 +445,7 @@ fn peer_buffer_full() {
444445	let  path = OnionMessagePath  { 
445446		intermediate_nodes :  vec ! [ ] , 
446447		destination :  Destination :: Node ( nodes[ 1 ] . node_id ) , 
447- 		addresses :  None , 
448+ 		first_node_addresses :  None , 
448449	} ; 
449450	for  _ in  0 ..188  {  // Based on MAX_PER_PEER_BUFFER_SIZE in OnionMessenger 
450451		nodes[ 0 ] . messenger . send_onion_message_using_path ( path. clone ( ) ,  test_msg. clone ( ) ,  None ) . unwrap ( ) ; 
@@ -469,7 +470,7 @@ fn many_hops() {
469470	let  path = OnionMessagePath  { 
470471		intermediate_nodes, 
471472		destination :  Destination :: Node ( nodes[ num_nodes-1 ] . node_id ) , 
472- 		addresses :  None , 
473+ 		first_node_addresses :  None , 
473474	} ; 
474475	nodes[ 0 ] . messenger . send_onion_message_using_path ( path,  test_msg,  None ) . unwrap ( ) ; 
475476	nodes[ num_nodes-1 ] . custom_message_handler . expect_message ( TestCustomMessage :: Response ) ; 
0 commit comments