]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Rename InboundOnionPayload::Receive::amt_msat to be more descriptive.
authorValentine Wallace <vwallace@protonmail.com>
Thu, 14 Dec 2023 20:15:41 +0000 (15:15 -0500)
committerValentine Wallace <vwallace@protonmail.com>
Wed, 10 Jan 2024 15:56:24 +0000 (10:56 -0500)
lightning/src/ln/channelmanager.rs
lightning/src/ln/msgs.rs
lightning/src/ln/onion_payment.rs

index 5fe0ad3d69445b00e6077425898628f138fd4dfd..06138dc16378696830ade79b69d781483464da2e 100644 (file)
@@ -12127,7 +12127,7 @@ mod tests {
                let sender_intended_amt_msat = 100;
                let extra_fee_msat = 10;
                let hop_data = msgs::InboundOnionPayload::Receive {
-                       amt_msat: 100,
+                       sender_intended_htlc_amt_msat: 100,
                        cltv_expiry_height: 42,
                        payment_metadata: None,
                        keysend_preimage: None,
@@ -12149,7 +12149,7 @@ mod tests {
 
                // If amt_received + extra_fee is equal to the sender intended amount, we're fine.
                let hop_data = msgs::InboundOnionPayload::Receive { // This is the same payload as above, InboundOnionPayload doesn't implement Clone
-                       amt_msat: 100,
+                       sender_intended_htlc_amt_msat: 100,
                        cltv_expiry_height: 42,
                        payment_metadata: None,
                        keysend_preimage: None,
@@ -12173,7 +12173,7 @@ mod tests {
 
                let current_height: u32 = node[0].node.best_block.read().unwrap().height();
                let result = create_recv_pending_htlc_info(msgs::InboundOnionPayload::Receive {
-                       amt_msat: 100,
+                       sender_intended_htlc_amt_msat: 100,
                        cltv_expiry_height: 22,
                        payment_metadata: None,
                        keysend_preimage: None,
index 78702a3b8ed26106b5ffa7085f6dcfcfb65e5816..2b6a9ee105db986d4cb720a24ea2edd10d0fca70 100644 (file)
@@ -1706,7 +1706,7 @@ mod fuzzy_internal_msgs {
                        payment_metadata: Option<Vec<u8>>,
                        keysend_preimage: Option<PaymentPreimage>,
                        custom_tlvs: Vec<(u64, Vec<u8>)>,
-                       amt_msat: u64,
+                       sender_intended_htlc_amt_msat: u64,
                        cltv_expiry_height: u32,
                },
                BlindedForward {
@@ -2431,7 +2431,7 @@ impl<NS: Deref> ReadableArgs<(Option<PublicKey>, &NS)> for InboundOnionPayload w
                                payment_data,
                                payment_metadata: payment_metadata.map(|w| w.0),
                                keysend_preimage,
-                               amt_msat: amt.ok_or(DecodeError::InvalidValue)?,
+                               sender_intended_htlc_amt_msat: amt.ok_or(DecodeError::InvalidValue)?,
                                cltv_expiry_height: cltv_value.ok_or(DecodeError::InvalidValue)?,
                                custom_tlvs,
                        })
@@ -4029,9 +4029,9 @@ mod tests {
                let node_signer = test_utils::TestKeysInterface::new(&[42; 32], Network::Testnet);
                let inbound_msg = ReadableArgs::read(&mut Cursor::new(&target_value[..]), (None, &&node_signer)).unwrap();
                if let msgs::InboundOnionPayload::Receive {
-                       payment_data: None, amt_msat, cltv_expiry_height, ..
+                       payment_data: None, sender_intended_htlc_amt_msat, cltv_expiry_height, ..
                } = inbound_msg {
-                       assert_eq!(amt_msat, 0x0badf00d01020304);
+                       assert_eq!(sender_intended_htlc_amt_msat, 0x0badf00d01020304);
                        assert_eq!(cltv_expiry_height, 0xffffffff);
                } else { panic!(); }
        }
@@ -4061,13 +4061,13 @@ mod tests {
                                payment_secret,
                                total_msat: 0x1badca1f
                        }),
-                       amt_msat, cltv_expiry_height,
+                       sender_intended_htlc_amt_msat, cltv_expiry_height,
                        payment_metadata: None,
                        keysend_preimage: None,
                        custom_tlvs,
                } = inbound_msg  {
                        assert_eq!(payment_secret, expected_payment_secret);
-                       assert_eq!(amt_msat, 0x0badf00d01020304);
+                       assert_eq!(sender_intended_htlc_amt_msat, 0x0badf00d01020304);
                        assert_eq!(cltv_expiry_height, 0xffffffff);
                        assert_eq!(custom_tlvs, vec![]);
                } else { panic!(); }
@@ -4131,7 +4131,7 @@ mod tests {
                        payment_metadata: None,
                        keysend_preimage: None,
                        custom_tlvs,
-                       amt_msat,
+                       sender_intended_htlc_amt_msat: amt_msat,
                        cltv_expiry_height: outgoing_cltv_value,
                        ..
                } = inbound_msg {
index cba3ef0fb3d542a8923948e8a8c110b9e26272ba..875e530337e248d49ebfee57b3ad618ff685c185 100644 (file)
@@ -126,10 +126,11 @@ pub(super) fn create_recv_pending_htlc_info(
                payment_metadata, requires_blinded_error
        ) = match hop_data {
                msgs::InboundOnionPayload::Receive {
-                       payment_data, keysend_preimage, custom_tlvs, amt_msat, cltv_expiry_height, payment_metadata, ..
+                       payment_data, keysend_preimage, custom_tlvs, sender_intended_htlc_amt_msat,
+                       cltv_expiry_height, payment_metadata, ..
                } =>
-                       (payment_data, keysend_preimage, custom_tlvs, amt_msat, cltv_expiry_height, payment_metadata,
-                        false),
+                       (payment_data, keysend_preimage, custom_tlvs, sender_intended_htlc_amt_msat,
+                        cltv_expiry_height, payment_metadata, false),
                msgs::InboundOnionPayload::BlindedReceive {
                        amt_msat, total_msat, cltv_expiry_height, payment_secret, intro_node_blinding_point,
                        payment_constraints, ..