-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: cherry pick neutron #191
Conversation
WalkthroughThe changes in this pull request enhance the testing framework and functionality of the bank module in the Cosmos SDK. New account addresses are introduced for multi-send test cases, improving the validation of coin transfers. Additionally, the Changes
Possibly related PRs
Suggested reviewers
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
@mantrachain-support your pull request is missing a changelog! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (2)
x/bank/app_test.go (2)
580-580
: Swap arguments inrequire.Equal
for clarityThe
require.Equal
function expects the expected value as the first argument and the actual value as the second. Currently,countTrackBeforeSend
(actual) is passed first andexpNextCount
(expected) second. Swapping them will improve the clarity of test failure messages.Apply this diff to swap the arguments:
require.NoError(t, err) - require.Equal(t, countTrackBeforeSend, expNextCount) + require.Equal(t, expNextCount, countTrackBeforeSend)
602-602
: Swap arguments inrequire.Equal
for clarityAs before, ensure that the
require.Equal
function has the expected value as the first argument and the actual value as the second. Swapping the arguments will improve the clarity of test failure messages.Apply this diff to swap the arguments:
expNextCount += 4 - require.Equal(t, countTrackBeforeSend, expNextCount) + require.Equal(t, expNextCount, countTrackBeforeSend)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
- x/bank/app_test.go (2 hunks)
- x/bank/keeper/send.go (1 hunks)
🔇 Additional comments (4)
x/bank/keeper/send.go (3)
167-179
: Addition ofBlockBeforeSend
andTrackBeforeSend
hooks inInputOutputCoins
The inclusion of
BlockBeforeSend
andTrackBeforeSend
hooks within the loop over outputs ensures that necessary restrictions are enforced and transactions are appropriately tracked for each output. This enhances the security and auditability of multi-send operations.
Line range hint
216-219
: Invocation ofBlockBeforeSend
inSendCoins
methodBy calling
BlockBeforeSend
before initiating the coin transfer in theSendCoins
method, you ensure that any sending restrictions are checked prior to the transfer. This is crucial for maintaining compliance and preventing unauthorized transactions.
Line range hint
227-229
: Inclusion ofTrackBeforeSend
insendCoins
methodAdding the
TrackBeforeSend
hook at the beginning of thesendCoins
method ensures that all transfers are properly tracked. This enhances the system's ability to audit and monitor transactions effectively.x/bank/app_test.go (1)
66-67
: New addressesaddr4
andaddr5
added correctlyThe new addresses
addr4
andaddr5
are properly initialized and follow the existing pattern.
Description
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.md
make lint
andmake test
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...
!
in the type prefix if API or client breaking changeSummary by CodeRabbit
New Features
Bug Fixes