-
Notifications
You must be signed in to change notification settings - Fork 56
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
Invalid MA is ignored #881
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## unstable #881 +/- ##
============================================
+ Coverage 84.21% 84.26% +0.04%
============================================
Files 87 87
Lines 15125 15134 +9
============================================
+ Hits 12738 12753 +15
+ Misses 2387 2381 -6
|
353cc90
to
0c8972f
Compare
@@ -1128,6 +1131,5 @@ proc getRepeatedField*(pb: ProtoBuffer, field: int, | |||
if ma.isOk(): | |||
value.add(ma.get()) | |||
else: | |||
value.setLen(0) | |||
return err(ProtoError.IncorrectBlob) | |||
debug "Not supported MultiAddress in blob", ma = item |
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.
This doesn't seems like the best solution
Maybe create a tryGetRepeatedField
, that returns the number of failed parses? This way the caller can handle this however it wants
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.
Would any part of the current codebase use it and in which way? I believe it is better to add code only when it is required to solve a present problem.
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.
If the current version is not relevant anywhere, then we should change this proc to return the number of failed parses (or eq)
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.
And update every usage accordingly (and check it's not used by nimbus & co)
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.
pushed changes
c23698e
to
7c39793
Compare
96f94ca
to
d18140a
Compare
No description provided.