-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
fix: Format decimals correctly for signmode textual #15129
Conversation
["123", "123"], | ||
["1234", "1'234"], | ||
["0.0", "0"], | ||
["1.0", "1"], |
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 remember when we introduced gov v1, we dropped the customtype to sdk.Dec, see here or tally. This means in state, the string is stored as a "normal" decimal.
What we need to make sure is that the string does always have a .
. For example, we should test this manually with Ledger, using a weighted vote of 1
, and make sure it shows 1
and not 1e-18
.
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.
Will test that 👌
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.
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.
Impl LGTM, can merge if it's tested manually #15129 (comment)
Co-authored-by: Amaury <[email protected]>
types/mempool/sender_nonce.go
Outdated
func (mp *SenderNonceMempool) NextSenderTx(sender string) sdk.Tx { | ||
senderIndex, ok := mp.senders[sender] | ||
func (snm *SenderNonceMempool) NextSenderTx(sender string) sdk.Tx { | ||
senderIndex, ok := snm.senders[sender] |
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 to make the linter happy
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.
everything lgtm
Description
This solves the issue with values being formatted as huge numbers. Like
--commission-rate="0.1"
being shown as100'000'000'000'000'000
.Warning: this is a workaround to a bigger issue regarding
sdk.Dec
. Values that don't contain a "." will be processed as if they were Ne-18. We need to double-check if this affects anything elseRelated: #10863
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
to the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
!
in the type prefix if API or client breaking change