-
Notifications
You must be signed in to change notification settings - Fork 126
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: Add metrics initialization #1344
Conversation
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) |
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.
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?
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.
Added AttoPrecision
in coin_type
.
modules/service/keeper.go
Outdated
@@ -382,6 +382,11 @@ func (k Keeper) ActiveRequestQueueIterator(ctx sdk.Context, height int64) sdk.It | |||
return sdk.KVStorePrefixIterator(store, GetRequestsByExpirationPrefix(height)) | |||
} | |||
|
|||
// 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) |
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.
Why use the returnedFeeKey
?
Closes: #1331