-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
R4R: Use iota where appropriate #3632
Conversation
Looks like that bonding test is still flapping... |
Codecov Report
@@ Coverage Diff @@
## develop #3632 +/- ##
===========================================
- Coverage 61.28% 61.26% -0.02%
===========================================
Files 186 186
Lines 13998 13998
===========================================
- Hits 8578 8576 -2
- Misses 4876 4878 +2
Partials 544 544 |
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.
I understand this is a Go idiom, but I actually think it makes these files harder to read - now, if you want to figure out the byte for a particular vote option or proposal type, you have to count lines. Furthermore, we're likely to want to add additional types in the future, and probably want to keep the same mappings, which is easy to accidentally undo with iota
.
So I would vote not to do this, in these instances and in general. cc @rigelrozanski Any thoughts?
I don't see anything inherently wrong with these changes.
Can you provide some context and examples of when you'd actually want this? Do we provide these exact bytes to any clients or is it only used internally? If the latter, then it doesn't really matter imho. |
They're used in stored values, which we will want to upgrade in a forwards-compatible way (so we don't have to modify the old state), and which a client might want to decode (e.g. for lite client proof verification). As far as I can tell none are used in transaction tags at present, although we might want to use them there in the future. I don't have that strong an opinion on this, so if the general consensus is that it increases code readability I'll approve. |
Ok, well if want want easy upgradability, then I renege my comment/approval here. |
Ref: #3621 (comment)
docs/
)PENDING.md
with issue #Files changed
in the github PR explorerFor Admin Use: