@@ -435,7 +435,7 @@ contract BasedAppManagerTest is Test, OwnableUpgradeable {
435435 vm.stopPrank ();
436436 }
437437
438- function testStrategyOptInToServiceWithETH () public {
438+ function testStrategyOptInToServiceWithETH () public {
439439 testCreateStrategy ();
440440 testRegisterServiceWithETH ();
441441 vm.startPrank (USER1);
@@ -552,22 +552,46 @@ contract BasedAppManagerTest is Test, OwnableUpgradeable {
552552 vm.stopPrank ();
553553 }
554554
555-
556555 function testCreateObligationETHAndDepositETH () public {
557556 testStrategyOptInToServiceWithETH ();
558557 vm.startPrank (USER1);
559- uint256 strategyTokenBalance = proxiedManager.strategyTokenBalances (1 , USER1, address (erc20mock));
558+ uint256 strategyTokenBalance = proxiedManager.strategyTokenBalances (1 , USER1, address (erc20mock));
560559 assertEq (strategyTokenBalance, 0 , "User strategy balance should be 0 " );
561560 proxiedManager.depositETH {value: 1 ether }(1 );
562561 strategyTokenBalance = proxiedManager.strategyTokenBalances (1 , USER1, ETH_ADDRESS);
563562 assertEq (strategyTokenBalance, 1 ether, "User strategy balance not matching " );
564563 vm.stopPrank ();
565564 }
566565
567- function testRevertDepositNonSupportedETHIntoStrategy () public {}
568- function testRevertObligationHigherThanMaxPercentage () public {}
569- function testCreateObligationToNonExistingServiceRevert () public {}
570- function testCreateObligationToNonExistingStrategyRevert () public {}
566+ function testRevertObligationHigherThanMaxPercentage () public {
567+ testStrategyOptInToService ();
568+ vm.startPrank (USER1);
569+ vm.expectRevert ("Invalid obligation percentage " );
570+ proxiedManager.createObligation (1 , SERVICE1, address (erc20mock2), 10_001 );
571+ uint256 strategyTokenBalance = proxiedManager.strategyTokenBalances (1 , USER1, address (erc20mock2));
572+ assertEq (strategyTokenBalance, 0 , "User strategy balance should be 0 " );
573+ vm.stopPrank ();
574+ }
575+
576+ function testCreateObligationToNonExistingServiceRevert () public {
577+ testStrategyOptInToService ();
578+ vm.startPrank (USER1);
579+ vm.expectRevert ("Service not opted-in " );
580+ proxiedManager.createObligation (1 , SERVICE2, address (erc20mock), 100 );
581+ uint256 strategyTokenBalance = proxiedManager.strategyTokenBalances (1 , USER1, address (erc20mock));
582+ assertEq (strategyTokenBalance, 0 , "User strategy balance should be 0 " );
583+ vm.stopPrank ();
584+ }
585+
586+ function testCreateObligationToNonExistingStrategyRevert () public {
587+ vm.startPrank (USER1);
588+ vm.expectRevert ("Not the strategy owner " );
589+ proxiedManager.createObligation (3 , SERVICE1, address (erc20mock), 100 );
590+ uint256 strategyTokenBalance = proxiedManager.strategyTokenBalances (1 , USER1, address (erc20mock));
591+ assertEq (strategyTokenBalance, 0 , "User strategy balance should be 0 " );
592+ vm.stopPrank ();
593+ }
594+
571595 function testCreateObligationToNotOwnedStrategyRevert () public {}
572596 function testWithdrawErc20FromStrategy () public {}
573597 function testWithdrawETHFromStrategy () public {}
@@ -597,7 +621,7 @@ contract BasedAppManagerTest is Test, OwnableUpgradeable {
597621 vm.stopPrank ();
598622 }
599623
600- function testRegisterServiceWithETH () public {
624+ function testRegisterServiceWithETH () public {
601625 vm.startPrank (USER1);
602626 address [] memory tokensInput = new address [](1 );
603627 tokensInput[0 ] = ETH_ADDRESS;
0 commit comments