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

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
0xrajath committed Dec 9, 2023
1 parent 797689c commit 4d72ca1
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 11 deletions.
19 changes: 19 additions & 0 deletions test/LlamaPeripheryTestSetup.sol
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,23 @@ contract LlamaPeripheryTestSetup is Test {
vm.roll(block.number + 1);
vm.warp(block.timestamp + 1);
}

function encodeStrategyConfigs(ILlamaRelativeStrategyBase.Config[] memory strategies)
internal
pure
returns (bytes[] memory encoded)
{
encoded = new bytes[](strategies.length);
for (uint256 i = 0; i < strategies.length; i++) {
encoded[i] = encodeStrategy(strategies[i]);
}
}

function encodeStrategy(ILlamaRelativeStrategyBase.Config memory strategy)
internal
pure
returns (bytes memory encoded)
{
encoded = abi.encode(strategy);
}
}
11 changes: 0 additions & 11 deletions test/token-voting/ERC20TokenholderActionCreator.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,6 @@ contract ERC20TokenholderActionCreatorTest is LlamaTokenVotingTestSetup, LlamaCo
})
);
}

function _setRolePermissionToTokenholderActionCreator() internal {
// Assign permission for `MockProtocol.pause` to the TokenholderActionCreator.
vm.prank(address(EXECUTOR));
POLICY.setRolePermission(
tokenVotingActionCreatorRole,
ILlamaPolicy.PermissionData(address(mockProtocol), PAUSE_SELECTOR, address(STRATEGY)),
true
);
vm.stopPrank();
}
}

// contract Constructor is ERC20TokenholderActionCreatorTest {
Expand Down
11 changes: 11 additions & 0 deletions test/token-voting/LlamaTokenVotingTestSetup.sol
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,15 @@ contract LlamaTokenVotingTestSetup is LlamaPeripheryTestSetup, DeployLlamaTokenV
return
(ERC721TokenholderActionCreator(erc721TokenholderActionCreator), ERC721TokenholderCaster(erc721TokenholderCaster));
}

function _setRolePermissionToTokenholderActionCreator() internal {
// Assign permission for `MockProtocol.pause` to the TokenholderActionCreator.
vm.prank(address(EXECUTOR));
POLICY.setRolePermission(
tokenVotingActionCreatorRole,
ILlamaPolicy.PermissionData(address(mockProtocol), PAUSE_SELECTOR, address(STRATEGY)),
true
);
vm.stopPrank();
}
}

0 comments on commit 4d72ca1

Please sign in to comment.