GovernorTimelockCompoundHarness.sol 1.9 KB

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