You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update send_onion_message API to take new OnionMessageContents enum
OnionMessageContents specifies the data TLV that the sender wants in the onion
message. This enum only has one variant for now, Custom. When offers are added,
additional variants for invoice, invoice_request, and invoice_error will be
added.
This commit does not actually implement sending the custom OM contents, just
the API change.
let err = nodes[0].messenger.send_onion_message(&[],Destination::BlindedRoute(blinded_route),None).unwrap_err();
183
+
let err = nodes[0].messenger.send_onion_message(&[],Destination::BlindedRoute(blinded_route),OnionMessageContents::Custom(test_msg.clone()),None).unwrap_err();
let err = nodes[0].messenger.send_onion_message(&[],Destination::BlindedRoute(blinded_route),None).unwrap_err();
190
+
let err = nodes[0].messenger.send_onion_message(&[],Destination::BlindedRoute(blinded_route),OnionMessageContents::Custom(test_msg),None).unwrap_err();
185
191
assert_eq!(err,SendError::TooFewBlindedHops);
186
192
}
187
193
188
194
#[test]
189
195
fnreply_path(){
190
196
let nodes = create_nodes(4);
197
+
let test_msg = TestCustomMessage{};
191
198
let secp_ctx = Secp256k1::new();
192
199
193
200
// Destination::Node
194
201
let reply_path = BlindedRoute::new(&[nodes[2].get_node_pk(), nodes[1].get_node_pk(), nodes[0].get_node_pk()],&*nodes[0].keys_manager,&secp_ctx).unwrap();
let err = nodes[0].messenger.send_onion_message(&[],Destination::Node(nodes[1].get_node_pk()),None).unwrap_err();
227
+
let err = nodes[0].messenger.send_onion_message(&[],Destination::Node(nodes[1].get_node_pk()),OnionMessageContents::Custom(test_msg),None).unwrap_err();
0 commit comments