lightningdevkit / rust-lightning

A highly modular Bitcoin Lightning library written in Rust. It's rust-lightning, not Rusty's Lightning!
Other
1.16k stars 367 forks source link

Decouple `MessageRouter` from `Router` #3326

Closed jkczyz closed 1 month ago

jkczyz commented 2 months ago

ChannelManager is parameterized by a Router, which must also implement MessageRouter. Instead, add a MessageRouter parameter such that the Router and MessageRouter traits can be de-coupled. This simplifies using something other than DefaultMessageRouter, which DefaultRouter currently delegates to.

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 84.31373% with 16 lines in your changes missing coverage. Please review.

Project coverage is 89.63%. Comparing base (cdd1298) to head (cad0985). Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
lightning/src/ln/channelmanager.rs 47.36% 10 Missing :warning:
lightning/src/ln/invoice_utils.rs 90.90% 6 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #3326 +/- ## ========================================== - Coverage 89.64% 89.63% -0.01% ========================================== Files 126 126 Lines 102676 102657 -19 Branches 102676 102657 -19 ========================================== - Hits 92043 92020 -23 + Misses 7909 7907 -2 - Partials 2724 2730 +6 ``` | [Flag](https://app.codecov.io/gh/lightningdevkit/rust-lightning/pull/3326/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=lightningdevkit) | Coverage Δ | | |---|---|---| | [](https://app.codecov.io/gh/lightningdevkit/rust-lightning/pull/3326/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=lightningdevkit) | `89.63% <84.31%> (?)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=lightningdevkit#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.