Skip to content

Conversation

@TxCorpi0x
Copy link

@TxCorpi0x TxCorpi0x commented Sep 3, 2025

Description

This pull request updates how coin strings are parsed and processed in the updateBalanceForEventType function in the modules/bank/handle_msg.go file. 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:

  • Updated the import section to include the strings package, which is required for splitting the coin string.
  • Modified the logic in updateBalanceForEventType to split the coinString by commas and parse each coin individually, allowing the function to handle events with multiple coins.
  • Adjusted the loop to process each parsed coin and update the addressDenomSet accordingly, 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...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch
  • provided a link to the relevant issue or specification
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

Reviewers 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...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

This change is Reviewable

@TxCorpi0x TxCorpi0x requested a review from a team as a code owner September 3, 2025 09:40
@TxCorpi0x TxCorpi0x requested review from masihyeganeh, miladz68 and ysv and removed request for a team September 3, 2025 09:40
Copy link

@ysv ysv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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 ?

Copy link
Author

@TxCorpi0x TxCorpi0x left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link

@ysv ysv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ysv reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @masihyeganeh and @miladz68)

Copy link

@miladz68 miladz68 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@miladz68 reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @masihyeganeh)

@TxCorpi0x TxCorpi0x merged commit eee0f63 into chains/coreum-v0.50.x Sep 8, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants