Merge pull request #2128 from valentinewallace/2023-03-route-blinding-groundwork
[rust-lightning] / lightning / src / ln / functional_tests.rs
index 0f7f4bfbdcb3a6e24c371c0f55472c2152f14760..546c23247aaa45e18bc1c269f179004ebb432bdf 100644 (file)
@@ -8067,7 +8067,9 @@ fn test_onion_value_mpp_set_calculation() {
                                RecipientOnionFields::secret_only(our_payment_secret), height + 1, &None).unwrap();
                        // Edit amt_to_forward to simulate the sender having set
                        // the final amount and the routing node taking less fee
-                       onion_payloads[1].amt_to_forward = 99_000;
+                       if let msgs::OutboundOnionPayload::Receive { ref mut amt_msat, .. } = onion_payloads[1] {
+                               *amt_msat = 99_000;
+                       } else { panic!() }
                        let new_onion_packet = onion_utils::construct_onion_packet(onion_payloads, onion_keys, [0; 32], &our_payment_hash).unwrap();
                        payment_event.msgs[0].onion_routing_packet = new_onion_packet;
                }