-
Notifications
You must be signed in to change notification settings - Fork 161
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: ics20 memo handler denom #2439
Conversation
WalkthroughThe recent updates introduce a new function to streamline the extraction of denominations from ICS20 token packets, enhancing the handling of source and destination data. This function is now utilized in various components to simplify denomination parsing. Additionally, adjustments have been made to method signatures to accommodate these changes, ensuring a more efficient process in managing IBC inflows and memo dispatching. Changes
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 as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Review Status
Actionable comments generated: 1
Configuration used: CodeRabbit UI
Files selected for processing (4)
- x/uibc/ics20.go (1 hunks)
- x/uibc/quota/quota.go (2 hunks)
- x/uibc/uics20/ibc_module.go (1 hunks)
- x/uibc/uics20/memo_handler.go (3 hunks)
Additional comments: 3
x/uibc/uics20/ibc_module.go (1)
- 60-60: The addition of the
packet
parameter to themh.onRecvPacket
call in theOnRecvPacket
method is correctly implemented and aligns with the changes made to accommodate the new denomination extraction functionality. Ensure that all calls tomh.onRecvPacket
throughout the codebase have been updated accordingly to include the new parameter.x/uibc/uics20/memo_handler.go (1)
- 37-44: > 📝 NOTE
This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [23-41]
The update to the
onRecvPacket
method signature to include thepacket ibcexported.PacketI
parameter is correctly implemented. This change enables the method to extract the denomination using theuibc.MustExtractDenomFromPacketOnRecv
function before dispatching memo messages. Ensure that:
- The
uibc.MustExtractDenomFromPacketOnRecv
function is used correctly and handles any potential errors gracefully.- All calls to
onRecvPacket
throughout the codebase have been updated to include the new parameter.x/uibc/quota/quota.go (1)
- 233-233: The modification to the
RecordIBCInflow
function to use theMustExtractDenomFromPacketOnRecv
function for extracting the denomination is correctly implemented. This change simplifies the logic related to denomination handling and ensures consistency in how denominations are extracted from IBC packets. Ensure that:
- The
MustExtractDenomFromPacketOnRecv
function is used correctly and any potential issues are handled appropriately.- The extracted denomination is correctly used in the subsequent logic of the
RecordIBCInflow
function.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2439 +/- ##
==========================================
- Coverage 75.38% 69.32% -6.07%
==========================================
Files 100 183 +83
Lines 8025 10777 +2752
==========================================
+ Hits 6050 7471 +1421
- Misses 1589 2696 +1107
- Partials 386 610 +224
|
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (3)
- x/uibc/ics20.go (1 hunks)
- x/uibc/quota/quota.go (2 hunks)
- x/uibc/uics20/memo_handler.go (3 hunks)
Files skipped from review as they are similar to previous changes (3)
- x/uibc/ics20.go
- x/uibc/quota/quota.go
- x/uibc/uics20/memo_handler.go
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (2)
- x/uibc/ics20.go (1 hunks)
- x/uibc/uics20/memo_handler.go (3 hunks)
Files skipped from review as they are similar to previous changes (2)
- x/uibc/ics20.go
- x/uibc/uics20/memo_handler.go
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.
LGTM
Description
When receiving an ibc denom, we need to correctly transform the
FungibleTokenPacketData.Denom
into the IBC Denom, as it is recorded in thex/leverage
.Summary by CodeRabbit