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

Switch to back to "stake" denomination #9

Merged
merged 2 commits into from
May 22, 2020
Merged

Conversation

ejfitzgerald
Copy link
Member

No description provided.

@@ -28,10 +28,10 @@ func TestSetWithdrawAddr(t *testing.T) {
func TestWithdrawValidatorCommission(t *testing.T) {
ctx, ak, keeper, _, _ := CreateTestInputDefault(t, false, 1000)

valCommission := sdk.DecCoins{
valCommission := sdk.CollectDecCoins(
Copy link
Member Author

Choose a reason for hiding this comment

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

Not exactly happy with this change. However, basically the "safe" coin maths logic here require that the underlying list of tokens is ordered. Failure to do this results in fairly random behavior.

This was triggered in this PR because the first letter has changed. I have therefore introduced a new function to collect DecCoins together and ensure that they are sorted

for _, coin := range coins {
output = append(output, coin)
}
output.Sort()
Copy link
Member Author

Choose a reason for hiding this comment

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

Critical step!

@ejfitzgerald ejfitzgerald changed the title Switch to "fet" denomination Switch to back to "stake" denomination May 12, 2020
Copy link

@steevi steevi left a comment

Choose a reason for hiding this comment

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

LGTM

@ejfitzgerald ejfitzgerald merged commit 30cfd3d into master May 22, 2020
@ejfitzgerald ejfitzgerald deleted the feature/denom-change branch July 8, 2020 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants