Skip to content
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

Pauser and renounceAdmin Drips tests #18

Merged
merged 10 commits into from
Dec 28, 2023
Merged

Pauser and renounceAdmin Drips tests #18

merged 10 commits into from
Dec 28, 2023

Conversation

jferas
Copy link
Contributor

@jferas jferas commented Nov 28, 2023

This PR contains test for testing manipulation (via governance) of the "pauser" and "renounceAdmin" related functions of the Drips protocol.
Additional PR(s) will test the ability (via governance) to change the "admin" of the Drips protocol.

test/RadworksDripsGovernance.t.sol Show resolved Hide resolved
_upgradeToBravoGovernor();
}

function _proposePassAndExecuteDripsProposal(string memory _description, bytes memory _callData)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this method necessary? It seems like a little less generic version of _queueAndVoteAndExecuteProposalWithBravoGovernor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also the ProposalBuilder could help with the array boilerplate neeed to setup proposals.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done: 0d211b9

test/RadworksDripsGovernance.t.sol Show resolved Hide resolved
src/interfaces/IDrips.sol Show resolved Hide resolved
src/interfaces/IDrips.sol Fixed Show fixed Hide fixed
@wildmolasses wildmolasses changed the title Pauser and renouncAdmin Drips tests Pauser and renounceAdmin Drips tests Dec 20, 2023
Copy link
Contributor

@wildmolasses wildmolasses left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, mostly nits.

just double checking, is the granting/revoking of pauser (and then the admin renouncement) the only functionality we need to test? if so, looks great.

foundry.toml Show resolved Hide resolved
@@ -57,25 +59,29 @@ abstract contract ProposalTest is RadworksGovernorTest {
// a cheat for fuzzing addresses that are payable only
// Why is this no longer in standard cheats? JJF
// see https://github.com/foundry-rs/foundry/issues/3631
function assumePayable(address addr) internal virtual {
(bool success,) = payable(addr).call{value: 0}("");
function assumePayable(address _addr) internal virtual {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: consistency may suggest an underscore prefix

vm.assume(success);
}

function _assumeReceiver(address _receiver) internal {
assumePayable(_receiver);
function assummeNotTimelock(address _addr) internal virtual {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: consistency may suggest an underscore prefix. Also, assume not assumme

test/RadworksDripsGovernance.t.sol Show resolved Hide resolved
test/RadworksDripsGovernance.t.sol Show resolved Hide resolved
@jferas
Copy link
Contributor Author

jferas commented Dec 20, 2023

looks good, mostly nits.

just double checking, is the granting/revoking of pauser (and then the admin renouncement) the only functionality we need to test? if so, looks great.

There is a separate PR for testing the changing of admin as well as upgrade of the Drips protocol

@jferas
Copy link
Contributor Author

jferas commented Dec 20, 2023

Added a commit that adds .DS_Store to .gitignore file for smoother MacOS git operations bf585a1

Copy link

Coverage after merging drips-tests into main will be

76.00%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
src
   RadworksGovernor.sol73.91%75%69.23%76%101, 126–127, 135, 138, 152, 203, 84

Copy link
Contributor

@wildmolasses wildmolasses left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm scraping the bottom of the barrel on my nits now. think this one's ready for merge


function testFuzz_grantedPauserCanPauseAndUnPause(address _newPauser) public {
_assumeNotTimelock(_newPauser);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: inconsistent newline

Suggested change

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in a PR farther up the stack, to avoid rebases related to test filename changes: 01e2252

@jferas jferas merged commit 1240370 into main Dec 28, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants