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.
Replace calls to `check_closed_event` 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

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.33%. Comparing base (9150bc8) to head (68b68e8).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4220      +/-   ##
==========================================
+ Coverage   89.32%   89.33%   +0.01%     
==========================================
  Files         180      180              
  Lines      138176   138223      +47     
  Branches   138176   138223      +47     
==========================================
+ Hits       123424   123486      +62     
+ Misses      12137    12127      -10     
+ Partials     2615     2610       -5     
Flag Coverage Δ
fuzzing 33.63% <0.00%> (+0.01%) ⬆️
tests 88.72% <100.00%> (+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.

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