p2p/pex: migrate to Protobuf#4973
Merged
mergify[bot] merged 5 commits intomasterfrom Jun 8, 2020
Merged
Conversation
I did this slightly different from #4800. Instead of having `decodeMsg` return a `tmp2p.Message`, I instead unpack the inner `Sum` message and return that as a `proto.Message`. This makes the returned message much more ergonomic, since callers don't have to worry about the `Sum` field and enum containers, and is also more symmetrical. It might have been better for `mustEncode()` and `decodeMsg()` to simply take and return `tmp2p.Message`, since this would give us compile-time type safety, but having to deal with the enum containers everywhere is probably too painful. Too bad Go doesn't have native sum types.☹️
|
👋 Thanks for creating a PR! Before we can merge this PR, please make sure that all the following items have been
Thank you for your contribution to Tendermint! 🚀 |
Codecov Report
@@ Coverage Diff @@
## master #4973 +/- ##
==========================================
- Coverage 63.27% 63.23% -0.05%
==========================================
Files 188 187 -1
Lines 19587 19645 +58
==========================================
+ Hits 12394 12422 +28
- Misses 6199 6228 +29
- Partials 994 995 +1
|
melekes
reviewed
Jun 7, 2020
erikgrinaker
approved these changes
Jun 8, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
migrate p2p/pex to protobuf
Closes: #XXX