|
9 | 9 |
|
10 | 10 | //! Onion message testing and test utilities live here.
|
11 | 11 |
|
| 12 | +use crate::blinded_path::message::RecipientData; |
12 | 13 | use crate::blinded_path::{BlindedPath, EmptyNodeIdLookUp};
|
13 | 14 | use crate::events::{Event, EventsProvider};
|
14 | 15 | use crate::ln::features::{ChannelFeatures, InitFeatures};
|
@@ -73,7 +74,7 @@ impl Drop for MessengerNode {
|
73 | 74 | struct TestOffersMessageHandler {}
|
74 | 75 |
|
75 | 76 | impl OffersMessageHandler for TestOffersMessageHandler {
|
76 |
| - fn handle_message(&self, _message: OffersMessage, _responder: Option<Responder>) -> ResponseInstruction<OffersMessage> { |
| 77 | + fn handle_message(&self, _message: OffersMessage, _responder: Option<Responder>, _recipient_data: RecipientData) -> ResponseInstruction<OffersMessage> { |
77 | 78 | ResponseInstruction::NoResponse
|
78 | 79 | }
|
79 | 80 | }
|
@@ -160,7 +161,7 @@ impl Drop for TestCustomMessageHandler {
|
160 | 161 |
|
161 | 162 | impl CustomOnionMessageHandler for TestCustomMessageHandler {
|
162 | 163 | type CustomMessage = TestCustomMessage;
|
163 |
| - fn handle_custom_message(&self, msg: Self::CustomMessage, responder: Option<Responder>) -> ResponseInstruction<Self::CustomMessage> { |
| 164 | + fn handle_custom_message(&self, msg: Self::CustomMessage, responder: Option<Responder>, _recipient_data: RecipientData) -> ResponseInstruction<Self::CustomMessage> { |
164 | 165 | let expectation = self.get_next_expectation();
|
165 | 166 | assert_eq!(msg, expectation.expect);
|
166 | 167 |
|
@@ -418,7 +419,7 @@ fn async_response_over_one_blinded_hop() {
|
418 | 419 |
|
419 | 420 | // 5. Expect Alice to receive the message and create a response instruction for it.
|
420 | 421 | alice.custom_message_handler.expect_message(message.clone());
|
421 |
| - let response_instruction = nodes[0].custom_message_handler.handle_custom_message(message, responder); |
| 422 | + let response_instruction = nodes[0].custom_message_handler.handle_custom_message(message, responder, RecipientData::new()); |
422 | 423 |
|
423 | 424 | // 6. Simulate Alice asynchronously responding back to Bob with a response.
|
424 | 425 | assert_eq!(
|
@@ -452,7 +453,7 @@ fn async_response_with_reply_path_succeeds() {
|
452 | 453 | // Alice asynchronously responds to Bob, expecting a response back from him.
|
453 | 454 | let responder = Responder::new(reply_path, path_id);
|
454 | 455 | alice.custom_message_handler.expect_message_and_response(message.clone());
|
455 |
| - let response_instruction = alice.custom_message_handler.handle_custom_message(message, Some(responder)); |
| 456 | + let response_instruction = alice.custom_message_handler.handle_custom_message(message, Some(responder), RecipientData::new()); |
456 | 457 |
|
457 | 458 | assert_eq!(
|
458 | 459 | alice.messenger.handle_onion_message_response(response_instruction),
|
@@ -490,7 +491,7 @@ fn async_response_with_reply_path_fails() {
|
490 | 491 | // Therefore, the reply_path cannot be used for the response.
|
491 | 492 | let responder = Responder::new(reply_path, path_id);
|
492 | 493 | alice.custom_message_handler.expect_message_and_response(message.clone());
|
493 |
| - let response_instruction = alice.custom_message_handler.handle_custom_message(message, Some(responder)); |
| 494 | + let response_instruction = alice.custom_message_handler.handle_custom_message(message, Some(responder), RecipientData::new()); |
494 | 495 |
|
495 | 496 | assert_eq!(
|
496 | 497 | alice.messenger.handle_onion_message_response(response_instruction),
|
|
0 commit comments