Fix Bank multi-denom for SDK v0.4x.x#97
Conversation
ysv
left a comment
There was a problem hiding this comment.
@ysv reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @masihyeganeh and @miladz68)
modules/bank/handle_msg.go line 64 at r1 (raw file):
} coins := strings.Split(coinString, ",")
so before cosmos v50 coin string had this format "10ucore,11usara-core123,100abc-core111" ? but now it produces 3 separate events instead ?
Do I understand it correctly ?
TxCorpi0x
left a comment
There was a problem hiding this comment.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @masihyeganeh, @miladz68, and @ysv)
modules/bank/handle_msg.go line 64 at r1 (raw file):
Previously, ysv (Yaroslav Savchuk) wrote…
so before cosmos v50 coin string had this format "10ucore,11usara-core123,100abc-core111" ? but now it produces 3 separate events instead ?
Do I understand it correctly ?
Yes, I replaced it with ParseCoinsNormalized which is an standard function for this purpose.
ysv
left a comment
There was a problem hiding this comment.
@ysv reviewed 1 of 1 files at r2, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @masihyeganeh and @miladz68)
miladz68
left a comment
There was a problem hiding this comment.
@miladz68 reviewed 1 of 1 files at r2, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @masihyeganeh)
Description
This pull request updates how coin strings are parsed and processed in the
updateBalanceForEventTypefunction in themodules/bank/handle_msg.gofile. The main improvement is adding support for handling multiple coins in a single event, which previously only supported one coin at a time.Parsing and handling multiple coins:
stringspackage, which is required for splitting the coin string.updateBalanceForEventTypeto split thecoinStringby commas and parse each coin individually, allowing the function to handle events with multiple coins.addressDenomSetaccordingly, ensuring all coins in the event are considered.Closes: #XXXX
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 changeThis change is