-
Notifications
You must be signed in to change notification settings - Fork 33
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
feat: track installed modules #138
feat: track installed modules #138
Conversation
@kopy-kat looks like they made some changes to forge fmt recently which causes the lint ci to fail, not sure if it's a good idea to push the formatted repo changes within this pr (the forge fmt diff is pretty big) |
Ah ok, good shout - lets leave it unformatted. And I will format in a separate PR. Should I already review this pr or are you still working on it? |
@kopy-kat Yeah should be ready for review, currently the tests are skipped for Kernel (we would have to update dependency to their dev branch for the tests to pass) |
test/Diff.t.sol
Outdated
InstalledModule[] memory modules = instance.getInstalledModules(); | ||
AccountType env = ModuleKitHelpers.getAccountType(); | ||
assertTrue(modules.length == (env == AccountType.SAFE ? 3 : 2)); | ||
uint256 expectedIndex = env == AccountType.SAFE ? 1 : 0; | ||
assertTrue( | ||
modules[expectedIndex].moduleAddress == newValidator | ||
&& modules[expectedIndex + 1].moduleAddress == newValidator1 | ||
&& modules[expectedIndex].moduleType == MODULE_TYPE_VALIDATOR | ||
&& modules[expectedIndex + 1].moduleType == MODULE_TYPE_VALIDATOR | ||
); |
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.
it looks like a lot of this code is reused a few times - could we add an internal func here to make it more readable?
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.
done in refactor(getModulesAndAssert): move logic to reusable function, lmk if you had a different approach in mind. I wanted to remove as much lines as possible from the actuals tests so I had to abi.encode
the params because you can't inline pass memory arrays
this looks good to me, thanks! could you please merge from main and fix the conflicts before we merge |
ModuleInstalled(uint256, address)
andModuleUninstalled(uint256, address)
eventswriteInstalledModule()
, when a module is uninstalled it is removed usingremoveInstalledModule()
.getInstalledModules()