-
Notifications
You must be signed in to change notification settings - Fork 432
Split ChannelManager::read into two stages #4332
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
base: main
Are you sure you want to change the base?
Conversation
|
👋 Thanks for assigning @jkczyz as a reviewer! |
Introduce ChannelManagerData<SP> as an intermediate DTO that holds all deserialized data from a ChannelManager before validation. This splits the read implementation into: 1. Stage 1: Pure deserialization into ChannelManagerData 2. Stage 2: Validation and reconstruction using the DTO The existing validation and reconstruction logic remains unchanged; only the deserialization portion was extracted into the DTO's ReadableArgs implementation. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
d762c44 to
6deae20
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4332 +/- ##
=======================================
Coverage 86.53% 86.54%
=======================================
Files 158 158
Lines 103190 103245 +55
Branches 103190 103245 +55
=======================================
+ Hits 89300 89351 +51
- Misses 11469 11470 +1
- Partials 2421 2424 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Extract the stage 2 validation and reconstruction logic from the ReadableArgs implementation into a standalone pub(crate) function. This enables reuse of the ChannelManager construction logic from deserialized data. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
@jkczyz pointed to #2819 (comment) This PR could serve as a first step toward addressing #2819. An UninitializedChannelManager could potentially wrap ChannelManagerData? That said, keeping this PR focused on the separation of concerns and testability benefits mentioned in the description probably makes sense given that #2819 has been deprioritized. |
|
🔔 1st Reminder Hey @jkczyz @valentinewallace! This PR has been waiting for your review. |
1 similar comment
|
🔔 1st Reminder Hey @jkczyz @valentinewallace! This PR has been waiting for your review. |
|
🔔 2nd Reminder Hey @jkczyz @valentinewallace! This PR has been waiting for your review. |
Introduce
ChannelManagerDataas an intermediate DTO that holds all deserialized data from aChannelManagerbefore validation. This splits the read implementation into:ChannelManagerDataThe existing validation and reconstruction logic remains unchanged; only the deserialization portion was extracted into the DTO's
ReadableArgsimplementation.Rationale
ChannelManagerloading