Skip to content

fix: reject blocked region withdraw receivers#1392

Merged
koelzen merged 2 commits into
mainfrom
marvin/fix-reject-blocked-region-withdraw-receivers
Jun 24, 2026
Merged

fix: reject blocked region withdraw receivers#1392
koelzen merged 2 commits into
mainfrom
marvin/fix-reject-blocked-region-withdraw-receivers

Conversation

@marvin-985

@marvin-985 marvin-985 commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Related Issues

  • Fixes #

Type of Change

  • feat New feature
  • fix Bug fix
  • refactor Internal refactor
  • docs Documentation only
  • test Test-only change
  • chore Build, tooling, or maintenance

Validation

  • make test
  • make lint
  • Manual verification completed
  • Not applicable

Validation Notes

Checklist

  • PR title follows Conventional Commits (for example: fix: avoid batch block key collisions)
  • I self-reviewed the diff
  • I updated tests for changed behavior, or explained why tests are not needed
  • I updated docs/comments if user-facing behavior or developer workflow changed
  • I regenerated protobuf / client artifacts if .proto or generated client files changed
  • I called out breaking changes, migrations, or operator impact below

Breaking Changes / Migration Notes

  • None

Additional Context

Summary by CodeRabbit

  • Bug Fixes
    • Withdrawals from a region are now blocked if the recipient address appears on the bank module’s blocked address list.
    • Added a test to verify blocked recipients cannot receive region treasury withdrawals, and that both the recipient and region treasury balances remain unchanged when the transfer is rejected.

@marvin-985 marvin-985 requested a review from koelzen June 24, 2026 08:36
@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro Plus

Run ID: ae085a00-9f6f-4924-b420-afda9d758b24

📥 Commits

Reviewing files that changed from the base of the PR and between 9df55b8 and b569344.

📒 Files selected for processing (1)
  • x/wstaking/keeper/msg_server_region.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • x/wstaking/keeper/msg_server_region.go

📝 Walkthrough

Walkthrough

WithdrawFromRegion now rejects blocked receiver addresses before sending funds. The test suite was updated with import alias changes, a block-height reference fix, and a new case that verifies the blocked-receiver error and unchanged balances.

Changes

Blocked Receiver Guard in WithdrawFromRegion

Layer / File(s) Summary
Blocked address guard
x/wstaking/keeper/msg_server_region.go
WithdrawFromRegion checks the receiver with bankKeeper.Extend().BlockedAddr(toAddr) and returns ErrUnauthorized when the address is blocked.
Withdrawal rejection tests
x/wstaking/keeper/msg_server_region_test.go
Adds authtypes, renames the wmint import alias to wminttypes, updates the existing height reference, and adds TestWithdrawFromRegionRejectsBlockedModuleReceiver to assert the blocked receiver failure and unchanged balances.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is only the template skeleton; it lacks a real summary, issue reference, change type, validation, and checklist details. Fill in the Summary, Related Issues, Type of Change, Validation/Notes, Checklist, and any impact notes with specific details about what changed and how it was tested.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely matches the main change: rejecting blocked withdraw receivers.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch marvin/fix-reject-blocked-region-withdraw-receivers

Comment @coderabbitai help to get the list of available commands.

@koelzen koelzen merged commit 4172c64 into main Jun 24, 2026
7 checks passed
@koelzen koelzen deleted the marvin/fix-reject-blocked-region-withdraw-receivers branch June 24, 2026 08:55
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.

[BUG BOUNTY] [Medium] [WStaking/WBank] Region treasury withdrawal can fund blocked module accounts

2 participants