From 95f78097c603d92479d879004000523da1961b60 Mon Sep 17 00:00:00 2001 From: "A.L" Date: Fri, 23 Feb 2024 14:56:33 +0800 Subject: [PATCH] test: rawCall --- test/integration/Aave.t.sol | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/integration/Aave.t.sol b/test/integration/Aave.t.sol index f25e0a97..2203890f 100644 --- a/test/integration/Aave.t.sol +++ b/test/integration/Aave.t.sol @@ -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,