Use hardhat-exposed to reduce the need for mocks (#3666)
Co-authored-by: Francisco <fg@frang.io>
This commit is contained in:
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user