rhinestonewtf / modulekit

Development Kit for building Smart Account Modules
https://docs.rhinestone.wtf/modulekit/
45 stars 26 forks source link

Allow simulation or account types to be declared in tests #114

Open kopy-kat opened 2 months ago

kopy-kat commented 2 months ago

Problem

Currently, users can simulate the ERC4337 rules by running SIMULATE=true forge test and run their test against different account implementations by running ACCOUNT_TYPE=SAFE forge test. However, sometimes this should be declared on a test level, for example when running to specifically check the erc4337 rules.

Solution

A way for a user to declare these settings in a foundry test script with a provided function

kopy-kat commented 2 months ago

https://github.com/rhinestonewtf/modulekit/pull/111 does some ground work on the multi-account side by storing the account type in the MultiAccountFactory. A function would only need to be able to write here. Simulation could likely have the same architecture as these functions: https://github.com/rhinestonewtf/modulekit/blob/main/src/test/utils/Log.sol