Skip to content

Commit f1ccde0

Browse files
committed
f update test to new api
1 parent ac5f00f commit f1ccde0

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

lightning/src/ln/chanmon_update_fail_tests.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1989,8 +1989,8 @@ fn do_channel_holding_cell_serialize(disconnect: bool, reload_a: bool) {
19891989
let mut nodes = create_network(2, &node_cfgs, &node_chanmgrs);
19901990

19911991
let chan_id = create_announced_chan_between_nodes_with_value(&nodes, 0, 1, 15_000_000, 7_000_000_000, InitFeatures::known(), InitFeatures::known()).2;
1992-
let (payment_preimage_1, payment_hash_1) = get_payment_preimage_hash!(&nodes[0]);
1993-
let (payment_preimage_2, payment_hash_2) = get_payment_preimage_hash!(&nodes[0]);
1992+
let (payment_preimage_1, payment_hash_1, payment_secret_1) = get_payment_preimage_hash!(&nodes[1]);
1993+
let (payment_preimage_2, payment_hash_2, payment_secret_2) = get_payment_preimage_hash!(&nodes[1]);
19941994

19951995
// Do a really complicated dance to get an HTLC into the holding cell, with MonitorUpdateFailed
19961996
// set but AwaitingRemoteRevoke unset. When this test was written, any attempts to send an HTLC
@@ -2011,23 +2011,23 @@ fn do_channel_holding_cell_serialize(disconnect: bool, reload_a: bool) {
20112011
//
20122012
// Note that because, at the end, MonitorUpdateFailed is still set, the HTLC generated in (c)
20132013
// will not be freed from the holding cell.
2014-
let (payment_preimage_0, _) = route_payment(&nodes[1], &[&nodes[0]], 100000);
2014+
let (payment_preimage_0, _, _) = route_payment(&nodes[1], &[&nodes[0]], 100000);
20152015

20162016
let route = {
20172017
let net_graph_msg_handler = &nodes[0].net_graph_msg_handler;
20182018
get_route(&nodes[0].node.get_our_node_id(), &net_graph_msg_handler.network_graph.read().unwrap(), &nodes[1].node.get_our_node_id(), None, None, &Vec::new(), 100000, TEST_FINAL_CLTV, nodes[0].logger).unwrap()
20192019
};
20202020

2021-
nodes[0].node.send_payment(&route, payment_hash_1, &None).unwrap();
2021+
nodes[0].node.send_payment(&route, payment_hash_1, &Some(payment_secret_1)).unwrap();
20222022
check_added_monitors!(nodes[0], 1);
20232023
let send = SendEvent::from_node(&nodes[0]);
20242024
assert_eq!(send.msgs.len(), 1);
20252025

2026-
nodes[0].node.send_payment(&route, payment_hash_2, &None).unwrap();
2026+
nodes[0].node.send_payment(&route, payment_hash_2, &Some(payment_secret_2)).unwrap();
20272027
check_added_monitors!(nodes[0], 0);
20282028

20292029
*nodes[0].chain_monitor.update_ret.lock().unwrap() = Some(Err(ChannelMonitorUpdateErr::TemporaryFailure));
2030-
assert!(nodes[0].node.claim_funds(payment_preimage_0, &None, 100000));
2030+
assert!(nodes[0].node.claim_funds(payment_preimage_0));
20312031
check_added_monitors!(nodes[0], 1);
20322032

20332033
nodes[1].node.handle_update_add_htlc(&nodes[0].node.get_our_node_id(), &send.msgs[0]);
@@ -2156,16 +2156,16 @@ fn do_channel_holding_cell_serialize(disconnect: bool, reload_a: bool) {
21562156
let as_revoke_and_ack = get_event_msg!(nodes[0], MessageSendEvent::SendRevokeAndACK, nodes[1].node.get_our_node_id());
21572157
nodes[1].node.handle_revoke_and_ack(&nodes[0].node.get_our_node_id(), &as_revoke_and_ack);
21582158
expect_pending_htlcs_forwardable!(nodes[1]);
2159-
expect_payment_received!(nodes[1], payment_hash_1, 100000);
2159+
expect_payment_received!(nodes[1], payment_hash_1, payment_secret_1, 100000);
21602160
check_added_monitors!(nodes[1], 1);
21612161

21622162
commitment_signed_dance!(nodes[1], nodes[0], (), false, true, false);
21632163

21642164
expect_pending_htlcs_forwardable!(nodes[1]);
2165-
expect_payment_received!(nodes[1], payment_hash_2, 100000);
2165+
expect_payment_received!(nodes[1], payment_hash_2, payment_secret_2, 100000);
21662166

2167-
claim_payment(&nodes[0], &[&nodes[1]], payment_preimage_1, 100000);
2168-
claim_payment(&nodes[0], &[&nodes[1]], payment_preimage_2, 100000);
2167+
claim_payment(&nodes[0], &[&nodes[1]], payment_preimage_1);
2168+
claim_payment(&nodes[0], &[&nodes[1]], payment_preimage_2);
21692169
}
21702170
#[test]
21712171
fn channel_holding_cell_serialize() {

0 commit comments

Comments
 (0)