Commit 9c471694 by github-actions

Merge upstream master into patched/master

parents 14736bc3 f2a311dc
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
* `Governor`: Adds internal virtual `_getVotes` method that must be implemented; this is a breaking change for existing concrete extensions to `Governor`. To fix this on an existing voting module extension, rename `getVotes` to `_getVotes` and add a `bytes memory` argument. ([#3043](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3043)) * `Governor`: Adds internal virtual `_getVotes` method that must be implemented; this is a breaking change for existing concrete extensions to `Governor`. To fix this on an existing voting module extension, rename `getVotes` to `_getVotes` and add a `bytes memory` argument. ([#3043](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3043))
* `Governor`: Adds `params` parameter to internal virtual `_countVote ` method; this is a breaking change for existing concrete extensions to `Governor`. To fix this on an existing counting module extension, add a `bytes memory` argument to `_countVote`. ([#3043](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3043)) * `Governor`: Adds `params` parameter to internal virtual `_countVote ` method; this is a breaking change for existing concrete extensions to `Governor`. To fix this on an existing counting module extension, add a `bytes memory` argument to `_countVote`. ([#3043](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3043))
* `Governor`: Does not emit `VoteCast` event when params data is non-empty; instead emits `VoteCastWithParams` event. To fix this on an integration that consumes the `VoteCast` event, also fetch/monitor `VoteCastWithParams` events. ([#3043](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3043)) * `Governor`: Does not emit `VoteCast` event when params data is non-empty; instead emits `VoteCastWithParams` event. To fix this on an integration that consumes the `VoteCast` event, also fetch/monitor `VoteCastWithParams` events. ([#3043](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3043))
* `Votes`: The internal virtual function `_getVotingUnits` was made `view` (which was accidentally missing). Any overrides should now be updated so they are `view` as well.
## 4.5.0 (2022-02-09) ## 4.5.0 (2022-02-09)
......
...@@ -207,5 +207,5 @@ abstract contract Votes is IVotes, Context, EIP712 { ...@@ -207,5 +207,5 @@ abstract contract Votes is IVotes, Context, EIP712 {
/** /**
* @dev Must return the voting units held by an account. * @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 { ...@@ -18,7 +18,7 @@ contract VotesMock is Votes {
return _delegate(account, newDelegation); 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]; return _balances[account];
} }
......
...@@ -34,7 +34,7 @@ abstract contract ERC721Votes is ERC721, Votes { ...@@ -34,7 +34,7 @@ abstract contract ERC721Votes is ERC721, Votes {
/** /**
* @dev Returns the balance of `account`. * @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); return balanceOf(account);
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment