Skip to content

Commit

Permalink
test: add branch test
Browse files Browse the repository at this point in the history
  • Loading branch information
QEDK committed May 3, 2024
1 parent ae4d4bd commit 0fad492
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/StakedAvailTest.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,15 @@ contract StakedAvailTest is StdUtils, Test {
stakedAvail.updateAssets(0);
}

function testRevertInvalidUpdateDelta_updateAssets(uint248 assets) external {
vm.assume(assets != 0);
vm.prank(owner);
stakedAvail.forceUpdateAssets(assets);
vm.prank(updater);
vm.expectRevert(IStakedAvail.InvalidUpdate.selector);
stakedAvail.updateAssets(-int256(int248(assets)));
}

function test_updateAssets(uint248 assets, int240 delta) external {
vm.assume(delta != 0 && assets != 0);
vm.assume(uint256(assets) > uint256(int256(delta)));
Expand Down

0 comments on commit 0fad492

Please sign in to comment.