-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add CompoundGovernorVotesUpgradeable
#27
Add CompoundGovernorVotesUpgradeable
#27
Conversation
Pull Request Test Coverage Report for Build 11331411098Details
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't the CompoundGovernor.sol
contract need to import from and inherit from this new contract that knows how to call the COMP token's getPriorVotes
function?
Yes, it does. But I thought for this PR we can test the modified extension contract in isolation, so didn't want to do too much inheritance. We should definitely test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
/// @notice Retrieves the voting weight for a specific account at a given timepoint. | ||
/// @dev This function overrides the base _getVotes function to use Compound's getPriorVotes mechanism. | ||
/// @param _account The address of the account to check the voting weight for. | ||
/// @param _timepoint The block number at which to check the voting weight. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consistency nit
/// @param _timepoint The block number at which to check the voting weight. | |
/// @param _timepoint The timepoint at which to check the voting weight. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should keep it block number because the contract is COMP specific and it requires a block number. Would it be better if the variable name was also blockNumber
instead of timepoint
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at the natspec in the rest of the contract, it says timepoint
, not blockNumber
. So for consistency, i'm advocating for timepoint
. what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 8d5ee4c
assertEq(address(governorVotes.token()), address(COMP_TOKEN_ADDRESS)); | ||
} | ||
|
||
function test_Clock() public view { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can these test names better describe the functionality they're testing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in 7d6d4bc
762eaa3
to
7d6d4bc
Compare
closes #13