-
Notifications
You must be signed in to change notification settings - Fork 12
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
Added Policy State Getters #119
Conversation
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 |
src/module/smart-sessions/policies/spending-limits-policy/usage.ts
Outdated
Show resolved
Hide resolved
src/module/smart-sessions/policies/spending-limits-policy/usage.ts
Outdated
Show resolved
Hide resolved
src/module/smart-sessions/policies/universal-action-policy/usage.ts
Outdated
Show resolved
Hide resolved
@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? |
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. |
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 |
It worked now. In case anyone else encounters this: 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? |
yeah warnings are fine |
Added Policy State Getters for the policies defined here
Related to issue: #109