-
Notifications
You must be signed in to change notification settings - Fork 115
feat: remove x/authz dependency from precompiles #62
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
Conversation
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.
Looks good to me so far — the authz removal seems to be handled well.
I had one question while reviewing the test code, which I left as a comment.
Also, this is not directly related to the scope of your PR, but I noticed that some of the existing test cases don’t validate balance changes. For example, after a delete, there’s no assertion checking whether the delegator’s balance was reduced accordingly. Since the precompiled contract involves complex state transitions, I think it would be valuable to add more thorough state validation to ensure the transitions happen as expected.
This can probably be addressed in a separate PR, so just leaving this here for reference. I opened an issue to track it.
* feat(x/erc20): add allowance state * test(x/erc20): add unit test for Allowance * fix(x/erc20): add deleteAllowances method and modify genesis validation * fix(x/erc20): validation of SetAllowance/GetAllowance and InitGenesis * test(x/erc20) add test cases for UnsafeSetAllowance * chore: fix lint
fix owner == sender case
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.
I haven’t gone through everything yet, but from what I’ve seen so far in app.go and the ics20 precompile section, it looks good
I’ll continue the review when I have more time.
applied in dc225a2 |
vladjdk
left a comment
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, thanks for the work :)
chore: merge backport pr #62
* feat: remove authz dependency from precompiles except for erc20 * wip: feat(precompiles): remove x/authz dependency * test(precompiles): remove x/authz dependent test cases * feat: remove x/authz dependency from x/erc20 and werc20 precompile * fix(precompiles): modify contract interface and test contracts * fix(precompiles): remove unused authz related types and test utils * fix(precompiles): modify integration test of staking precompile * feat(x/erc20): add allowance state (cosmos#90) * feat(x/erc20): add allowance state * test(x/erc20): add unit test for Allowance * fix(x/erc20): add deleteAllowances method and modify genesis validation * fix(x/erc20): validation of SetAllowance/GetAllowance and InitGenesis * test(x/erc20) add test cases for UnsafeSetAllowance * chore: fix lint * wip: test: modify erc20 precompile tests * test: modify erc20 precompile tests * test(precompiles): �fix integration test fix owner == sender case * refactor(precompiles): remove authz dependent naming and comments * wip: test(x/vm): modify flashLoan test * test(x/vm): fix flashLoan integration test * fix: merge conflict * chore: fix lint * chore: fix lint * feat: remove authz keeper dependency from x/erc20 keeper * chore: fix lint * fix: increase consensusVersion of x/erc20 module * chore: udpate CHANGELOG.md * chore: update CHANGELOG.md * chore: add comments to StakingCaller solidity contract * fix: typo * fix: remove duplicated test case * fix: wrong args for ApprovalEvent * fix: wrong error message for test * refactor: refine code for staking precompile * fix: merge conflicts * refactor: change file name * refactor(testutil): move constants for test to testutil/constants package * refactor(erc20): InitGenesis * test(erc20): add genesis test case * fix(erc20): revert consensusVersion change * refactor(erc20): refactor keeper methods of Allowance state * test(testutil): fix test case and lint * wip: fix(precompiles/erc20): remove incompatible logic with ERC20 Specification * fix: add Approval event to transferFrom method and fix integration tests * fix: FlashLoan.sol contract * fix(x/erc20): allowance methods and test cases * test(precompiles): add test cases for erc20 precompile --------- Co-authored-by: Vlad <vladjdk@gmail.com>
Description
Removal of x/authz dependency on precompiles
Approve,Revoke,IncreaseAllowance,DecreaseAllowance,Allowance) and its usage.Allowancestate CRUD methods in x/erc20 moduleAllowancestate of x/erc20 module instead ofGrantstate of x/authz module for authorization methods (Approve,Revoke,IncreaseAllowance,DecreaseAllowance,Allowance)Closes: #47
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...
mainbranchReviewers 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...
Unreleasedsection inCHANGELOG.md