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

Test governor upgrade for #5 #12

Merged
merged 27 commits into from
Jan 17, 2023
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
eac5a61
Set up and run one end-to-end test with the new Governor
apbendi Dec 19, 2022
dd4b4d6
Add fuzz seed to .env template to reduce RPC calls
davidlaprade Jan 12, 2023
98fb242
Generalize governorBravo token send test
davidlaprade Jan 12, 2023
d9069d1
Test that proposals can be defeated for the new governor
davidlaprade Jan 12, 2023
5dfd792
passQueueAndExecuteUpgradeProposal --> upgradeToBravoGovernor
davidlaprade Jan 12, 2023
470d880
Test that settings can be updated by new governor
davidlaprade Jan 12, 2023
ddd1c6a
Test mixed voting results
davidlaprade Jan 12, 2023
8e60173
Test that alpha votes don't affect bravo votes
davidlaprade Jan 13, 2023
659f149
s/governor/governorBravo/g
davidlaprade Jan 13, 2023
815c79b
scopelint
davidlaprade Jan 13, 2023
64f2a43
Cache fork requests
davidlaprade Jan 13, 2023
f10554f
Add a seed to fuzz deterministically in CI
davidlaprade Jan 13, 2023
b41f7ad
scopelint
davidlaprade Jan 16, 2023
cce8185
Troubleshoot CI
davidlaprade Jan 16, 2023
bc88087
Cycle CI fuzz seeds each week
davidlaprade Jan 16, 2023
4d58ea0
Bump fuzz tests in CI
davidlaprade Jan 16, 2023
629f1ca
Remove fuzz seed from .env.template
davidlaprade Jan 16, 2023
8d1ac76
Modify based on PR feedback
davidlaprade Jan 16, 2023
d7b4570
Foundry toolchain caches fork requests for us
davidlaprade Jan 16, 2023
adffed2
ci: test if manually creating cache dir solves the issue
mds1 Jan 17, 2023
3f56e3d
Fix coverage workflow
davidlaprade Jan 17, 2023
114ccca
Fix coverage workflow
davidlaprade Jan 17, 2023
751dc77
Revert "ci: test if manually creating cache dir solves the issue"
davidlaprade Jan 17, 2023
9a5c0f7
Revert "Foundry toolchain caches fork requests for us"
davidlaprade Jan 17, 2023
8f10d57
Use cached fork requests on coverage
davidlaprade Jan 17, 2023
b69b4eb
Modify based on PR feedback
davidlaprade Jan 17, 2023
4216a16
Update comment
davidlaprade Jan 17, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ jobs:
with:
version: nightly

# https://twitter.com/PaulRBerg/status/1611116650664796166
- name: Generate fuzz seed with 1 week TTL
run: >
echo "FOUNDRY_FUZZ_SEED=$(
echo $(($EPOCHSECONDS - $EPOCHSECONDS % 604800))
)" >> $GITHUB_ENV

- name: Run tests
run: forge test

Expand Down
6 changes: 3 additions & 3 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
verbosity = 3

[profile.ci]
fuzz = { runs = 5000 }
invariant = { runs = 1000 }
fuzz = { runs = 500 }
invariant = { runs = 500 }

[profile.lite]
fuzz = { runs = 50 }
fuzz = { runs = 50, seed = 1673481600 }
invariant = { runs = 10 }
# Speed up compilation and tests during development.
optimizer = false
Expand Down
12 changes: 6 additions & 6 deletions src/GitcoinGovernor.sol
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ contract GitcoinGovernor is
public
view
virtual
override (Governor, GovernorTimelockCompound)
override(Governor, GovernorTimelockCompound)
returns (bool)
{
return GovernorTimelockCompound.supportsInterface(interfaceId);
Expand All @@ -65,7 +65,7 @@ contract GitcoinGovernor is
public
view
virtual
override (Governor, GovernorSettings)
override(Governor, GovernorSettings)
returns (uint256)
{
return GovernorSettings.proposalThreshold();
Expand All @@ -76,7 +76,7 @@ contract GitcoinGovernor is
public
view
virtual
override (Governor, GovernorTimelockCompound)
override(Governor, GovernorTimelockCompound)
returns (ProposalState)
{
return GovernorTimelockCompound.state(proposalId);
Expand All @@ -96,7 +96,7 @@ contract GitcoinGovernor is
uint256[] memory values,
bytes[] memory calldatas,
bytes32 descriptionHash
) internal virtual override (Governor, GovernorTimelockCompound) {
) internal virtual override(Governor, GovernorTimelockCompound) {
return
GovernorTimelockCompound._execute(proposalId, targets, values, calldatas, descriptionHash);
}
Expand All @@ -107,7 +107,7 @@ contract GitcoinGovernor is
uint256[] memory values,
bytes[] memory calldatas,
bytes32 descriptionHash
) internal virtual override (Governor, GovernorTimelockCompound) returns (uint256) {
) internal virtual override(Governor, GovernorTimelockCompound) returns (uint256) {
return GovernorTimelockCompound._cancel(targets, values, calldatas, descriptionHash);
}

Expand All @@ -116,7 +116,7 @@ contract GitcoinGovernor is
internal
view
virtual
override (Governor, GovernorTimelockCompound)
override(Governor, GovernorTimelockCompound)
returns (address)
{
return GovernorTimelockCompound._executor();
Expand Down
Loading