Add some tests of payment metadata being sent and received
[rust-lightning] / lightning / src / ln / functional_tests.rs
index a37ad2ff11febb0cdf18e1fc0d202085ac8f793d..df9b512d9383ce04422ccda0d3d07ae77800f586 100644 (file)
@@ -740,7 +740,9 @@ fn test_update_fee_that_funder_cannot_afford() {
        let commit_signed_msg = msgs::CommitmentSigned {
                channel_id: chan.2,
                signature: res.0,
-               htlc_signatures: res.1
+               htlc_signatures: res.1,
+               #[cfg(taproot)]
+               partial_signature_with_nonce: None,
        };
 
        let update_fee = msgs::UpdateFee {
@@ -1467,7 +1469,9 @@ fn test_fee_spike_violation_fails_htlc() {
        let commit_signed_msg = msgs::CommitmentSigned {
                channel_id: chan.2,
                signature: res.0,
-               htlc_signatures: res.1
+               htlc_signatures: res.1,
+               #[cfg(taproot)]
+               partial_signature_with_nonce: None,
        };
 
        // Send the commitment_signed message to the nodes[1].
@@ -1478,7 +1482,9 @@ fn test_fee_spike_violation_fails_htlc() {
        let raa_msg = msgs::RevokeAndACK {
                channel_id: chan.2,
                per_commitment_secret: local_secret,
-               next_per_commitment_point: next_local_point
+               next_per_commitment_point: next_local_point,
+               #[cfg(taproot)]
+               next_local_nonce: None,
        };
        nodes[1].node.handle_revoke_and_ack(&nodes[0].node.get_our_node_id(), &raa_msg);
 
@@ -1991,7 +1997,7 @@ fn test_channel_reserve_holding_cell_htlcs() {
        let events = nodes[2].node.get_and_clear_pending_events();
        assert_eq!(events.len(), 2);
        match events[0] {
-               Event::PaymentClaimable { ref payment_hash, ref purpose, amount_msat, receiver_node_id, via_channel_id, via_user_channel_id: _ } => {
+               Event::PaymentClaimable { ref payment_hash, ref purpose, amount_msat, receiver_node_id, via_channel_id, .. } => {
                        assert_eq!(our_payment_hash_21, *payment_hash);
                        assert_eq!(recv_value_21, amount_msat);
                        assert_eq!(nodes[2].node.get_our_node_id(), receiver_node_id.unwrap());
@@ -2007,7 +2013,7 @@ fn test_channel_reserve_holding_cell_htlcs() {
                _ => panic!("Unexpected event"),
        }
        match events[1] {
-               Event::PaymentClaimable { ref payment_hash, ref purpose, amount_msat, receiver_node_id, via_channel_id, via_user_channel_id: _ } => {
+               Event::PaymentClaimable { ref payment_hash, ref purpose, amount_msat, receiver_node_id, via_channel_id, .. } => {
                        assert_eq!(our_payment_hash_22, *payment_hash);
                        assert_eq!(recv_value_22, amount_msat);
                        assert_eq!(nodes[2].node.get_our_node_id(), receiver_node_id.unwrap());
@@ -3797,7 +3803,7 @@ fn do_test_drop_messages_peer_disconnect(messages_delivered: u8, simulate_broken
        let events_2 = nodes[1].node.get_and_clear_pending_events();
        assert_eq!(events_2.len(), 1);
        match events_2[0] {
-               Event::PaymentClaimable { ref payment_hash, ref purpose, amount_msat, receiver_node_id, via_channel_id, via_user_channel_id: _ } => {
+               Event::PaymentClaimable { ref payment_hash, ref purpose, amount_msat, receiver_node_id, via_channel_id, .. } => {
                        assert_eq!(payment_hash_1, *payment_hash);
                        assert_eq!(amount_msat, 1_000_000);
                        assert_eq!(receiver_node_id.unwrap(), nodes[1].node.get_our_node_id());
@@ -7564,7 +7570,13 @@ fn test_counterparty_raa_skip_no_crash() {
        }
 
        nodes[1].node.handle_revoke_and_ack(&nodes[0].node.get_our_node_id(),
-               &msgs::RevokeAndACK { channel_id, per_commitment_secret, next_per_commitment_point });
+               &msgs::RevokeAndACK {
+                       channel_id,
+                       per_commitment_secret,
+                       next_per_commitment_point,
+                       #[cfg(taproot)]
+                       next_local_nonce: None,
+               });
        assert_eq!(check_closed_broadcast!(nodes[1], true).unwrap().data, "Received an unexpected revoke_and_ack");
        check_added_monitors!(nodes[1], 1);
        check_closed_event!(nodes[1], 1, ClosureReason::ProcessingError { err: "Received an unexpected revoke_and_ack".to_string() });