From 0041c5de86f7d559766988231b648dc8896e71bf Mon Sep 17 00:00:00 2001 From: Andrew Chiaramonte Date: Sun, 15 Dec 2024 22:28:20 -0500 Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20test=5FpayDebtWithUSDC=5FUnauthoriz?= =?UTF-8?q?ed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/PayDebt.t.sol | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/PayDebt.t.sol b/test/PayDebt.t.sol index 26676392..055e3b8d 100644 --- a/test/PayDebt.t.sol +++ b/test/PayDebt.t.sol @@ -28,6 +28,16 @@ contract PayDebtTest is Bootstrap { engine.payDebt({_accountId: ACCOUNT_ID, _amount: INITIAL_DEBT}); } + function test_payDebtWithUSDC_Unauthorized() public { + vm.startPrank(ACTOR); + + sUSD.approve(address(engine), INITIAL_DEBT); + + vm.expectRevert(abi.encodeWithSelector(IEngine.Unauthorized.selector)); + + engine.payDebtWithUSDC({_accountId: ACCOUNT_ID, _amount: INITIAL_DEBT, _zapMinAmountOut: 1}); + } + /// @custom:todo Get a debt position on Base to fork // function test_payDebt() public { // /// @dev on this block (266_832_048), ACCOUNT_ID has a debt value of INITIAL_DEBT