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

Commit

Permalink
test: add assume statement for preventing fuzz tests from using restr…
Browse files Browse the repository at this point in the history
…icted addresses (#504)

**Motivation:**

A fuzz test was failing because a restricted address was being used as a
parameter for authorizing a script.

**Modifications:**

Added assume statements so the core and policy contracts won't be used
as the script address parameter to `setScriptAuthorization`.

**Result:**

CI will pass.
  • Loading branch information
AustinGreen authored Dec 18, 2023
1 parent d54a09b commit bcf2331
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/llama-scripts/LlamaGovernanceScript.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,8 @@ contract CreateAccountAndSetRolePermissions is LlamaGovernanceScriptTest {

contract SetScriptAuthAndSetPermissions is LlamaGovernanceScriptTest {
function test_SetScriptAuthAndSetPermissions(address script, bool authorized) public {
vm.assume(script != address(mpCore));
vm.assume(script != address(mpPolicy));
LlamaGovernanceScript.NewRolePermissionsData[] memory newRolePermissionsData =
new LlamaGovernanceScript.NewRolePermissionsData[](2);

Expand Down

0 comments on commit bcf2331

Please sign in to comment.