Skip to content
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

Added Policy State Getters #119

Closed

Conversation

Dhruv-Mishra
Copy link
Contributor

@Dhruv-Mishra Dhruv-Mishra commented Jan 14, 2025

Added Policy State Getters for the policies defined here

Related to issue: #109

@Dhruv-Mishra
Copy link
Contributor Author

Dhruv-Mishra commented Jan 14, 2025

Added dummy abi at the moment, if all else looks correct, will build and update with the actual ones as per the contracts in this branch

@Dhruv-Mishra Dhruv-Mishra marked this pull request as ready for review January 16, 2025 15:58
@Dhruv-Mishra
Copy link
Contributor Author

@kopy-kat, is there a contract already deployed on-chain for testing purposes? Or should I deploy one to write and validate tests for all the policies, or is it not necessary to add tests for these getters?

@kopy-kat
Copy link
Member

good question, to be honest if you can write tests for the getters and just check against empty values (to make sure it doesnt revert) that could be enough for now - but if you want to populate some data and then test against this then that would obvs also work

@Dhruv-Mishra
Copy link
Contributor Author

Dhruv-Mishra commented Jan 17, 2025

good question, to be honest if you can write tests for the getters and just check against empty values (to make sure it doesnt revert) that could be enough for now - but if you want to populate some data and then test against this then that would obvs also work

I have added some tests to check against empty values. I want to write more thorough tests but I think it would be better if I do it after the contracts are deployed.

I was unable to get the ABIs for the updated contract using forge build, or by compiling with solc. Therefore, for all policies except uni action policy, I am using the ABIs of the old contracts at the moment which have the same structure for the getter functions. I can either leave the ABIs out of this PR or update the ABIs for the updated contracts if I can get them.

I have also updated the PR to reflect the most recent update to the contracts.

@Dhruv-Mishra Dhruv-Mishra requested a review from kopy-kat January 19, 2025 21:28
@kopy-kat
Copy link
Member

the contracts are deployed on sepolia with the addresses here (for those that changed) or the addresses already in the sdk: #109

when you run forge build you should get the abis in the out folder - make sure to use the moar-policies branch and let me know if that still doesnt work for you

@Dhruv-Mishra
Copy link
Contributor Author

Dhruv-Mishra commented Jan 21, 2025

the contracts are deployed on sepolia with the addresses here (for those that changed) or the addresses already in the sdk: #109

when you run forge build you should get the abis in the out folder - make sure to use the moar-policies branch and let me know if that still doesnt work for you

It worked now.

In case anyone else encounters this:
The issue was in the test/mock/erc7679/UserOpBuilder.sol file. The import statement:

import "forge-std/Console2.sol";

was failing because the Node modules had the filename as console2.sol. Updating the import to:

import "forge-std/console2.sol";

fixed the issue.

I still get a lot of warnings when compiling the contracts, is that expected?

@kopy-kat
Copy link
Member

yeah warnings are fine

@Dhruv-Mishra
Copy link
Contributor Author

@kopy-kat Raised #122 with the new changes, closing this as the branch is divergent with main now and would require resolving all merge conflicts again.

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.

2 participants