-
Notifications
You must be signed in to change notification settings - Fork 378
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
Make banker.SendCoins
take variadic Coin
argument
#1676
Comments
banker.SendCoins
take variadic Coin argumentbanker.SendCoins
take variadic Coin
argument
Note, the IMO a better approach is to add better constructors for the types; using the |
I was more referring to the fact that when you want to send a single coin with the banker, you always need to pack it inside the
The other option is what you are suggesting, and that is adding the BTW, I am working on a small PR to introduce some more functionality to |
Yeah, I get you, what I'm saying is that |
Solution for this was to implement a variadic constructor for the Coins type. Implemented in #2104 |
Description
As the title says. Instead of having to build a slice each time you want to send coins, I propose we change the banker API to take in a variadic Coin argument.
Before:
func (ba bankAdapter) SendCoins(from, to Address, amt Coins)
After:
func (ba bankAdapter) SendCoins(from, to Address, amts ...Coin)
Here is the code.
The text was updated successfully, but these errors were encountered: