Make a more ergonomic way of creating simple sdk.Coins #10332
Open
Description
opened on Oct 10, 2021
Summary
Often due to compatibility issues, you have to make an SDK.Coins from a single Sdk.Coin, specified by raw parameters. This is especially true within tests. At the moment, the most common ways to do this that I'm aware of are:
myCoins := sdk.Coins{sdk.NewInt64Coin(myDenom, 1000)}
myCoins := sdk.NewCoins(sdk.NewInt64Coin(myDenom, 1000)
myCoins := sdk.NewCoins(sdk.NewCoin(myDenom, sdk.NewInt(1000))
At least in Osmosis, such lines are all over the codebase. They're long, and lots of boilerplate. Can we make a more ergonomic way to do this? Perhaps:
sdk.NewInt64Coins(denoms..., ints...)
sdk.NewInt64Coins(myDenom, 1000)
For Admin Use
- Not duplicate issue
- Appropriate labels applied
- Appropriate contributors tagged
- Contributor assigned/self-assigned
Activity