-
Notifications
You must be signed in to change notification settings - Fork 422
Consistently use wire::Message for encoding
#4244
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?
Consistently use wire::Message for encoding
#4244
Conversation
|
👋 Thanks for assigning @TheBlueMatt as a reviewer! |
bea6480 to
3c0a1d7
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4244 +/- ##
==========================================
- Coverage 89.33% 89.31% -0.02%
==========================================
Files 180 180
Lines 138680 138824 +144
Branches 138680 138824 +144
==========================================
+ Hits 123888 123994 +106
- Misses 12172 12203 +31
- Partials 2620 2627 +7
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:
|
|
🔔 1st Reminder Hey @TheBlueMatt! This PR has been waiting for your review. |
TheBlueMatt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems weird to replace a correct but unused implementation with an incorrect/panicing one? Can we remove the bound instead?
|
👋 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. |
Previously, `enqueue_message` took an `M: Type + Writeable` reference, which didn't make use of our `wire::Message` type, which turned out to be rather confusing. Here, we use `Message` consistently in `PeerManager`'s `enqueue_message`, but also in `encrypt_message`, etc. While at it we also switch to move semantics, which is a nice cleanup.
3c0a1d7 to
734b4e2
Compare
Now that we consistently use `wire::Message` everywhere, it's easier to simply use `Message::write`/`Type::write` instead of heaving yet another `wire::write` around. Here we drop `wire::write`, replace the `encode_msg` macro with a method that takes `wire::Message`, and convert a bunch of additional places to move semantics.
734b4e2 to
c7a57c8
Compare
wire::Message's Writeable implementation with unreachable!wire::Message for encoding
Hmm, turns out I had overlooked a single case where it was used (only when writing out messages on shutdown via a) always consistently use |
Uh oh!
There was an error while loading. Please reload this page.