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

feat: leave some tokens on delegator accounts for txs #129

Merged
merged 2 commits into from
Jul 6, 2021

Conversation

daeMOn63
Copy link
Contributor

@daeMOn63 daeMOn63 commented Jul 5, 2021

Add condition to create delegations:

  • when the amount exceeds the minDelegated amount, a delegation is created with amount - accountReserved, and accountReserved is transferred on the user account.
  • otherwise, the full amount is simply transferred to the user account, and no delegation is created.

daeMOn63 added 2 commits July 5, 2021 14:39
otherwise, tokens are simply transfered on the user account
and no delegation is created.
return fmt.Errorf("failed to get flag %q: %w", flagAccountReservedAmount, err)
}

minDelegatedCoin, err := sdk.ParseCoinNormalized(minDelegatedAmountStr)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ejfitzgerald this ParseCoinNormalized will truncate amount decimals:
873355710070564895.14afet becomes 873355710070564895afet

This seems the regular way to parse coin amount input, but not sure about losing some precision here, wdyt?

Copy link
Member

Choose a reason for hiding this comment

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

Yep totally fine. Technically speaking there is no such thing as fractial afet so this truncation is fine

@daeMOn63 daeMOn63 requested a review from ejfitzgerald July 5, 2021 16:56
@daeMOn63 daeMOn63 merged commit a17de2d into master Jul 6, 2021
@daeMOn63 daeMOn63 deleted the gendelegations_updates branch July 6, 2021 12:25
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