GovernorHarness.sol 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. import "../../contracts/governance/Governor.sol";
  2. contract GovernorHarness is Governor {
  3. function isExecuted(uint256 proposalId) public view returns (bool) {
  4. return _proposals[proposalId].executed;
  5. }
  6. function isCanceled(uint256 proposalId) public view returns (bool) {
  7. return _proposals[proposalId].canceled;
  8. }
  9. mapping(uint256 => uint256) _quorum;
  10. function quorum(uint256 blockNumber) public view override virtual returns (uint256) {
  11. return _quorum[blockNumber];
  12. }
  13. mapping (address => mapping (uint256 => uint256)) _getVotes;
  14. function getVotes(address account, uint256 blockNumber) public view override virtual returns (uint256) {
  15. return _getVotes[account][blockNumber];
  16. }
  17. mapping (uint256 => bool) __quoromReached;
  18. function _quorumReached(uint256 proposalId) public view override virtual returns (bool) {
  19. return __quoromReached[proposalId];
  20. }
  21. mapping (uint256 => bool) __voteSucceeded;
  22. function _voteSucceeded(uint256 proposalId) public view override virtual returns (bool) {
  23. return __voteSucceeded[proposalId];
  24. }
  25. //string _COUNTING_MODE;
  26. function COUNTING_MODE() public pure override virtual returns (string memory) {
  27. return "dummy";
  28. }
  29. mapping(uint256 => mapping(address => bool)) _hasVoted;
  30. function hasVoted(uint256 proposalId, address account) public view override virtual returns (bool) {
  31. return _hasVoted[proposalId][account];
  32. }
  33. uint256 _votingDelay;
  34. function votingDelay() public view override virtual returns (uint256) {
  35. return _votingDelay;
  36. }
  37. uint256 _votingPeriod;
  38. function votingPeriod() public view override virtual returns (uint256) {
  39. return _votingPeriod;
  40. }
  41. function _countVote(
  42. uint256 proposalId,
  43. address account,
  44. uint8 support,
  45. uint256 weight
  46. ) internal override virtual {
  47. // havoc something
  48. }
  49. constructor(string memory name) Governor(name) {}
  50. }