From 9708a42ce2c53acebc55c58f366c5fa7041acbe9 Mon Sep 17 00:00:00 2001 From: Roman Dmitrienko Date: Fri, 1 Mar 2024 21:26:16 +0100 Subject: [PATCH] Add custom TLVs to the test. --- tests/common.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/common.rs b/tests/common.rs index 3696f9b71..50bc436ed 100644 --- a/tests/common.rs +++ b/tests/common.rs @@ -3,7 +3,7 @@ use ldk_node::io::sqlite_store::SqliteStore; use ldk_node::{ - Builder, Config, Event, LogLevel, Node, NodeError, PaymentDirection, PaymentStatus, + Builder, Config, Event, LogLevel, Node, NodeError, PaymentDirection, PaymentStatus, TlvEntry, }; use lightning::ln::msgs::SocketAddress; @@ -490,8 +490,11 @@ pub(crate) fn do_channel_full_cycle( // Test spontaneous/keysend payments println!("\nA send_spontaneous_payment"); let keysend_amount_msat = 2500_000; - let keysend_payment_hash = - node_a.send_spontaneous_payment(keysend_amount_msat, node_b.node_id()).unwrap(); + let tlv1 = TlvEntry { r#type: 131073, value: vec![0x00, 0x11, 0x22, 0x33] }; + let tlv2 = TlvEntry { r#type: 131075, value: vec![0xaa, 0xbb] }; + let keysend_payment_hash = node_a + .send_spontaneous_payment(keysend_amount_msat, node_b.node_id(), vec![tlv1, tlv2]) + .unwrap(); expect_event!(node_a, PaymentSuccessful); let received_keysend_amount = match node_b.wait_next_event() { ref e @ Event::PaymentReceived { amount_msat, .. } => {