From cf87865716d12b77e74131f671eb62888b973225 Mon Sep 17 00:00:00 2001 From: Rajath Alex Date: Mon, 8 Apr 2024 13:07:33 -0400 Subject: [PATCH] test_RevertIf_NotDelegateCall --- .../LlamaRewardsClaimGuard.t.sol | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/test/rewards-claimer/LlamaRewardsClaimGuard.t.sol b/test/rewards-claimer/LlamaRewardsClaimGuard.t.sol index 370aa45..6bb925b 100644 --- a/test/rewards-claimer/LlamaRewardsClaimGuard.t.sol +++ b/test/rewards-claimer/LlamaRewardsClaimGuard.t.sol @@ -98,4 +98,23 @@ contract ValidateActionCreation is LlamaRewardsClaimGuardTest { ); CORE.createAction(CORE_TEAM_ROLE, STRATEGY, address(ACCOUNT), 0, data, ""); } + + function test_RevertIf_NotDelegateCall() public { + LlamaRewardsClaimAccountExtension.TargetData[] memory targetData = _setupClaimRewardsData(); + + bytes memory accountExtensionData = abi.encodeCall(LlamaRewardsClaimAccountExtension.claimRewards, (targetData)); + bytes memory data = + abi.encodeCall(ILlamaAccount.execute, (address(rewardsClaimAccountExtension), false, 0, accountExtensionData)); + + vm.prank(coreTeam1); + vm.expectRevert( + abi.encodeWithSelector( + LlamaRewardsClaimGuard.UnauthorizedCall.selector, + address(rewardsClaimAccountExtension), + LlamaRewardsClaimAccountExtension.claimRewards.selector, + false + ) + ); + CORE.createAction(CORE_TEAM_ROLE, STRATEGY, address(ACCOUNT), 0, data, ""); + } }