Skip to content

Conversation

@elnosh
Copy link
Contributor

@elnosh elnosh commented Nov 12, 2025

Might be a bit painful to review but this removes 2 other macros from the test utils:

  • get_htlc_update_msgs
  • check_closed_event

Replace calls to `get_htlc_update_msgs` macro
to the identically-named function.
@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Nov 12, 2025

I've assigned @valentinewallace as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

@codecov
Copy link

codecov bot commented Nov 12, 2025

Codecov Report

❌ Patch coverage is 99.45355% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.35%. Comparing base (9150bc8) to head (3ec3492).
⚠️ Report is 19 commits behind head on main.

Files with missing lines Patch % Lines
lightning/src/ln/functional_tests.rs 98.12% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4220      +/-   ##
==========================================
+ Coverage   89.32%   89.35%   +0.02%     
==========================================
  Files         180      180              
  Lines      138176   138409     +233     
  Branches   138176   138409     +233     
==========================================
+ Hits       123424   123669     +245     
+ Misses      12137    12136       -1     
+ Partials     2615     2604      -11     
Flag Coverage Δ
fuzzing 35.87% <0.00%> (+2.25%) ⬆️
tests 88.71% <99.45%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

close_channel(&nodes[0], &nodes[1], &chan_1.2, chan_1.3, true);
let node_a_reason = ClosureReason::CounterpartyInitiatedCooperativeClosure;
check_closed_event!(nodes[0], 1, node_a_reason, [node_b_id], 100000);
check_closed_event(&nodes[0], 1, node_a_reason, false, &[node_b_id], 100000);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given we pass in false for is_check_discard_funding 99% of the time, it seems like a more ergonomic API would be to have a check_closed_event function without that parameter that gets used most of the time, and a check_closed_event_internal (or something like that) that does support the parameter for the minority of cases that need it. Thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, SGTM

@ldk-reviews-bot
Copy link

👋 The first review has been submitted!

Do you think this PR is ready for a second reviewer? If so, click here to assign a second reviewer.

@elnosh elnosh force-pushed the replace-testuils-macros branch from 68b68e8 to d976077 Compare November 13, 2025 20:46
Replace calls to `check_closed_event` macro
to the identically-named function.
@elnosh elnosh force-pushed the replace-testuils-macros branch from d976077 to 3ec3492 Compare November 13, 2025 21:02
Copy link
Contributor

@valentinewallace valentinewallace left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Probably fine to land with 1 reviewer after CI passes as it's entirely mechanical changes. Some nice rustfmt cleanups in here as well.

@valentinewallace valentinewallace merged commit 6d4897c into lightningdevkit:main Nov 14, 2025
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants