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

Let Coin::new accept values in destination type (Uint128/String) #1501

Closed
webmaster128 opened this issue Nov 21, 2022 · 0 comments · Fixed by #1902
Closed

Let Coin::new accept values in destination type (Uint128/String) #1501

webmaster128 opened this issue Nov 21, 2022 · 0 comments · Fixed by #1902
Milestone

Comments

@webmaster128
Copy link
Member

If you have an amount in Uint128 and want to use Coin::new, you need to converte to u128 and back to Uint128:

// incentive_amount: Uint128

Coin::new(incentive_amount.into(), incentive_denom)

Changing the API to

pub fn new(amount: impl Into<Uint128>, denom: impl Into<String>) -> Self {

would be more straight forward.

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 a pull request may close this issue.

1 participant