Skip to content

Commit

Permalink
test: rawCall
Browse files Browse the repository at this point in the history
  • Loading branch information
xenide committed Feb 23, 2024
1 parent 3a3396f commit 95f7809
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/integration/Aave.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -928,6 +928,24 @@ contract AaveIntegrationTest is BaseTest {
_manager.setThresholds(uint128(lThreshold), lUpperThreshold);
}

function testRawCall_OnlyOwner() public allNetworks {
// act & assert
uint256 lMintAmt = 500;
_manager.rawCall(address(_tokenA), abi.encodeCall(_tokenA.mint, (address(this), lMintAmt)), 0);
assertEq(_tokenA.balanceOf(address(this)), lMintAmt);
}

function testRawCall_NotOwner(address aCaller) public allNetworks {
// assume
vm.assume(aCaller != address(this));

// act & assert
vm.prank(aCaller);
vm.expectRevert("UNAUTHORIZED");
uint256 lMintAmt = 500;
_manager.rawCall(address(_tokenA), abi.encodeCall(_tokenA.mint, (address(this), lMintAmt)), 0);
}

function testThresholdToZero_Migrate(
uint256 aAmtToManage0,
uint256 aAmtToManage1,
Expand Down

0 comments on commit 95f7809

Please sign in to comment.