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

Create DecCoins from DecCoin #5430

Closed
4 tasks
karzak opened this issue Dec 19, 2019 · 1 comment · Fixed by #5449
Closed
4 tasks

Create DecCoins from DecCoin #5430

karzak opened this issue Dec 19, 2019 · 1 comment · Fixed by #5449

Comments

@karzak
Copy link
Contributor

karzak commented Dec 19, 2019

Summary

It should be possible to create a DecCoins from a constructor function that takes DecCoin... as inputs. Currently, the only way to do this is

[]sdk.DecCoin{sdk.DecCoin{"denom", sdk.NewDec(10)}}

Problem Definition

The current NewDecCoins method takes Coins... as arguments.

func NewDecCoins(coins Coins) DecCoins {

Proposal

It would be nice to have the default method take DecCoins... as arguments, or add a separate method for creating DecCoins from DecCoin...


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@fedekunze
Copy link
Collaborator

I'm in favor of this change. Additionally, I'd also create a NewDecCoinsFromCoin which would be the current implementation of NewDecCoins(coins Coins)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants