Skip to content

Commit 0fd7fd0

Browse files
test: complete initial
1 parent dd5c1fd commit 0fd7fd0

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

.husky/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
npm run format
22

3-
solhint 'src/**/*.sol'
3+
npm run lint:solhint
44

55
npm run test-coverage

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"gas-report": "forge test -vvvv --gas-report",
1010
"generate-docs": "solc --include-path node_modules --base-path . --combined-json userdoc,devdoc src/BasedAppManager.sol --output-dir ./docs --overwrite",
1111
"prepare": "husky",
12+
"lint:solhint": "solhint './src/**/*.sol'",
1213
"test": "forge test -vvvv",
1314
"test-coverage": "forge coverage",
1415
"verify-implementation": "forge verify-contract --chain holesky $IMPLEMENTATION_ADDRESS src/BasedAppManager.sol:BasedAppManager --etherscan-api-key $ETHERSCAN_API_KEY"

test/BasedAppManager.t.sol

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -612,9 +612,18 @@ contract BasedAppManagerTest is Test, OwnableUpgradeable {
612612
vm.stopPrank();
613613
}
614614

615-
function testWithdrawETHFromStrategy() public {}
615+
function testWithdrawETHFromStrategy() public {
616+
testStrategyOwnerDepositETHWithNoObligation();
617+
vm.startPrank(USER1);
618+
uint256 strategyTokenBalance = proxiedManager.strategyTokenBalances(1, USER1, ETH_ADDRESS);
619+
assertEq(strategyTokenBalance, 1 ether, "User strategy balance should be 1 ether");
620+
proxiedManager.fastWithdrawETH(1, 0.4 ether);
621+
strategyTokenBalance = proxiedManager.strategyTokenBalances(1, USER1, ETH_ADDRESS);
622+
assertEq(strategyTokenBalance, 0.6 ether, "User strategy balance should be 0.6 ether");
623+
vm.stopPrank();
624+
}
625+
616626
function testUpdateStrategy() public {}
617-
function testRevertObligationWithNonMatchingToken() public {}
618627

619628
// ********************
620629
// ** Section: bApps **

0 commit comments

Comments
 (0)