Skip to content

Commit 1a26852

Browse files
committed
Drop the amount parameter to claim_funds
Like the payment_secret parameter, this paramter has been the source of much confusion, so we just drop it. Users should prefer to do this check when registering the payment secret instead of at claim-time.
1 parent abe26d6 commit 1a26852

File tree

10 files changed

+183
-173
lines changed

10 files changed

+183
-173
lines changed

fuzz/src/chanmon_consistency.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -687,12 +687,12 @@ pub fn do_test<Out: test_logger::Output>(data: &[u8], out: Out) {
687687
let had_events = !events.is_empty();
688688
for event in events.drain(..) {
689689
match event {
690-
events::Event::PaymentReceived { payment_hash, payment_secret: _, amt, user_payment_id: _ } => {
690+
events::Event::PaymentReceived { payment_hash, .. } => {
691691
if claim_set.insert(payment_hash.0) {
692692
if $fail {
693693
assert!(nodes[$node].fail_htlc_backwards(&payment_hash));
694694
} else {
695-
assert!(nodes[$node].claim_funds(PaymentPreimage(payment_hash.0), amt));
695+
assert!(nodes[$node].claim_funds(PaymentPreimage(payment_hash.0)));
696696
}
697697
}
698698
},

fuzz/src/full_stack.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ pub fn do_test(data: &[u8], logger: &Arc<dyn Logger>) {
371371
}, our_network_key, &[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0], Arc::clone(&logger)));
372372

373373
let mut should_forward = false;
374-
let mut payments_received: Vec<(PaymentHash, u64)> = Vec::new();
374+
let mut payments_received: Vec<PaymentHash> = Vec::new();
375375
let mut payments_sent = 0;
376376
let mut pending_funding_generation: Vec<([u8; 32], u64, Script)> = Vec::new();
377377
let mut pending_funding_signatures = HashMap::new();
@@ -476,7 +476,7 @@ pub fn do_test(data: &[u8], logger: &Arc<dyn Logger>) {
476476
}
477477
},
478478
8 => {
479-
for (payment, amt) in payments_received.drain(..) {
479+
for payment in payments_received.drain(..) {
480480
// SHA256 is defined as XOR of all input bytes placed in the first byte, and 0s
481481
// for the remaining bytes. Thus, if not all remaining bytes are 0s we cannot
482482
// fulfill this HTLC, but if they are, we can just take the first byte and
@@ -486,12 +486,12 @@ pub fn do_test(data: &[u8], logger: &Arc<dyn Logger>) {
486486
} else {
487487
let mut payment_preimage = PaymentPreimage([0; 32]);
488488
payment_preimage.0[0] = payment.0[0];
489-
channelmanager.claim_funds(payment_preimage, amt);
489+
channelmanager.claim_funds(payment_preimage);
490490
}
491491
}
492492
},
493493
9 => {
494-
for (payment, _) in payments_received.drain(..) {
494+
for payment in payments_received.drain(..) {
495495
channelmanager.fail_htlc_backwards(&payment);
496496
}
497497
},
@@ -571,9 +571,9 @@ pub fn do_test(data: &[u8], logger: &Arc<dyn Logger>) {
571571
Event::FundingGenerationReady { temporary_channel_id, channel_value_satoshis, output_script, .. } => {
572572
pending_funding_generation.push((temporary_channel_id, channel_value_satoshis, output_script));
573573
},
574-
Event::PaymentReceived { payment_hash, payment_secret: _, amt, user_payment_id: _ } => {
574+
Event::PaymentReceived { payment_hash, .. } => {
575575
//TODO: enhance by fetching random amounts from fuzz input?
576-
payments_received.push((payment_hash, amt));
576+
payments_received.push(payment_hash);
577577
},
578578
Event::PaymentSent {..} => {},
579579
Event::PaymentFailed {..} => {},

lightning-persister/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,9 +251,9 @@ mod tests {
251251
check_persisted_data!(0);
252252

253253
// Send a few payments and make sure the monitors are updated to the latest.
254-
send_payment(&nodes[0], &vec!(&nodes[1])[..], 8000000, 8_000_000);
254+
send_payment(&nodes[0], &vec!(&nodes[1])[..], 8000000);
255255
check_persisted_data!(5);
256-
send_payment(&nodes[1], &vec!(&nodes[0])[..], 4000000, 4_000_000);
256+
send_payment(&nodes[1], &vec!(&nodes[0])[..], 4000000);
257257
check_persisted_data!(10);
258258

259259
// Force close because cooperative close doesn't result in any persisted

lightning/src/chain/chainmonitor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ mod tests {
344344
let (commitment_tx, htlc_tx) = {
345345
let payment_preimage = route_payment(&nodes[0], &vec!(&nodes[1])[..], 5_000_000).0;
346346
let mut txn = get_local_commitment_txn!(nodes[0], channel.2);
347-
claim_payment(&nodes[0], &vec!(&nodes[1])[..], payment_preimage, 5_000_000);
347+
claim_payment(&nodes[0], &vec!(&nodes[1])[..], payment_preimage);
348348

349349
assert_eq!(txn.len(), 2);
350350
(txn.remove(0), txn.remove(0))

lightning/src/ln/chanmon_update_fail_tests.rs

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ fn test_monitor_and_persister_update_fail() {
9090
let outpoint = OutPoint { txid: chan.3.txid(), index: 0 };
9191

9292
// Rebalance the network to generate htlc in the two directions
93-
send_payment(&nodes[0], &vec!(&nodes[1])[..], 10_000_000, 10_000_000);
93+
send_payment(&nodes[0], &vec!(&nodes[1])[..], 10_000_000);
9494

9595
// Route an HTLC from node 0 to node 1 (but don't settle)
9696
let preimage = route_payment(&nodes[0], &vec!(&nodes[1])[..], 9_000_000).0;
@@ -121,7 +121,7 @@ fn test_monitor_and_persister_update_fail() {
121121
persister.set_update_ret(Err(ChannelMonitorUpdateErr::TemporaryFailure));
122122

123123
// Try to update ChannelMonitor
124-
assert!(nodes[1].node.claim_funds(preimage, 9_000_000));
124+
assert!(nodes[1].node.claim_funds(preimage));
125125
check_added_monitors!(nodes[1], 1);
126126
let updates = get_htlc_update_msgs!(nodes[1], nodes[0].node.get_our_node_id());
127127
assert_eq!(updates.update_fulfill_htlcs.len(), 1);
@@ -214,7 +214,7 @@ fn do_test_simple_monitor_temporary_update_fail(disconnect: bool, persister_fail
214214
_ => panic!("Unexpected event"),
215215
}
216216

217-
claim_payment(&nodes[0], &[&nodes[1]], payment_preimage_1, 1_000_000);
217+
claim_payment(&nodes[0], &[&nodes[1]], payment_preimage_1);
218218

219219
// Now set it to failed again...
220220
let (_, payment_hash_2, payment_secret_2) = get_payment_preimage_hash!(&nodes[1]);
@@ -305,7 +305,7 @@ fn do_test_monitor_temporary_update_fail(disconnect_count: usize) {
305305

306306
// Claim the previous payment, which will result in a update_fulfill_htlc/CS from nodes[1]
307307
// but nodes[0] won't respond since it is frozen.
308-
assert!(nodes[1].node.claim_funds(payment_preimage_1, 1_000_000));
308+
assert!(nodes[1].node.claim_funds(payment_preimage_1));
309309
check_added_monitors!(nodes[1], 1);
310310
let events_2 = nodes[1].node.get_and_clear_pending_msg_events();
311311
assert_eq!(events_2.len(), 1);
@@ -582,7 +582,7 @@ fn do_test_monitor_temporary_update_fail(disconnect_count: usize) {
582582
_ => panic!("Unexpected event"),
583583
}
584584

585-
claim_payment(&nodes[0], &[&nodes[1]], payment_preimage_2, 1_000_000);
585+
claim_payment(&nodes[0], &[&nodes[1]], payment_preimage_2);
586586
}
587587

588588
#[test]
@@ -696,7 +696,7 @@ fn test_monitor_update_fail_cs() {
696696
_ => panic!("Unexpected event"),
697697
};
698698

699-
claim_payment(&nodes[0], &[&nodes[1]], payment_preimage, 1_000_000);
699+
claim_payment(&nodes[0], &[&nodes[1]], payment_preimage);
700700
}
701701

702702
#[test]
@@ -747,7 +747,7 @@ fn test_monitor_update_fail_no_rebroadcast() {
747747
_ => panic!("Unexpected event"),
748748
}
749749

750-
claim_payment(&nodes[0], &[&nodes[1]], payment_preimage_1, 1_000_000);
750+
claim_payment(&nodes[0], &[&nodes[1]], payment_preimage_1);
751751
}
752752

753753
#[test]
@@ -761,7 +761,7 @@ fn test_monitor_update_raa_while_paused() {
761761
let channel_id = create_announced_chan_between_nodes(&nodes, 0, 1, InitFeatures::known(), InitFeatures::known()).2;
762762
let logger = test_utils::TestLogger::new();
763763

764-
send_payment(&nodes[0], &[&nodes[1]], 5000000, 5_000_000);
764+
send_payment(&nodes[0], &[&nodes[1]], 5000000);
765765
let (payment_preimage_1, our_payment_hash_1, our_payment_secret_1) = get_payment_preimage_hash!(nodes[1]);
766766
{
767767
let net_graph_msg_handler = &nodes[0].net_graph_msg_handler;
@@ -825,8 +825,8 @@ fn test_monitor_update_raa_while_paused() {
825825
expect_pending_htlcs_forwardable!(nodes[1]);
826826
expect_payment_received!(nodes[1], our_payment_hash_1, our_payment_secret_1, 1000000);
827827

828-
claim_payment(&nodes[0], &[&nodes[1]], payment_preimage_1, 1_000_000);
829-
claim_payment(&nodes[1], &[&nodes[0]], payment_preimage_2, 1_000_000);
828+
claim_payment(&nodes[0], &[&nodes[1]], payment_preimage_1);
829+
claim_payment(&nodes[1], &[&nodes[0]], payment_preimage_2);
830830
}
831831

832832
fn do_test_monitor_update_fail_raa(test_ignore_second_cs: bool) {
@@ -840,7 +840,7 @@ fn do_test_monitor_update_fail_raa(test_ignore_second_cs: bool) {
840840
let logger = test_utils::TestLogger::new();
841841

842842
// Rebalance a bit so that we can send backwards from 2 to 1.
843-
send_payment(&nodes[0], &[&nodes[1], &nodes[2]], 5000000, 5_000_000);
843+
send_payment(&nodes[0], &[&nodes[1], &nodes[2]], 5000000);
844844

845845
// Route a first payment that we'll fail backwards
846846
let (_, payment_hash_1, _) = route_payment(&nodes[0], &[&nodes[1], &nodes[2]], 1000000);
@@ -1079,10 +1079,10 @@ fn do_test_monitor_update_fail_raa(test_ignore_second_cs: bool) {
10791079
Event::PaymentReceived { payment_hash, .. } => assert_eq!(payment_hash, payment_hash_4.unwrap()),
10801080
_ => panic!("Unexpected event"),
10811081
};
1082-
claim_payment(&nodes[2], &[&nodes[1], &nodes[0]], payment_preimage_4.unwrap(), 1_000_000);
1082+
claim_payment(&nodes[2], &[&nodes[1], &nodes[0]], payment_preimage_4.unwrap());
10831083
}
10841084

1085-
claim_payment(&nodes[0], &[&nodes[1], &nodes[2]], payment_preimage_2, 1_000_000);
1085+
claim_payment(&nodes[0], &[&nodes[1], &nodes[2]], payment_preimage_2);
10861086
}
10871087

10881088
#[test]
@@ -1108,7 +1108,7 @@ fn test_monitor_update_fail_reestablish() {
11081108
nodes[1].node.peer_disconnected(&nodes[0].node.get_our_node_id(), false);
11091109
nodes[0].node.peer_disconnected(&nodes[1].node.get_our_node_id(), false);
11101110

1111-
assert!(nodes[2].node.claim_funds(our_payment_preimage, 1_000_000));
1111+
assert!(nodes[2].node.claim_funds(our_payment_preimage));
11121112
check_added_monitors!(nodes[2], 1);
11131113
let mut updates = get_htlc_update_msgs!(nodes[2], nodes[1].node.get_our_node_id());
11141114
assert!(updates.update_add_htlcs.is_empty());
@@ -1289,9 +1289,9 @@ fn raa_no_response_awaiting_raa_state() {
12891289
expect_pending_htlcs_forwardable!(nodes[1]);
12901290
expect_payment_received!(nodes[1], payment_hash_3, payment_secret_3, 1000000);
12911291

1292-
claim_payment(&nodes[0], &[&nodes[1]], payment_preimage_1, 1_000_000);
1293-
claim_payment(&nodes[0], &[&nodes[1]], payment_preimage_2, 1_000_000);
1294-
claim_payment(&nodes[0], &[&nodes[1]], payment_preimage_3, 1_000_000);
1292+
claim_payment(&nodes[0], &[&nodes[1]], payment_preimage_1);
1293+
claim_payment(&nodes[0], &[&nodes[1]], payment_preimage_2);
1294+
claim_payment(&nodes[0], &[&nodes[1]], payment_preimage_3);
12951295
}
12961296

12971297
#[test]
@@ -1315,7 +1315,7 @@ fn claim_while_disconnected_monitor_update_fail() {
13151315
nodes[0].node.peer_disconnected(&nodes[1].node.get_our_node_id(), false);
13161316
nodes[1].node.peer_disconnected(&nodes[0].node.get_our_node_id(), false);
13171317

1318-
assert!(nodes[1].node.claim_funds(payment_preimage_1, 1_000_000));
1318+
assert!(nodes[1].node.claim_funds(payment_preimage_1));
13191319
check_added_monitors!(nodes[1], 1);
13201320

13211321
nodes[0].node.peer_connected(&nodes[1].node.get_our_node_id(), &msgs::Init { features: InitFeatures::empty() });
@@ -1417,7 +1417,7 @@ fn claim_while_disconnected_monitor_update_fail() {
14171417
_ => panic!("Unexpected event"),
14181418
}
14191419

1420-
claim_payment(&nodes[0], &[&nodes[1]], payment_preimage_2, 1_000_000);
1420+
claim_payment(&nodes[0], &[&nodes[1]], payment_preimage_2);
14211421
}
14221422

14231423
#[test]
@@ -1485,7 +1485,7 @@ fn monitor_failed_no_reestablish_response() {
14851485
expect_pending_htlcs_forwardable!(nodes[1]);
14861486
expect_payment_received!(nodes[1], payment_hash_1, payment_secret_1, 1000000);
14871487

1488-
claim_payment(&nodes[0], &[&nodes[1]], payment_preimage_1, 1_000_000);
1488+
claim_payment(&nodes[0], &[&nodes[1]], payment_preimage_1);
14891489
}
14901490

14911491
#[test]
@@ -1586,8 +1586,8 @@ fn first_message_on_recv_ordering() {
15861586
expect_pending_htlcs_forwardable!(nodes[1]);
15871587
expect_payment_received!(nodes[1], payment_hash_2, payment_secret_2, 1000000);
15881588

1589-
claim_payment(&nodes[0], &[&nodes[1]], payment_preimage_1, 1_000_000);
1590-
claim_payment(&nodes[0], &[&nodes[1]], payment_preimage_2, 1_000_000);
1589+
claim_payment(&nodes[0], &[&nodes[1]], payment_preimage_1);
1590+
claim_payment(&nodes[0], &[&nodes[1]], payment_preimage_2);
15911591
}
15921592

15931593
#[test]
@@ -1606,12 +1606,12 @@ fn test_monitor_update_fail_claim() {
16061606
let logger = test_utils::TestLogger::new();
16071607

16081608
// Rebalance a bit so that we can send backwards from 3 to 2.
1609-
send_payment(&nodes[0], &[&nodes[1], &nodes[2]], 5000000, 5_000_000);
1609+
send_payment(&nodes[0], &[&nodes[1], &nodes[2]], 5000000);
16101610

16111611
let (payment_preimage_1, _, _) = route_payment(&nodes[0], &[&nodes[1]], 1000000);
16121612

16131613
*nodes[1].chain_monitor.update_ret.lock().unwrap() = Some(Err(ChannelMonitorUpdateErr::TemporaryFailure));
1614-
assert!(nodes[1].node.claim_funds(payment_preimage_1, 1_000_000));
1614+
assert!(nodes[1].node.claim_funds(payment_preimage_1));
16151615
check_added_monitors!(nodes[1], 1);
16161616

16171617
let (_, payment_hash_2, payment_secret_2) = get_payment_preimage_hash!(nodes[0]);
@@ -1687,7 +1687,7 @@ fn test_monitor_update_on_pending_forwards() {
16871687
let logger = test_utils::TestLogger::new();
16881688

16891689
// Rebalance a bit so that we can send backwards from 3 to 1.
1690-
send_payment(&nodes[0], &[&nodes[1], &nodes[2]], 5000000, 5_000_000);
1690+
send_payment(&nodes[0], &[&nodes[1], &nodes[2]], 5000000);
16911691

16921692
let (_, payment_hash_1, _) = route_payment(&nodes[0], &[&nodes[1], &nodes[2]], 1000000);
16931693
assert!(nodes[2].node.fail_htlc_backwards(&payment_hash_1));
@@ -1742,7 +1742,7 @@ fn test_monitor_update_on_pending_forwards() {
17421742
nodes[0].node.process_pending_htlc_forwards();
17431743
expect_payment_received!(nodes[0], payment_hash_2, payment_secret_2, 1000000);
17441744

1745-
claim_payment(&nodes[2], &[&nodes[1], &nodes[0]], payment_preimage_2, 1_000_000);
1745+
claim_payment(&nodes[2], &[&nodes[1], &nodes[0]], payment_preimage_2);
17461746
}
17471747

17481748
#[test]
@@ -1777,7 +1777,7 @@ fn monitor_update_claim_fail_no_response() {
17771777
let as_raa = commitment_signed_dance!(nodes[1], nodes[0], payment_event.commitment_msg, false, true, false, true);
17781778

17791779
*nodes[1].chain_monitor.update_ret.lock().unwrap() = Some(Err(ChannelMonitorUpdateErr::TemporaryFailure));
1780-
assert!(nodes[1].node.claim_funds(payment_preimage_1, 1_000_000));
1780+
assert!(nodes[1].node.claim_funds(payment_preimage_1));
17811781
check_added_monitors!(nodes[1], 1);
17821782
let events = nodes[1].node.get_and_clear_pending_msg_events();
17831783
assert_eq!(events.len(), 0);
@@ -1807,7 +1807,7 @@ fn monitor_update_claim_fail_no_response() {
18071807
_ => panic!("Unexpected event"),
18081808
}
18091809

1810-
claim_payment(&nodes[0], &[&nodes[1]], payment_preimage_2, 1_000_000);
1810+
claim_payment(&nodes[0], &[&nodes[1]], payment_preimage_2);
18111811
}
18121812

18131813
// confirm_a_first and restore_b_before_conf are wholly unrelated to earlier bools and
@@ -1897,7 +1897,7 @@ fn do_during_funding_monitor_fail(confirm_a_first: bool, restore_b_before_conf:
18971897
node.net_graph_msg_handler.handle_channel_update(&bs_update).unwrap();
18981898
}
18991899

1900-
send_payment(&nodes[0], &[&nodes[1]], 8000000, 8_000_000);
1900+
send_payment(&nodes[0], &[&nodes[1]], 8000000);
19011901
close_channel(&nodes[0], &nodes[1], &channel_id, funding_tx, true);
19021902
}
19031903

@@ -1965,5 +1965,5 @@ fn test_path_paused_mpp() {
19651965
assert_eq!(events.len(), 1);
19661966
pass_along_path(&nodes[0], &[&nodes[2], &nodes[3]], 200_000, payment_hash.clone(), payment_secret, events.pop().unwrap(), true);
19671967

1968-
claim_payment_along_route(&nodes[0], &[&[&nodes[1], &nodes[3]], &[&nodes[2], &nodes[3]]], false, payment_preimage, 200_000);
1968+
claim_payment_along_route(&nodes[0], &[&[&nodes[1], &nodes[3]], &[&nodes[2], &nodes[3]]], false, payment_preimage);
19691969
}

lightning/src/ln/channelmanager.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2289,7 +2289,7 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
22892289
///
22902290
/// [`get_payment_secret`]: Self::get_payment_secret
22912291
/// [`get_payment_secret_preimage`]: Self::get_payment_secret_preimage
2292-
pub fn claim_funds(&self, payment_preimage: PaymentPreimage, expected_amount: u64) -> bool {
2292+
pub fn claim_funds(&self, payment_preimage: PaymentPreimage) -> bool {
22932293
let payment_hash = PaymentHash(Sha256::hash(&payment_preimage.0).into_inner());
22942294

22952295
let _persistence_guard = PersistenceNotifierGuard::new(&self.total_consistency_lock, &self.persistence_notifier);
@@ -2310,7 +2310,7 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
23102310
// we got all the HTLCs and then a channel closed while we were waiting for the user to
23112311
// provide the preimage, so worrying too much about the optimal handling isn't worth
23122312
// it.
2313-
let mut valid_mpp = sources[0].payment_data.total_msat >= expected_amount;
2313+
let mut valid_mpp = true;
23142314
for htlc in sources.iter() {
23152315
if !valid_mpp { break; }
23162316
if let None = channel_state.as_ref().unwrap().short_to_id.get(&htlc.prev_hop.short_channel_id) {
@@ -4830,7 +4830,7 @@ pub mod bench {
48304830

48314831
expect_pending_htlcs_forwardable!(NodeHolder { node: &$node_b });
48324832
expect_payment_received!(NodeHolder { node: &$node_b }, payment_hash, payment_secret, 10_000);
4833-
assert!($node_b.claim_funds(payment_preimage, 10_000));
4833+
assert!($node_b.claim_funds(payment_preimage));
48344834

48354835
match $node_b.get_and_clear_pending_msg_events().pop().unwrap() {
48364836
MessageSendEvent::UpdateHTLCs { node_id, updates } => {

lightning/src/ln/functional_test_utils.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,11 +1048,11 @@ pub fn send_along_route<'a, 'b, 'c>(origin_node: &Node<'a, 'b, 'c>, route: Route
10481048
(our_payment_preimage, our_payment_hash, our_payment_secret)
10491049
}
10501050

1051-
pub fn claim_payment_along_route<'a, 'b, 'c>(origin_node: &Node<'a, 'b, 'c>, expected_paths: &[&[&Node<'a, 'b, 'c>]], skip_last: bool, our_payment_preimage: PaymentPreimage, expected_amount: u64) {
1051+
pub fn claim_payment_along_route<'a, 'b, 'c>(origin_node: &Node<'a, 'b, 'c>, expected_paths: &[&[&Node<'a, 'b, 'c>]], skip_last: bool, our_payment_preimage: PaymentPreimage) {
10521052
for path in expected_paths.iter() {
10531053
assert_eq!(path.last().unwrap().node.get_our_node_id(), expected_paths[0].last().unwrap().node.get_our_node_id());
10541054
}
1055-
assert!(expected_paths[0].last().unwrap().node.claim_funds(our_payment_preimage, expected_amount));
1055+
assert!(expected_paths[0].last().unwrap().node.claim_funds(our_payment_preimage));
10561056
check_added_monitors!(expected_paths[0].last().unwrap(), expected_paths.len());
10571057

10581058
macro_rules! msgs_from_ev {
@@ -1136,8 +1136,8 @@ pub fn claim_payment_along_route<'a, 'b, 'c>(origin_node: &Node<'a, 'b, 'c>, exp
11361136
}
11371137
}
11381138

1139-
pub fn claim_payment<'a, 'b, 'c>(origin_node: &Node<'a, 'b, 'c>, expected_route: &[&Node<'a, 'b, 'c>], our_payment_preimage: PaymentPreimage, expected_amount: u64) {
1140-
claim_payment_along_route(origin_node, &[expected_route], false, our_payment_preimage, expected_amount);
1139+
pub fn claim_payment<'a, 'b, 'c>(origin_node: &Node<'a, 'b, 'c>, expected_route: &[&Node<'a, 'b, 'c>], our_payment_preimage: PaymentPreimage) {
1140+
claim_payment_along_route(origin_node, &[expected_route], false, our_payment_preimage);
11411141
}
11421142

11431143
pub const TEST_FINAL_CLTV: u32 = 50;
@@ -1170,9 +1170,9 @@ pub fn route_over_limit<'a, 'b, 'c>(origin_node: &Node<'a, 'b, 'c>, expected_rou
11701170
assert!(err.contains("Cannot send value that would put us over the max HTLC value in flight our peer will accept")));
11711171
}
11721172

1173-
pub fn send_payment<'a, 'b, 'c>(origin: &Node<'a, 'b, 'c>, expected_route: &[&Node<'a, 'b, 'c>], recv_value: u64, expected_value: u64) {
1173+
pub fn send_payment<'a, 'b, 'c>(origin: &Node<'a, 'b, 'c>, expected_route: &[&Node<'a, 'b, 'c>], recv_value: u64) {
11741174
let our_payment_preimage = route_payment(&origin, expected_route, recv_value).0;
1175-
claim_payment(&origin, expected_route, our_payment_preimage, expected_value);
1175+
claim_payment(&origin, expected_route, our_payment_preimage);
11761176
}
11771177

11781178
pub fn fail_payment_along_route<'a, 'b, 'c>(origin_node: &Node<'a, 'b, 'c>, expected_route: &[&Node<'a, 'b, 'c>], skip_last: bool, our_payment_hash: PaymentHash) {

0 commit comments

Comments
 (0)