Skip to content
This repository has been archived by the owner on Nov 27, 2024. It is now read-only.

Commit

Permalink
test_RevertIf_NotDelegateCall
Browse files Browse the repository at this point in the history
  • Loading branch information
0xrajath committed Apr 8, 2024
1 parent a4d9265 commit cf87865
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/rewards-claimer/LlamaRewardsClaimGuard.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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, "");
}
}

0 comments on commit cf87865

Please sign in to comment.