@@ -293,19 +293,36 @@ contract DN404MirrorTest is SoladyTest {
293293 assertEq (mirror.owner (), address (0 ));
294294 }
295295
296- function testPullOwnerWithOwnable () public {
297- MockDN404Ownable dnOwnable = new MockDN404Ownable ();
296+ function testAutomaticPullOwnerWithOwnable () public {
297+ MockDN404Ownable dnOwnable = new MockDN404Ownable (address ( 0 ) );
298298 dnOwnable.initializeDN404 (1000 , address (this ), address (mirror));
299+ assertEq (mirror.owner (), address (0 ));
300+ mirror.pullOwner ();
301+ assertEq (mirror.owner (), address (0 ));
302+
303+ dnOwnable.initializeOwner (address (this ));
304+ assertEq (mirror.owner (), address (0 ));
305+ mirror.pullOwner ();
306+ assertEq (mirror.owner (), address (this ));
307+
299308 address newOwner = address (123 );
300309 dnOwnable.transferOwnership (newOwner);
301310
302- assertEq (mirror.owner (), address (0 ));
303311 vm.expectEmit (true , true , true , true );
304- emit OwnershipTransferred (address (0 ), newOwner);
312+ emit OwnershipTransferred (address (this ), newOwner);
305313 mirror.pullOwner ();
306314 assertEq (mirror.owner (), newOwner);
307315 }
308316
317+ function testAutomaticPullOwnerWithOwnable2 () public {
318+ MockDN404Ownable dnOwnable = new MockDN404Ownable (address (this ));
319+ assertEq (mirror.owner (), address (0 ));
320+ vm.expectEmit (true , true , true , true );
321+ emit OwnershipTransferred (address (0 ), address (this ));
322+ dnOwnable.initializeDN404 (1000 , address (this ), address (mirror));
323+ assertEq (mirror.owner (), address (this ));
324+ }
325+
309326 function testFnSelectorNotRecognized () public {
310327 (bool success , bytes memory result ) =
311328 address (dn).call (abi.encodeWithSignature ("nonSupportedFunction123() " ));
0 commit comments