-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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: Account numbers and sequences to uint64 #2799
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #2799 +/- ##
========================================
Coverage 56.84% 56.84%
========================================
Files 120 120
Lines 8298 8298
========================================
Hits 4717 4717
Misses 3263 3263
Partials 318 318 |
5914a77
to
76c5458
Compare
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.
File changes look OK. Is there anywhere we need to check for uint64 overflow / wraparound (anywhere account number and sequence aren't just monotonically increasing)?
It should only ever be monotonically increasing. Technically, even if we implement this: #1217 |
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.
Tested ACK. Two minor CLI concerns, optional to fix.
@@ -38,10 +38,10 @@ func NewTxBuilderFromCLI() TxBuilder { | |||
|
|||
return TxBuilder{ | |||
ChainID: chainID, | |||
AccountNumber: viper.GetInt64(client.FlagAccountNumber), | |||
AccountNumber: uint64(viper.GetInt64(client.FlagAccountNumber)), |
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 could be confusing if the user enters a negative number, maybe we should sanity check the input
Gas: client.GasFlagVar.Gas, | ||
GasAdjustment: viper.GetFloat64(client.FlagGasAdjustment), | ||
Sequence: viper.GetInt64(client.FlagSequence), | ||
Sequence: uint64(viper.GetInt64(client.FlagSequence)), |
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.
Ditto
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.
Changes LGTM -- I would just suggest updating PostCommands
to add these two flags as uints:
c.Flags().Uint64(FlagAccountNumber, 0, "AccountNumber number to sign the tx")
c.Flags().Uint64(FlagSequence, 0, "Sequence number to sign the tx")
This way, I don't think we need to sanity check as @cwgoes suggested.
many merge conflicts here! |
closes #2701
Targeted PR against correct branch (see CONTRIBUTING.md)
Linked to github-issue with discussion and accepted design OR link to spec that describes this work.
Wrote tests
Updated relevant documentation (
docs/
)Added entries in
PENDING.md
with issue #rereviewed
Files changed
in the github PR explorerFor Admin Use: