X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fln%2Fmax_payment_path_len_tests.rs;h=7bd605c9ddfeeeee275fb636b8ae38f8a1b4ff30;hb=642913c586fc71b0e413532e7dedcd19cfd4815c;hp=36fe098b9ee59a381b09663a79a8ceb09c9ba131;hpb=37bf61c49bb8d0f3d5a9bc8de390e97f6b2ac0c1;p=rust-lightning diff --git a/lightning/src/ln/max_payment_path_len_tests.rs b/lightning/src/ln/max_payment_path_len_tests.rs index 36fe098b..7bd605c9 100644 --- a/lightning/src/ln/max_payment_path_len_tests.rs +++ b/lightning/src/ln/max_payment_path_len_tests.rs @@ -84,7 +84,9 @@ fn large_payment_metadata() { .with_payment_secret(payment_secret) .with_payment_metadata(payment_metadata.clone()); do_pass_along_path(args); - claim_payment_along_route(&nodes[0], &[&[&nodes[1]]], false, payment_preimage); + claim_payment_along_route( + ClaimAlongRouteArgs::new(&nodes[0], &[&[&nodes[1]]], payment_preimage) + ); // Check that the payment parameter for max path length will prevent us from routing past our // next-hop peer given the payment_metadata size. @@ -133,7 +135,9 @@ fn large_payment_metadata() { .with_payment_secret(payment_secret_2) .with_payment_metadata(recipient_onion_allows_2_hops.payment_metadata.unwrap()); do_pass_along_path(args); - claim_payment_along_route(&nodes[0], &[&[&nodes[1], &nodes[2]]], false, payment_preimage_2); + claim_payment_along_route( + ClaimAlongRouteArgs::new(&nodes[0], &[&[&nodes[1], &nodes[2]]], payment_preimage_2) + ); } #[test] @@ -201,7 +205,10 @@ fn one_hop_blinded_path_with_custom_tlv() { .with_payment_secret(payment_secret) .with_custom_tlvs(recipient_onion_max_custom_tlv_size.custom_tlvs.clone()); do_pass_along_path(args); - claim_payment_along_route(&nodes[1], &[&[&nodes[2]]], false, payment_preimage); + claim_payment_along_route( + ClaimAlongRouteArgs::new(&nodes[1], &[&[&nodes[2]]], payment_preimage) + .with_custom_tlvs(recipient_onion_max_custom_tlv_size.custom_tlvs.clone()) + ); // If 1 byte is added to the custom TLV value, we'll fail to send prior to pathfinding. let mut recipient_onion_too_large_custom_tlv = recipient_onion_max_custom_tlv_size.clone(); @@ -226,9 +233,12 @@ fn one_hop_blinded_path_with_custom_tlv() { let path = &[&nodes[1], &nodes[2]]; let args = PassAlongPathArgs::new(&nodes[0], path, amt_msat, payment_hash, events.pop().unwrap()) .with_payment_secret(payment_secret) - .with_custom_tlvs(recipient_onion_allows_2_hops.custom_tlvs); + .with_custom_tlvs(recipient_onion_allows_2_hops.custom_tlvs.clone()); do_pass_along_path(args); - claim_payment_along_route(&nodes[0], &[&[&nodes[1], &nodes[2]]], false, payment_preimage); + claim_payment_along_route( + ClaimAlongRouteArgs::new(&nodes[0], &[&[&nodes[1], &nodes[2]]], payment_preimage) + .with_custom_tlvs(recipient_onion_allows_2_hops.custom_tlvs) + ); } #[test] @@ -283,7 +293,10 @@ fn blinded_path_with_custom_tlv() { .with_payment_secret(payment_secret) .with_custom_tlvs(recipient_onion_max_custom_tlv_size.custom_tlvs.clone()); do_pass_along_path(args); - claim_payment_along_route(&nodes[1], &[&[&nodes[2], &nodes[3]]], false, payment_preimage); + claim_payment_along_route( + ClaimAlongRouteArgs::new(&nodes[1], &[&[&nodes[2], &nodes[3]]], payment_preimage) + .with_custom_tlvs(recipient_onion_max_custom_tlv_size.custom_tlvs.clone()) + ); // If 1 byte is added to the custom TLV value, we'll fail to send prior to pathfinding. let mut recipient_onion_too_large_custom_tlv = recipient_onion_max_custom_tlv_size.clone(); @@ -320,7 +333,10 @@ fn blinded_path_with_custom_tlv() { let path = &[&nodes[1], &nodes[2], &nodes[3]]; let args = PassAlongPathArgs::new(&nodes[0], path, amt_msat, payment_hash, events.pop().unwrap()) .with_payment_secret(payment_secret) - .with_custom_tlvs(recipient_onion_allows_2_hops.custom_tlvs); + .with_custom_tlvs(recipient_onion_allows_2_hops.custom_tlvs.clone()); do_pass_along_path(args); - claim_payment_along_route(&nodes[0], &[&[&nodes[1], &nodes[2], &nodes[3]]], false, payment_preimage); + claim_payment_along_route( + ClaimAlongRouteArgs::new(&nodes[0], &[&[&nodes[1], &nodes[2], &nodes[3]]], payment_preimage) + .with_custom_tlvs(recipient_onion_allows_2_hops.custom_tlvs) + ); }