@@ -76,7 +76,7 @@ contract ATokenVaultMerklRewardClaimerTest is ATokenVaultBaseTest {
7676 }
7777
7878 function testClaimMerklRewardsAndForwardPartialTokenToDestination () public {
79- // Context: 2 tokens will be rewarded, but only one will be forwarded to the destination.
79+ // Context: 2 tokens will be rewarded, but only one (the non-aToken) will be forwarded to the destination.
8080 _setMerklDistributor ();
8181
8282 uint256 amountOfATokenRewarded = 789 * 1e18 ;
@@ -127,8 +127,8 @@ contract ATokenVaultMerklRewardClaimerTest is ATokenVaultBaseTest {
127127 assertEq (_aDai.balanceOf (address (_vaultMerklRewardClaimer)), beforeBalanceOfAToken + amountOfATokenRewarded);
128128 }
129129
130- function testClaimMerklRewardsAndForwardFullTokenToDestination () public {
131- // Context: 2 tokens will be rewarded, and both will be forwarded to the destination.
130+ function testClaimMerklRewardsAndForwardFailsGivenATokenIsForwarded () public {
131+ // Context: 2 tokens will be rewarded, and both will be attempted to be forwarded to the destination.
132132 _setMerklDistributor ();
133133
134134 uint256 amountOfATokenRewarded = 789 * 1e18 ;
@@ -160,24 +160,10 @@ contract ATokenVaultMerklRewardClaimerTest is ATokenVaultBaseTest {
160160 rewardTokensToForward[0 ] = address (_aDai);
161161 rewardTokensToForward[1 ] = address (_dai);
162162 address destination = makeAddr ("destination " );
163-
164- // Check that the vault does not have any aDAI.
165- uint256 beforeBalanceOfAToken = _aDai.balanceOf (address (_vaultMerklRewardClaimer));
166- uint256 beforeBalanceOfDAI = _dai.balanceOf (address (_vaultMerklRewardClaimer));
167163
168- vm.expectEmit (true , true , false , true , address (_vaultMerklRewardClaimer));
169- emit IATokenVaultMerklRewardClaimer.MerklRewardsClaimed (address (_merklDistributor), mockRewardTokens, mockAmounts);
170- vm.expectEmit (true , true , false , true , address (_vaultMerklRewardClaimer));
171- emit IATokenVaultMerklRewardClaimer.MerklRewardsTokenForwarded (address (_dai), destination, amountOfDAIRewarded);
164+ vm.expectRevert (bytes ("CANNOT_FORWARD_ATOKEN " ));
172165 vm.prank (OWNER);
173166 _vaultMerklRewardClaimer.claimMerklRewards (mockRewardTokens, mockAmounts, proofs, rewardTokensToForward, destination);
174-
175- // Check that the destination received the DAI and aDAI.
176- assertEq (_dai.balanceOf (destination), amountOfDAIRewarded);
177- assertEq (_aDai.balanceOf (destination), amountOfATokenRewarded);
178- // Check that the vault did not hold onto the aDAI and DAI.
179- assertEq (_aDai.balanceOf (address (_vaultMerklRewardClaimer)), beforeBalanceOfAToken);
180- assertEq (_dai.balanceOf (address (_vaultMerklRewardClaimer)), beforeBalanceOfDAI);
181167 }
182168
183169 function testClaimMerklRewardsIfATokenIsRewarded () public {
0 commit comments