Make Votes._getVotingUnits view (#3225)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
This commit is contained in:
@ -207,5 +207,5 @@ abstract contract Votes is IVotes, Context, EIP712 {
|
||||
/**
|
||||
* @dev Must return the voting units held by an account.
|
||||
*/
|
||||
function _getVotingUnits(address) internal virtual returns (uint256);
|
||||
function _getVotingUnits(address) internal view virtual returns (uint256);
|
||||
}
|
||||
|
||||
@ -18,7 +18,7 @@ contract VotesMock is Votes {
|
||||
return _delegate(account, newDelegation);
|
||||
}
|
||||
|
||||
function _getVotingUnits(address account) internal virtual override returns (uint256) {
|
||||
function _getVotingUnits(address account) internal view virtual override returns (uint256) {
|
||||
return _balances[account];
|
||||
}
|
||||
|
||||
|
||||
@ -34,7 +34,7 @@ abstract contract ERC721Votes is ERC721, Votes {
|
||||
/**
|
||||
* @dev Returns the balance of `account`.
|
||||
*/
|
||||
function _getVotingUnits(address account) internal virtual override returns (uint256) {
|
||||
function _getVotingUnits(address account) internal view virtual override returns (uint256) {
|
||||
return balanceOf(account);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user