Use hardhat-exposed to reduce the need for mocks (#3666)

Co-authored-by: Francisco <fg@frang.io>
This commit is contained in:
Hadrien Croubois
2023-01-03 15:38:13 +01:00
committed by GitHub
parent a81b0d0b21
commit c1d9da4052
190 changed files with 2297 additions and 4311 deletions

View File

@ -4,12 +4,10 @@ pragma solidity ^0.8.0;
import "../governance/utils/Votes.sol";
contract VotesMock is Votes {
abstract contract VotesMock is Votes {
mapping(address => uint256) private _balances;
mapping(uint256 => address) private _owners;
constructor(string memory name) EIP712(name, "1") {}
function getTotalSupply() public view returns (uint256) {
return _getTotalSupply();
}
@ -22,19 +20,15 @@ contract VotesMock is Votes {
return _balances[account];
}
function mint(address account, uint256 voteId) external {
function _mint(address account, uint256 voteId) internal {
_balances[account] += 1;
_owners[voteId] = account;
_transferVotingUnits(address(0), account, 1);
}
function burn(uint256 voteId) external {
function _burn(uint256 voteId) internal {
address owner = _owners[voteId];
_balances[owner] -= 1;
_transferVotingUnits(owner, address(0), 1);
}
function getChainId() external view returns (uint256) {
return block.chainid;
}
}