From 0eb2d6e97febc7f9263b27747a86b83f12dafdbf Mon Sep 17 00:00:00 2001 From: ChefMist <133624774+ChefMist@users.noreply.github.com> Date: Mon, 25 Mar 2024 10:43:30 +0800 Subject: [PATCH] test: handle testTransferFromWithApprovalFuzz with sender = address(this) --- test/VaultToken.t.sol | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/VaultToken.t.sol b/test/VaultToken.t.sol index 8ed1c722..5590db12 100644 --- a/test/VaultToken.t.sol +++ b/test/VaultToken.t.sol @@ -238,6 +238,9 @@ contract VaultTokenTest is Test { if (mintAmount == type(uint256).max) { assertEq(token.allowance(sender, address(this), currency), type(uint256).max); + } else if (sender == address(this)) { + /// if sender === address(this), transferFrom will not consume allowance + assertEq(token.allowance(sender, address(this), currency), mintAmount); } else { assertEq(token.allowance(sender, address(this), currency), mintAmount - transferAmount); }