R4R: Add metrics initialization#1344
Merged
wukongcheng merged 2 commits intoirisnet:developfrom Mar 6, 2019
Merged
Conversation
HaoyangLiu
previously approved these changes
Mar 5, 2019
haifengxi
reviewed
Mar 6, 2019
modules/stake/keeper/validator.go
Outdated
| addr := iterator.Key()[1:] | ||
| validator := types.MustUnmarshalValidator(k.cdc, addr, iterator.Value()) | ||
| tokenPrecision := sdk.NewIntWithDecimal(1, 18) | ||
| bondedToken, err := strconv.ParseFloat(validator.GetTokens().QuoInt(tokenPrecision).String(), 64) |
Contributor
There was a problem hiding this comment.
Let's replace magic number 18 in sdk.NewIntWithDecimal(1, 18) with something like: sdk.AttoUnit(sdk.NativeTokenName).Decimal
A bit too long, maybe add some convenience methods into CoinType?
Contributor
Author
There was a problem hiding this comment.
Added AttoPrecision in coin_type.
haifengxi
previously approved these changes
Mar 6, 2019
wukongcheng
reviewed
Mar 6, 2019
modules/service/keeper.go
Outdated
|
|
||
| // Returns an iterator for all the request in the Active Queue | ||
| func (k Keeper) ActiveAllRequestQueueIterator(store sdk.KVStore) sdk.Iterator { | ||
| return sdk.KVStorePrefixIterator(store, returnedFeeKey) |
Contributor
There was a problem hiding this comment.
Why use the returnedFeeKey ?
wukongcheng
approved these changes
Mar 6, 2019
HaoyangLiu
approved these changes
Mar 6, 2019
This was referenced Apr 19, 2024
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.
Closes: #1331