feat: implement multi-send transaction command#11738
Conversation
| // {4A} / {8A} = {0A} | ||
| // {2A} / 0 = panics | ||
| // Note, if IsValid was true on Coins, IsValid stays true, | ||
| // unless the `divisor` is greater than the smallest coin amount. |
There was a problem hiding this comment.
I am uncertain if we actually want this behavior, but I created these helpers function for avoiding having to do for every coin:
sendCoins := coins
if split && !coins.IsZero() {
sendCoins[0].Amount = coins[0].Amount.Quo(totalAddr)
}If you find this better, then I can modify it and remove the changes in coins.
alexanderbez
left a comment
There was a problem hiding this comment.
Nice work! What happens when --split is provided/true, but doesn't have a fully divisible amount? One of the outputs is rounded, correct?
Thanks for all the feedback :) Yes, that's why we need to multiply from |
26e5d22 to
51ed808
Compare
alexanderbez
left a comment
There was a problem hiding this comment.
@julienrbrt I completely forgot. We need to add a test to x/bank/client/testutil 👍
Codecov Report
@@ Coverage Diff @@
## main #11738 +/- ##
==========================================
+ Coverage 65.94% 66.02% +0.07%
==========================================
Files 669 669
Lines 70427 70599 +172
==========================================
+ Hits 46444 46613 +169
- Misses 21312 21316 +4
+ Partials 2671 2670 -1
|
|
@Mergifyio backport release/v0.46.x |
Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com> Co-authored-by: Anil Kumar Kammari <anil@vitwit.com> (cherry picked from commit 6a9b824) # Conflicts: # x/bank/client/cli/tx.go
✅ Backports have been createdDetails
|
Description
Closes: #7809
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!to the type prefix if API or client breaking changeCHANGELOG.mdReviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
!in the type prefix if API or client breaking change