diff --git a/test/LlamaPeripheryTestSetup.sol b/test/LlamaPeripheryTestSetup.sol index 9065215..2289f6c 100644 --- a/test/LlamaPeripheryTestSetup.sol +++ b/test/LlamaPeripheryTestSetup.sol @@ -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); + } } diff --git a/test/token-voting/ERC20TokenholderActionCreator.t.sol b/test/token-voting/ERC20TokenholderActionCreator.t.sol index 51686d3..d2891bb 100644 --- a/test/token-voting/ERC20TokenholderActionCreator.t.sol +++ b/test/token-voting/ERC20TokenholderActionCreator.t.sol @@ -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 { diff --git a/test/token-voting/LlamaTokenVotingTestSetup.sol b/test/token-voting/LlamaTokenVotingTestSetup.sol index c6aeb9c..588ac85 100644 --- a/test/token-voting/LlamaTokenVotingTestSetup.sol +++ b/test/token-voting/LlamaTokenVotingTestSetup.sol @@ -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(); + } }