@@ -71,6 +71,8 @@ contract DynamicAccountTest is BaseTest {
7171
7272 bytes32 private uidCache = bytes32 ("random uid " );
7373
74+ address internal factoryImpl;
75+
7476 event AccountCreated (address indexed account , address indexed accountAdmin );
7577
7678 function _prepareSignature (IAccountPermissions.SignerPermissionRequest memory _req )
@@ -320,7 +322,7 @@ contract DynamicAccountTest is BaseTest {
320322 extensions[0 ] = defaultExtension;
321323
322324 // deploy account factory
323- address factoryImpl = address (new DynamicAccountFactory (extensions));
325+ factoryImpl = address (new DynamicAccountFactory (extensions));
324326 accountFactory = DynamicAccountFactory (
325327 address (
326328 payable (
@@ -339,6 +341,11 @@ contract DynamicAccountTest is BaseTest {
339341 Test: creating an account
340342 //////////////////////////////////////////////////////////////*/
341343
344+ function test_revert_initializeImplementation () public {
345+ vm.expectRevert ("Initializable: contract is already initialized " );
346+ DynamicAccountFactory (factoryImpl).initialize (deployer, "https://example.com " );
347+ }
348+
342349 /// @dev benchmark test for deployment gas cost
343350 function test_deploy_dynamicAccount () public {
344351 // Setting up default extension.
@@ -385,12 +392,12 @@ contract DynamicAccountTest is BaseTest {
385392 extensions[0 ] = defaultExtension;
386393
387394 // deploy account factory
388- address factoryImpl = address (new DynamicAccountFactory (extensions));
395+ address factoryImplementation = address (new DynamicAccountFactory (extensions));
389396 DynamicAccountFactory factory = DynamicAccountFactory (
390397 address (
391398 payable (
392399 new TWProxy (
393- factoryImpl ,
400+ factoryImplementation ,
394401 abi.encodeWithSignature ("initialize(address,string) " , deployer, "https://example.com " )
395402 )
396403 )
0 commit comments