diff --git a/src/L2VoteAggregator.sol b/src/L2VoteAggregator.sol index 581040ae..b4da128b 100644 --- a/src/L2VoteAggregator.sol +++ b/src/L2VoteAggregator.sol @@ -89,7 +89,7 @@ abstract contract L2VoteAggregator is EIP712 { /// @param _votingToken The token used to vote on proposals. /// @param _governorMetadata The `GovernorMetadata` contract that provides proposal information. /// @param _l1BlockAddress The address of the L1Block contract. - constructor(address _votingToken, address _governorMetadata, address _l1BlockAddress) { + constructor(address _votingToken, address _governorMetadata, address _l1BlockAddress) EIP712("L2VoteAggregator", "1") { VOTING_TOKEN = ERC20Votes(_votingToken); GOVERNOR_METADATA = L2GovernorMetadata(_governorMetadata); L1_BLOCK = IL1Block(_l1BlockAddress); @@ -237,6 +237,7 @@ abstract contract L2VoteAggregator is EIP712 { revert InvalidVoteType(); } emit VoteCast(voter, proposalId, support, weight, reason); + return weight; } function proposalVoteActive(uint256 proposalId) public view returns (bool active) { diff --git a/test/WormholeL2VoteAggregator.t.sol b/test/WormholeL2VoteAggregator.t.sol index 5164d298..26161444 100644 --- a/test/WormholeL2VoteAggregator.t.sol +++ b/test/WormholeL2VoteAggregator.t.sol @@ -122,7 +122,7 @@ contract L2VoteAggregatorTest is Constants, WormholeRelayerBasicTest { L1Block l1Block; bytes32 l2VoteAggregatorWormholeAddress; - event VoteCast(address indexed voter, uint256 proposalId, uint8 support, uint256 weight); + event VoteCast(address indexed voter, uint256 proposalId, uint8 support, uint256 weight, string reason); constructor() { setForkChains(TESTNET, L2_CHAIN.wormholeChainId, L1_CHAIN.wormholeChainId); @@ -238,7 +238,7 @@ contract CastVote is L2VoteAggregatorTest { vm.roll(l2Proposal.voteStart + 1); vm.expectEmit(); - emit VoteCast(address(this), 1, 0, _amount); + emit VoteCast(address(this), 1, 0, _amount, ""); l2VoteAggregator.castVote(1, L2VoteAggregator.VoteType.Against); (uint256 against,,) = l2VoteAggregator.proposalVotes(1); @@ -254,7 +254,7 @@ contract CastVote is L2VoteAggregatorTest { vm.roll(l2Proposal.voteStart + 1); vm.expectEmit(); - emit VoteCast(address(this), 1, 2, _amount); + emit VoteCast(address(this), 1, 2, _amount, ""); l2VoteAggregator.castVote(1, L2VoteAggregator.VoteType.Abstain); (,, uint256 abstain) = l2VoteAggregator.proposalVotes(1); @@ -271,7 +271,7 @@ contract CastVote is L2VoteAggregatorTest { vm.roll(l2Proposal.voteStart + 1); vm.expectEmit(); - emit VoteCast(address(this), 1, 1, _amount); + emit VoteCast(address(this), 1, 1, _amount, ""); l2VoteAggregator.castVote(1, L2VoteAggregator.VoteType.For); (, uint256 forVotes,) = l2VoteAggregator.proposalVotes(1);