diff --git a/src/token-voting/LlamaTokenHolderCaster.sol b/src/token-voting/LlamaTokenHolderCaster.sol index 303036d..fa7e660 100644 --- a/src/token-voting/LlamaTokenHolderCaster.sol +++ b/src/token-voting/LlamaTokenHolderCaster.sol @@ -287,7 +287,7 @@ abstract contract LlamaTokenHolderCaster is Initializable { if (votesFor <= votesAgainst) revert ForDoesNotSurpassAgainst(votesFor, votesAgainst); casts[actionInfo.id].approvalSubmitted = true; - llamaCore.castVote(role, actionInfo, ""); + llamaCore.castApproval(role, actionInfo, ""); emit ApprovalSubmitted(actionInfo.id, votesFor, votesAgainst, votesAbstain); } @@ -321,7 +321,7 @@ abstract contract LlamaTokenHolderCaster is Initializable { if (vetoesFor <= vetoesAgainst) revert ForDoesNotSurpassAgainst(vetoesFor, vetoesAgainst); casts[actionInfo.id].disapprovalSubmitted = true; - llamaCore.castVeto(role, actionInfo, ""); + llamaCore.castDisapproval(role, actionInfo, ""); emit DisapprovalSubmitted(actionInfo.id, vetoesFor, vetoesAgainst, vetoesAbstain); } diff --git a/test/token-voting/ERC20TokenholderCaster.t.sol b/test/token-voting/ERC20TokenholderCaster.t.sol index b85c640..132aafb 100644 --- a/test/token-voting/ERC20TokenholderCaster.t.sol +++ b/test/token-voting/ERC20TokenholderCaster.t.sol @@ -312,7 +312,7 @@ contract CastApprovalBySig is LlamaERC20TokenHolderCasterTest { (uint8 v, bytes32 r, bytes32 s) = createOffchainSignature(actionInfo, tokenHolder1PrivateKey); vm.prank(tokenHolder1); - llamaERC20TokenHolderCaster.incrementNonce(ILlamaCore.castVoteBySig.selector); + llamaERC20TokenHolderCaster.incrementNonce(ILlamaCore.castApprovalBySig.selector); // Invalid Signature error since the recovered signer address during the call is not the same as // erc20VotesTokenholder since nonce has increased. @@ -460,9 +460,9 @@ contract CastDisapprovalBySig is LlamaERC20TokenHolderCasterTest { function test_CheckNonceIncrements() public { (uint8 v, bytes32 r, bytes32 s) = createOffchainSignature(actionInfo, tokenHolder1PrivateKey); - assertEq(llamaERC20TokenHolderCaster.nonces(tokenHolder1, ILlamaCore.castVetoBySig.selector), 0); + assertEq(llamaERC20TokenHolderCaster.nonces(tokenHolder1, ILlamaCore.castDisapprovalBySig.selector), 0); castDisapprovalBySig(actionInfo, v, r, s); - assertEq(llamaERC20TokenHolderCaster.nonces(tokenHolder1, ILlamaCore.castVetoBySig.selector), 1); + assertEq(llamaERC20TokenHolderCaster.nonces(tokenHolder1, ILlamaCore.castDisapprovalBySig.selector), 1); } function test_OperationCannotBeReplayed() public { @@ -497,7 +497,7 @@ contract CastDisapprovalBySig is LlamaERC20TokenHolderCasterTest { (uint8 v, bytes32 r, bytes32 s) = createOffchainSignature(actionInfo, tokenHolder1PrivateKey); vm.prank(tokenHolder1); - llamaERC20TokenHolderCaster.incrementNonce(ILlamaCore.castVetoBySig.selector); + llamaERC20TokenHolderCaster.incrementNonce(ILlamaCore.castDisapprovalBySig.selector); // Invalid Signature error since the recovered signer address during the second call is not the same as policyholder // since nonce has increased. @@ -571,7 +571,7 @@ contract SubmitApprovals is LlamaERC20TokenHolderCasterTest { function test_RevertsIf_InsufficientVotes() public { actionInfo = _createActionWithTokenVotingStrategy(tokenVotingStrategy); vm.warp(block.timestamp + (1 days * TWO_THIRDS_IN_BPS) / ONE_HUNDRED_IN_BPS); - vm.expectRevert(abi.encodeWithSelector(LlamaTokenHolderCaster.InsufficientVote.selector, 0, 75_000e18)); + vm.expectRevert(abi.encodeWithSelector(LlamaTokenHolderCaster.InsufficientVotes.selector, 0, 75_000e18)); llamaERC20TokenHolderCaster.submitApproval(actionInfo); } @@ -669,7 +669,7 @@ contract SubmitDisapprovals is LlamaERC20TokenHolderCasterTest { //TODO why add 1 here vm.warp(block.timestamp + 1 + (1 days * TWO_THIRDS_IN_BPS) / ONE_HUNDRED_IN_BPS); - vm.expectRevert(abi.encodeWithSelector(LlamaTokenHolderCaster.InsufficientVote.selector, 0, 75_000e18)); + vm.expectRevert(abi.encodeWithSelector(LlamaTokenHolderCaster.InsufficientVotes.selector, 0, 75_000e18)); llamaERC20TokenHolderCaster.submitDisapproval(actionInfo); } diff --git a/test/token-voting/ERC721TokenholderCaster.t.sol b/test/token-voting/ERC721TokenholderCaster.t.sol index e737925..ffa78b6 100644 --- a/test/token-voting/ERC721TokenholderCaster.t.sol +++ b/test/token-voting/ERC721TokenholderCaster.t.sol @@ -316,7 +316,7 @@ contract CastApprovalBySig is LlamaERC721TokenHolderCasterTest { (uint8 v, bytes32 r, bytes32 s) = createOffchainSignature(actionInfo, tokenHolder1PrivateKey); vm.prank(tokenHolder1); - llamaERC721TokenHolderCaster.incrementNonce(ILlamaCore.castVoteBySig.selector); + llamaERC721TokenHolderCaster.incrementNonce(ILlamaCore.castApprovalBySig.selector); // Invalid Signature error since the recovered signer address during the call is not the same as // erc20VotesTokenholder since nonce has increased. @@ -466,9 +466,9 @@ contract CastDisapprovalBySig is LlamaERC721TokenHolderCasterTest { function test_CheckNonceIncrements() public { (uint8 v, bytes32 r, bytes32 s) = createOffchainSignature(actionInfo, tokenHolder1PrivateKey); - assertEq(llamaERC721TokenHolderCaster.nonces(tokenHolder1, ILlamaCore.castVetoBySig.selector), 0); + assertEq(llamaERC721TokenHolderCaster.nonces(tokenHolder1, ILlamaCore.castDisapprovalBySig.selector), 0); castDisapprovalBySig(actionInfo, v, r, s); - assertEq(llamaERC721TokenHolderCaster.nonces(tokenHolder1, ILlamaCore.castVetoBySig.selector), 1); + assertEq(llamaERC721TokenHolderCaster.nonces(tokenHolder1, ILlamaCore.castDisapprovalBySig.selector), 1); } function test_OperationCannotBeReplayed() public { @@ -503,7 +503,7 @@ contract CastDisapprovalBySig is LlamaERC721TokenHolderCasterTest { (uint8 v, bytes32 r, bytes32 s) = createOffchainSignature(actionInfo, tokenHolder1PrivateKey); vm.prank(tokenHolder1); - llamaERC721TokenHolderCaster.incrementNonce(ILlamaCore.castVetoBySig.selector); + llamaERC721TokenHolderCaster.incrementNonce(ILlamaCore.castDisapprovalBySig.selector); // Invalid Signature error since the recovered signer address during the second call is not the same as policyholder // since nonce has increased. @@ -577,7 +577,7 @@ contract SubmitApprovals is LlamaERC721TokenHolderCasterTest { function test_RevertsIf_InsufficientVotes() public { actionInfo = _createActionWithTokenVotingStrategy(tokenVotingStrategy); vm.warp(block.timestamp + (1 days * TWO_THIRDS_IN_BPS) / ONE_HUNDRED_IN_BPS); - vm.expectRevert(abi.encodeWithSelector(LlamaTokenHolderCaster.InsufficientVote.selector, 0, 1)); + vm.expectRevert(abi.encodeWithSelector(LlamaTokenHolderCaster.InsufficientVotes.selector, 0, 1)); llamaERC721TokenHolderCaster.submitApproval(actionInfo); } @@ -675,7 +675,7 @@ contract SubmitDisapprovals is LlamaERC721TokenHolderCasterTest { //TODO why add 1 here vm.warp(block.timestamp + 1 + (1 days * TWO_THIRDS_IN_BPS) / ONE_HUNDRED_IN_BPS); - vm.expectRevert(abi.encodeWithSelector(LlamaTokenHolderCaster.InsufficientVote.selector, 0, 1)); + vm.expectRevert(abi.encodeWithSelector(LlamaTokenHolderCaster.InsufficientVotes.selector, 0, 1)); llamaERC721TokenHolderCaster.submitDisapproval(actionInfo); } diff --git a/test/token-voting/LlamaTokenVotingFactory.t.sol b/test/token-voting/LlamaTokenVotingFactory.t.sol index d4b4aed..5c110a3 100644 --- a/test/token-voting/LlamaTokenVotingFactory.t.sol +++ b/test/token-voting/LlamaTokenVotingFactory.t.sol @@ -79,11 +79,11 @@ contract DeployTokenVotingModule is LlamaTokenVotingFactoryTest { actionInfo = ActionInfo(actionId, coreTeam4, CORE_TEAM_ROLE, STRATEGY, address(tokenVotingFactory), 0, data); vm.prank(coreTeam1); - CORE.castVote(CORE_TEAM_ROLE, actionInfo, ""); + CORE.castApproval(CORE_TEAM_ROLE, actionInfo, ""); vm.prank(coreTeam2); - CORE.castVote(CORE_TEAM_ROLE, actionInfo, ""); + CORE.castApproval(CORE_TEAM_ROLE, actionInfo, ""); vm.prank(coreTeam3); - CORE.castVote(CORE_TEAM_ROLE, actionInfo, ""); + CORE.castApproval(CORE_TEAM_ROLE, actionInfo, ""); } function test_CanDeployERC20TokenVotingModule() public {