Remove unused return value and reuse helper function (#4588)
Co-authored-by: Francisco Giordano <fg@frang.io>
This commit is contained in:
@ -635,10 +635,7 @@ abstract contract Governor is Context, ERC165, EIP712, Nonces, IGovernor, IERC72
|
||||
string memory reason,
|
||||
bytes memory params
|
||||
) internal virtual returns (uint256) {
|
||||
ProposalState currentState = state(proposalId);
|
||||
if (currentState != ProposalState.Active) {
|
||||
revert GovernorUnexpectedProposalState(proposalId, currentState, _encodeStateBitmap(ProposalState.Active));
|
||||
}
|
||||
_validateStateBitmap(proposalId, _encodeStateBitmap(ProposalState.Active));
|
||||
|
||||
uint256 weight = _getVotes(account, proposalSnapshot(proposalId), params);
|
||||
_countVote(proposalId, account, support, weight, params);
|
||||
|
||||
@ -36,11 +36,10 @@ abstract contract Nonces {
|
||||
/**
|
||||
* @dev Same as {_useNonce} but checking that `nonce` is the next valid for `owner`.
|
||||
*/
|
||||
function _useCheckedNonce(address owner, uint256 nonce) internal virtual returns (uint256) {
|
||||
function _useCheckedNonce(address owner, uint256 nonce) internal virtual {
|
||||
uint256 current = _useNonce(owner);
|
||||
if (nonce != current) {
|
||||
revert InvalidAccountNonce(owner, current);
|
||||
}
|
||||
return current;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user