From 8b67ebb8ddea0149fda3a96d557e21425724ad8d Mon Sep 17 00:00:00 2001 From: Brian Le Date: Fri, 16 Feb 2024 16:58:09 -0500 Subject: [PATCH] delete unused error and update tests --- contracts/distribution/PushDistributor.sol | 1 - test/distribution/PushDistributor.t.sol | 21 ++++++++++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/contracts/distribution/PushDistributor.sol b/contracts/distribution/PushDistributor.sol index 419cade4..cf080cc7 100644 --- a/contracts/distribution/PushDistributor.sol +++ b/contracts/distribution/PushDistributor.sol @@ -13,7 +13,6 @@ contract PushDistributor { event Distributed(Party party, IERC20 token, address[] members, uint256 amount); error NotEnoughETH(uint256 expectedAmount, uint256 receivedAmount); - error UnexpectedETH(uint256 amount); error WrongProposalId(uint256 proposalId); error WrongMembers(); error MembersNotSorted(); diff --git a/test/distribution/PushDistributor.t.sol b/test/distribution/PushDistributor.t.sol index 1c589c81..094309f5 100644 --- a/test/distribution/PushDistributor.t.sol +++ b/test/distribution/PushDistributor.t.sol @@ -298,7 +298,12 @@ contract PushDistributorTest is SetupPartyHelper { uint256 proposalId = _proposeAndPassProposal(proposal); - vm.expectRevert(); + vm.expectRevert( + abi.encodeWithSelector( + ArbitraryCallsProposal.ArbitraryCallFailedError.selector, + abi.encodeWithSelector(PushDistributor.WrongProposalId.selector, 2) + ) + ); _executeProposal(proposalId, proposal); } @@ -353,7 +358,12 @@ contract PushDistributorTest is SetupPartyHelper { uint256 proposalId = _proposeAndPassProposal(proposal); - vm.expectRevert(); + vm.expectRevert( + abi.encodeWithSelector( + ArbitraryCallsProposal.ArbitraryCallFailedError.selector, + abi.encodePacked(PushDistributor.MembersNotSorted.selector) + ) + ); _executeProposal(proposalId, proposal); } @@ -388,7 +398,12 @@ contract PushDistributorTest is SetupPartyHelper { uint256 proposalId = _proposeAndPassProposal(proposal); - vm.expectRevert(); + vm.expectRevert( + abi.encodeWithSelector( + ArbitraryCallsProposal.ArbitraryCallFailedError.selector, + abi.encodePacked(PushDistributor.WrongMembers.selector) + ) + ); _executeProposal(proposalId, proposal); // Add the last member back and pass