Skip to content

refactor(x/bank): swap sendrestriction check in InputOutputCoins (backport #21976)#24053

Merged
technicallyty merged 9 commits into
release/v0.53.xfrom
mergify/bp/release/v0.53.x/pr-21976
Mar 25, 2025
Merged

refactor(x/bank): swap sendrestriction check in InputOutputCoins (backport #21976)#24053
technicallyty merged 9 commits into
release/v0.53.xfrom
mergify/bp/release/v0.53.x/pr-21976

Conversation

@mergify
Copy link
Copy Markdown
Contributor

@mergify mergify Bot commented Mar 18, 2025

Description

Closes: #23833


This PR switches the subUnlockedCoins and send restrictions checks in InputOutputCoins.
Users should always use a cache context anyway, but this resolves a footgun if someone forgets to.
I thought we already swapped those, as it was suggested once by Injective (cc @kakysha), and it came up again in a report.

As it is still a behavior change, we'll only backport this to 0.52. The current behavior shouldn't pose any issue to 0.50.


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, you can find examples of the prefixes below:

  • confirmed ! in the type prefix if API or client breaking change

  • targeted the correct branch (see PR Targeting)

  • provided a link to the relevant issue or specification

  • reviewed "Files changed" and left comments if necessary

  • included the necessary unit and integration tests

  • added a changelog entry to CHANGELOG.md

  • updated the relevant documentation or specification, including comments for documenting Go code

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

Please see Pull Request Reviewer section in the contributing guide for more information on how to review a pull request.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic, API design and naming, documentation is accurate, tests and test coverage

Summary by CodeRabbit

  • New Features

    • Introduced MsgBurn for burning coins.
    • Added support for application wiring with SendRestrictionFn.
  • Improvements

    • Enhanced transaction methods to return errors instead of panicking.
    • Improved validation checks for coin transactions.
  • Bug Fixes

    • Corrected SpendableBalances and SpendableCoins queries for accurate balance reporting.
  • API Breaking Changes

    • Updated method signatures for several functions, including BurnCoins and various balance query requests.
  • Tests

    • Expanded test coverage for the bank module, focusing on send and mint restrictions.

This is an automatic backport of pull request #21976 done by [Mergify](https://mergify.com).

)

(cherry picked from commit bb7d11d)

# Conflicts:
#	x/bank/CHANGELOG.md
#	x/bank/keeper/send.go
#	x/group/keeper/abci.go
@mergify mergify Bot added the conflicts label Mar 18, 2025
@mergify mergify Bot requested a review from a team March 18, 2025 21:15
@mergify
Copy link
Copy Markdown
Contributor Author

mergify Bot commented Mar 18, 2025

Cherry-pick of bb7d11d has failed:

On branch mergify/bp/release/v0.53.x/pr-21976
Your branch is up to date with 'origin/release/v0.53.x'.

You are currently cherry-picking commit bb7d11d07.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   x/bank/keeper/keeper_test.go

Unmerged paths:
  (use "git add/rm <file>..." as appropriate to mark resolution)
	deleted by us:   x/bank/CHANGELOG.md
	both modified:   x/bank/keeper/send.go
	deleted by us:   x/group/keeper/abci.go

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@github-actions

This comment was marked as outdated.

@technicallyty
Copy link
Copy Markdown
Member

i can pick this up and get it through the finish line if thats cool with you @julienrbrt

@julienrbrt
Copy link
Copy Markdown
Contributor

i can pick this up and get it through the finish line if thats cool with you @julienrbrt

Sure! Forgot about this one.

@technicallyty technicallyty marked this pull request as ready for review March 24, 2025 18:44
@technicallyty
Copy link
Copy Markdown
Member

updated the PR. please have a look!

@technicallyty technicallyty enabled auto-merge (squash) March 25, 2025 16:15
@technicallyty technicallyty disabled auto-merge March 25, 2025 20:58
@technicallyty technicallyty enabled auto-merge March 25, 2025 20:58
@technicallyty technicallyty added this pull request to the merge queue Mar 25, 2025
Merged via the queue into release/v0.53.x with commit 8a54f41 Mar 25, 2025
@technicallyty technicallyty deleted the mergify/bp/release/v0.53.x/pr-21976 branch March 25, 2025 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants