@@ -508,6 +508,8 @@ contract MorphoLoopStrategyTest is StvStrategyPoolHarness {
508508 assertGt (posBefore.collateral, 0 , "Should have collateral " );
509509 assertGt (posBefore.borrowShares, 0 , "Should have debt " );
510510
511+ // Check Lido position before
512+
511513 // 3. Execute exit with 1% slippage tolerance
512514 MorphoLoopStrategy.LoopExitParams memory exitParams = MorphoLoopStrategy.LoopExitParams ({
513515 slippageBps: 100 // 1%
@@ -516,7 +518,9 @@ contract MorphoLoopStrategyTest is StvStrategyPoolHarness {
516518 vm.prank (USER1);
517519 bytes32 requestId = morphoStrategy.requestExitByWsteth (0 , abi.encode (exitParams));
518520
519- // 4. Verify position is closed
521+ // Check Lido position after.
522+
523+ // 4. Verify Morpho position is closed
520524 Position memory posAfter = morpho.position (marketId, user1StrategyCallForwarder);
521525 console.log ("Position after exit: " );
522526 console.log (" Collateral: " , posAfter.collateral);
@@ -527,16 +531,37 @@ contract MorphoLoopStrategyTest is StvStrategyPoolHarness {
527531
528532 // 5. Verify withdrawal request created
529533 console.log ("Withdrawal request ID: " , uint256 (requestId));
534+ assertEq (uint256 (requestId), 1 , "withdraw request ID should be 1 " );
530535 // Note: requestId will be bytes32(0) if pool withdrawal wasn't needed
536+
537+ // Get the call forwarder address for USER1.
538+ IStrategyCallForwarder callForwarder = morphoStrategy.getStrategyCallForwarderAddress (USER1);
539+
540+ // Check that we have a pending withdrawal request in the withdrawal queue.
541+ uint256 [] memory withdrawals = withdrawalQueue.withdrawalRequestsOf (USER1);
542+ assertEq (withdrawals.length , 1 , "withdrawal queue should have 1 withdrawal request " );
543+ assertEq (withdrawals[0 ], 1 , "the withdrawal should have ID 1 " );
544+
545+ // Withdrawal queue data
546+ WithdrawalQueue.WithdrawalRequestStatus memory withdrawalStatus = withdrawalQueue.getWithdrawalStatus (
547+ withdrawals[0 ]
548+ );
549+ console.log ("amountOfStv: " , withdrawalStatus.amountOfStv);
550+ console.log ("amountOfStethShares: " , withdrawalStatus.amountOfStethShares);
551+ console.log ("amountOfAssets: " , withdrawalStatus.amountOfAssets);
552+ console.log ("owner: " , withdrawalStatus.owner);
553+ console.log ("timestamp: " , withdrawalStatus.timestamp);
554+ console.log ("isFinalized: " , withdrawalStatus.isFinalized);
555+ console.log ("isClaimed: " , withdrawalStatus.isClaimed);
531556 }
532557
533558 /**
534- * @notice Test that onMorphoRepay reverts when called by non-Morpho
559+ * @notice Test that onMorphoRepay reverts when called without active context
535560 */
536- function test_revert_onMorphoRepay_only_morpho () public {
537- console.log ("\n=== Test: onMorphoRepay Only Morpho === " );
561+ function test_revert_onMorphoRepay_no_context () public {
562+ console.log ("\n=== Test: onMorphoRepay No Context === " );
538563
539- vm.expectRevert (MorphoLoopStrategy.UnauthorizedCallback .selector );
564+ vm.expectRevert (MorphoLoopStrategy.NoActiveContext .selector );
540565 morphoStrategy.onMorphoRepay (1 ether, "" );
541566 }
542567
@@ -546,9 +571,7 @@ contract MorphoLoopStrategyTest is StvStrategyPoolHarness {
546571 function test_revert_exit_no_position () public {
547572 console.log ("\n=== Test: Exit Reverts With No Position === " );
548573
549- MorphoLoopStrategy.LoopExitParams memory exitParams = MorphoLoopStrategy.LoopExitParams ({
550- slippageBps: 100
551- });
574+ MorphoLoopStrategy.LoopExitParams memory exitParams = MorphoLoopStrategy.LoopExitParams ({slippageBps: 100 });
552575
553576 vm.prank (USER1);
554577 vm.expectRevert (MorphoLoopStrategy.InsufficientCollateral.selector );
0 commit comments