Skip to content

Move tests in channelmanager.rs into more appropriate test files #2958

Open

Description

@dunxen

The channelmanager.rs file is huuuge³ at the moment and we shouldn't be adding more tests to it. We should move them into more appropriate test files (which may involve creating new _test.rs files too.

This is unlikely to create a ton of git noise as it should just be pure moves of tests so it could probably be done in one PR.

Activity

  1. srikanth-iyengar commented on Mar 23, 2024

    @srikanth-iyengar

    I would like to work on this issue, is this up for grabs?

  2. dunxen commented on Mar 23, 2024

    @dunxen
    ContributorAuthor

    I would like to work on this issue, is this up for grabs?

    Hey, thanks! It sure is! Let us know on this issue if you have any other questions while working on this. I'm not sure everything would move into existing test files so you may need to create some new ones that are more relevant but please feel free to ask!

  3. srikanth-iyengar commented on Mar 23, 2024

    @srikanth-iyengar

    Yeah sure, will get back here if I face any issue

  4. srikanth-iyengar commented on Mar 26, 2024

    @srikanth-iyengar

    Hey @dunxen I have analyzed the channelmanager tests and prepared the following test groups,
    lemme know of your thoughts

    There are total 22 tests

    Group 1: Key Send and Payment Verification

    1. test_keysend_dup_hash_partial_mpp
    2. test_keysend_dup_payment_hash
    3. test_keysend_hash_mismatch
    4. test_keysend_msg_with_secret_err
    5. bad_inbound_payment_hash
    6. reject_excessively_underpaying_htlcs
    7. test_final_incorrect_cltv
    8. test_payment_display
    9. test_malformed_forward_htlcs_ser

    Group 2: Channel Management and Limits

    1. test_notify_limits
    2. test_drop_disconnected_peers_when_removing_channels
    3. test_outpoint_to_peer_coverage
    4. test_api_calls_with_unkown_counterparty_node
    5. test_api_calls_with_unavailable_channel
    6. test_connection_limiting
    7. test_outbound_chans_unlimited
    8. test_0conf_limiting
    9. test_trigger_lnd_force_close

    Group 3: Anchor Channel and Configuration Tests

    1. test_inbound_anchors_manual_acceptance
    2. test_anchors_zero_fee_htlc_tx_fallback
    3. test_update_channel_config
  5. dunxen commented on Mar 27, 2024

    @dunxen
    ContributorAuthor

    Hey @srikanth-iyengar, those groupings seem to make sense to me from first glance! I think we can get some more comments on the moves int he PR to see it in context.

  6. srikanth-iyengar commented on Mar 28, 2024

    @srikanth-iyengar

    I started working on the issue, Currently I found that some of the fields/functions in the channel manager are private , should I make them public like pub(crate)?

  7. srikanth-iyengar commented on Apr 1, 2024

    @srikanth-iyengar

    Hey @dunxen I have raised a PR for this issue, Can you take a look ?

  8. ektedar225 commented on Feb 10, 2026

    @ektedar225

    Hi @TheBlueMatt @valentinewallace,

    I noticed that the previous PR #2977 for this issue has been inactive for a long time and has merge conflicts.

    I would like to pick this up. My plan is to start fresh (using the old PR as a reference) to avoid conflict issues and move the tests cleanly.

    Could you please assign this issue to me?

  9. ektedar225 commented on Feb 10, 2026

    @ektedar225

    Hi @TheBlueMatt, thank you for the go-ahead! Since #2977 is now closed, I'll be starting a fresh PR based on the current main branch to move the tests from channelmanager.rs cleanly. I'll link the new PR here once the initial work is ready for review

  10. Hamza1610 commented on Jun 20, 2026

    @Hamza1610
    Contributor

    Hi @ektedar225, I noticed you took initiative in working on this issue, are you still on it?

  11. Juwon-Ogunseye commented on Aug 2, 2026

    @Juwon-Ogunseye

    Hi @ektedar225 , just checking in are you still actively working on this? It's been a few months since your last update.

    If you've moved on or paused this, I'd love to pick it up (using the old #2977 PR as a reference like you planned). @TheBlueMatt @dunxen , happy to take this over if it's free let me know and I'll get started right away.

  12. valentinewallace commented on Aug 12, 2026

    @valentinewallace
    Contributor

    @Juwon-Ogunseye go for it. Btw, this project has moved to Forgejo: https://git.rust-bitcoin.org/lightningdevkit/rust-lightning

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions