Skip to content
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

Merged
merged 2 commits into from
Mar 6, 2019
Merged

Conversation

chengwenxi
Copy link
Contributor

Closes: #1331

HaoyangLiu
HaoyangLiu previously approved these changes Mar 5, 2019
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)
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@haifengxi haifengxi added the bug Something isn't working label Mar 6, 2019
haifengxi
haifengxi previously approved these changes Mar 6, 2019
@@ -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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why use the returnedFeeKey ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working metric
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants