@@ -147,6 +147,7 @@ struct TestCustomMessageHandler {
147
147
struct OnHandleCustomMessage {
148
148
expect : TestCustomMessage ,
149
149
include_reply_path : bool ,
150
+ custom_data : Option < Vec < u8 > > ,
150
151
}
151
152
152
153
impl TestCustomMessageHandler {
@@ -159,6 +160,7 @@ impl TestCustomMessageHandler {
159
160
OnHandleCustomMessage {
160
161
expect : message,
161
162
include_reply_path : false ,
163
+ custom_data : None ,
162
164
}
163
165
) ;
164
166
}
@@ -168,6 +170,17 @@ impl TestCustomMessageHandler {
168
170
OnHandleCustomMessage {
169
171
expect : message,
170
172
include_reply_path : true ,
173
+ custom_data : None
174
+ }
175
+ ) ;
176
+ }
177
+
178
+ fn expect_message_with_custom_data ( & self , message : TestCustomMessage , custom_data : Vec < u8 > ) {
179
+ self . expectations . lock ( ) . unwrap ( ) . push_back (
180
+ OnHandleCustomMessage {
181
+ expect : message,
182
+ include_reply_path : false ,
183
+ custom_data : Some ( custom_data) ,
171
184
}
172
185
) ;
173
186
}
@@ -191,6 +204,7 @@ impl CustomOnionMessageHandler for TestCustomMessageHandler {
191
204
fn handle_custom_message ( & self , msg : Self :: CustomMessage , context : Option < Vec < u8 > > , custom_data : Option < Vec < u8 > > , responder : Option < Responder > ) -> Option < ( Self :: CustomMessage , ResponseInstruction ) > {
192
205
let expectation = self . get_next_expectation ( ) ;
193
206
assert_eq ! ( msg, expectation. expect) ;
207
+ assert_eq ! ( custom_data, expectation. custom_data) ;
194
208
195
209
let response = match msg {
196
210
TestCustomMessage :: Ping => TestCustomMessage :: Pong ,
0 commit comments