Skip to content

Move and Rustfmt Channel Type Negotiation Tests #3827

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

carlaKC
Copy link
Contributor

@carlaKC carlaKC commented Jun 4, 2025

This PR:

  • Updates channel.rs's tests to use test_utils::FeeEstimator
  • Moves tests related to channel_type negotiation into their own file
  • Formats the moved tests
  • Adds coverage for get_initial_channel_type

@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Jun 4, 2025

👋 Thanks for assigning @tankyleo 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.

@carlaKC carlaKC marked this pull request as ready for review June 6, 2025 13:15
@carlaKC carlaKC requested a review from tankyleo June 6, 2025 13:15
@carlaKC
Copy link
Contributor Author

carlaKC commented Jun 6, 2025

I think we can go ahead with review here independent of #3792, because it's touching different files.
Whichever gets in first, I'll just rebase to add zero fee commitments to the test cases.

Copy link
Contributor

@tankyleo tankyleo left a comment

Choose a reason for hiding this comment

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

  • Rewrote the first three commits on my own machine, they match except for these tiny variable names.
  • Manual mutation testing against the get_initial_channel_type tests

LGTM

InitFeatures::empty(),
ChannelTypeFeatures::only_static_remote_key(),
|cfg: &mut UserConfig| {
cfg.channel_handshake_config.announce_for_forwarding = false;
Copy link
Contributor

Choose a reason for hiding this comment

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

Note: UserConfig::default sets announce_for_forwarding = false already.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Replaced with a comment 👍

@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.

carlaKC added 3 commits June 6, 2025 14:35
Add straightforward unit tests for get_initial_channel_type, which
will be expanded when we add zero_fee_commitment type.
@carlaKC carlaKC force-pushed the initial-channel-type-tests branch from 56eff67 to e7e0124 Compare June 6, 2025 18:48
Copy link

codecov bot commented Jun 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.41%. Comparing base (901f72d) to head (e7e0124).
Report is 8 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3827      +/-   ##
==========================================
+ Coverage   89.90%   90.41%   +0.50%     
==========================================
  Files         160      161       +1     
  Lines      129222   133876    +4654     
  Branches   129222   133876    +4654     
==========================================
+ Hits       116182   121046    +4864     
+ Misses      10348    10127     -221     
- Partials     2692     2703      +11     

☔ 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.

@ldk-reviews-bot ldk-reviews-bot requested a review from wpaulino June 6, 2025 19:07
@ldk-reviews-bot
Copy link

✅ Added second reviewer: @wpaulino

@carlaKC carlaKC requested a review from tankyleo June 6, 2025 19:15
@ldk-reviews-bot
Copy link

🔔 1st Reminder

Hey @tankyleo! This PR has been waiting for your review.
Please take a look when you have a chance. If you're unable to review, please let us know so we can find another 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.

4 participants