-
Notifications
You must be signed in to change notification settings - Fork 851
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(wevmos): make WEVMOS deposit and withdraw functions real no-ops and fix tests #2329
Conversation
Warning Rate Limit Exceeded@Vvaradinov has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 28 minutes and 12 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. WalkthroughThe recent updates focus on refining the handling of deposit and withdrawal events within the 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: 0
Configuration used: CodeRabbit UI
Files selected for processing (3)
- precompiles/werc20/integration_test.go (14 hunks)
- precompiles/werc20/tx.go (2 hunks)
- precompiles/werc20/werc20.go (1 hunks)
Additional comments: 18
precompiles/werc20/tx.go (2)
- 18-18: The
Deposit
function has been correctly updated to perform no operations, aligning with the PR objectives.- 25-25: The
Withdraw
function has been correctly updated to perform no operations, aligning with the PR objectives.precompiles/werc20/werc20.go (1)
- 117-120: The logic in the
Run
function correctly handles calls to theDeposit
andWithdraw
methods as no-ops, consistent with the PR objectives.precompiles/werc20/integration_test.go (15)
- 26-31: The introduction of
EventTypeDeposit
andEventTypeWithdrawal
constants is appropriate for handling event types in tests, improving readability and maintainability.- 104-104: The gas consumption check for the
Deposit
method correctly reflects its new no-op nature.- 117-117: The gas consumption check for the
Withdraw
method correctly reflects its new no-op nature.- 136-136: The balance check logic in the test case for calling with incomplete data correctly reflects the expected behavior.
- 152-152: The balance check logic in the test case for calling with short call data correctly reflects the expected behavior.
- 168-168: The balance check logic in the test case for calling with non-existing function correctly reflects the expected behavior.
- 182-182: The balance check logic in the test case for calling without call data and without amount correctly reflects the expected behavior.
- 197-197: The balance check logic in the test case for calling with short call data and without amount correctly reflects the expected behavior.
- 212-212: The balance check logic in the test case for calling with non-existing function and without amount correctly reflects the expected behavior.
- 242-242: The gas consumption comparison between the precompile and the original contract for the
Deposit
method is correctly set up in the test.- 261-261: The error handling comparison between the precompile and the original contract for the
Deposit
method with insufficient balance is correctly set up in the test.- 282-282: The balance reflection test for the
Deposit
method correctly compares the precompile and the original contract.- 318-318: The setup for the
Withdraw
method test by depositing into the WEVMOS contract is correctly implemented.- 328-328: The gas consumption comparison between the precompile and the original contract for the
Withdraw
method is correctly set up in the test.- 344-344: The error handling comparison between the precompile and the original contract for the
Withdraw
method is correctly set up in the test.
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)
- CHANGELOG.md (1 hunks)
- precompiles/werc20/integration_test.go (14 hunks)
Files skipped from review as they are similar to previous changes (1)
- precompiles/werc20/integration_test.go
Additional comments: 1
CHANGELOG.md (1)
- 73-73: The changelog entry correctly documents the change to the
wevmos
module, making thedeposit
andwithdraw
functions no-ops.
Description
This PR makes the
WEVMOS
precompiled contract functionswithdraw
anddeposit
real no-ops without emitting events or modifying the StateDB.Closes: XAP-103
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...
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...
Unreleased
section inCHANGELOG.md
Summary by CodeRabbit
werc20
package functionality by removing input parameters from theDeposit
andWithdraw
functions to streamline their operations.Deposit
andWithdraw
methods in thePrecompile
struct of thewerc20.go
file to no longer accept certain arguments, impacting WERC20 transaction behavior.