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

Initial tests and architecture #5

Merged
merged 15 commits into from
Dec 7, 2023
Merged

Initial tests and architecture #5

merged 15 commits into from
Dec 7, 2023

Conversation

jferas
Copy link
Contributor

@jferas jferas commented Nov 8, 2023

Initial tests and test architecture.

script/DeployInput.sol Outdated Show resolved Hide resolved
script/DeployInput.sol Outdated Show resolved Hide resolved
script/Propose.s.sol Outdated Show resolved Hide resolved
src/RadworksGovernor.sol Outdated Show resolved Hide resolved
script/DeployInput.sol Show resolved Hide resolved
test/Constants.sol Outdated Show resolved Hide resolved
test/Constants.sol Outdated Show resolved Hide resolved
}
}

abstract contract Propose is ProposalTest {

Choose a reason for hiding this comment

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

This can be handled in a separate pr, but these tests seems to be testing the Alpha Governor rather than the RadworksGovernor. Maybe, reorganizing them could make this distinction clearer.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Created an issue for this: #6

test/helpers/ProposalTest.sol Show resolved Hide resolved
test/helpers/RadworksGovernorTest.sol Outdated Show resolved Hide resolved
Copy link

@alexkeating alexkeating left a comment

Choose a reason for hiding this comment

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

Looking good John my only feedback are some solidity version bumps


pragma solidity 0.8.20;
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.18;

Choose a reason for hiding this comment

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

It would be good to keep the minimum solidity version the same for these deploy files. So, ^0.8.20

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 3b3a686

@@ -0,0 +1,54 @@
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.18;

Choose a reason for hiding this comment

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

version bump

@@ -0,0 +1,22 @@
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.18;

Choose a reason for hiding this comment

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

Version bump

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 3b3a686

@@ -0,0 +1,176 @@
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.18;

Choose a reason for hiding this comment

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

Version bump

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 3b3a686

@@ -0,0 +1,26 @@
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.18;

Choose a reason for hiding this comment

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

Version bump

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 3b3a686

@@ -0,0 +1,336 @@
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.18;

Choose a reason for hiding this comment

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

Version bump

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 3b3a686

@@ -0,0 +1,70 @@
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.18;

Choose a reason for hiding this comment

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

Version bump

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 3b3a686

@@ -0,0 +1,14 @@
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.17;

Choose a reason for hiding this comment

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

Version bump

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 3b3a686

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.

hey @jferas, thank you. Got a few nits for you.

import {RadworksGovernor} from "src/RadworksGovernor.sol";
import {IGovernorAlpha} from "src/interfaces/IGovernorAlpha.sol";

contract Propose is Script {
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be nice to include some natspec on what purpose this script serves. It seems though that it'll be used to make 1 proposal specifically: the upgrade proposal. is that true? Further nitting, perhaps we should change the name to something like ProposeNewGovernor.s.sol. anyway, this shouldn't block merge, so i'll track in an issue, and from there we could ignore or PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added natspec: ce8bc2a

script/Propose.s.sol Outdated Show resolved Hide resolved
script/Propose.s.sol Outdated Show resolved Hide resolved
script/Propose.s.sol Outdated Show resolved Hide resolved
script/Propose.s.sol Outdated Show resolved Hide resolved
test/helpers/Proposal.sol Show resolved Hide resolved
test/helpers/RadworksGovernorTest.sol Outdated Show resolved Hide resolved
test/helpers/RadworksGovernorTest.sol Show resolved Hide resolved
test/helpers/ProposalTest.sol Outdated Show resolved Hide resolved
vm.assume(success);
}

function _assumeReceiver(address _receiver) internal {
Copy link
Contributor

Choose a reason for hiding this comment

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

love the comments in this section. it may be more explicit to name this method _assumeValidReceiver, but current works too

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was the name used in the PoolTogether code.. keeping for consistency with that.

assumeNoPrecompiles(_receiver);
}

function _randomERC20Token(uint256 _seed) internal pure returns (IERC20 _token) {
Copy link
Contributor

Choose a reason for hiding this comment

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

another name that i think is fine as-is, yet here i am trying to optimize. perhaps _selectERC20Token expresses more the fact we're pulling these from a list.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was the name used in the PoolTogether code.. keeping for consistency with that.

Copy link

Coverage after merging initial-tests into main will be

12.00%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
src
   RadworksGovernor.sol13.04%0%23.08%12%101, 106, 108, 113, 115, 126, 126, 126–127, 129, 131, 131, 131–133, 133, 133–135, 135, 135–136, 138, 152, 174, 192–193, 203, 214, 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.

did a review of just the changes made and they look good, so lgtm

@jferas i think it's worth reconsidering the "consistency with prior codebase" idea if we have a better name for something, but it's not merge blocking! Think this one's ready for merge.

@jferas jferas merged commit dd6c933 into main Dec 7, 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