-
Notifications
You must be signed in to change notification settings - Fork 435
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
point propose test to V3 and move to foundry
- Loading branch information
1 parent
d211b97
commit 0c725c1
Showing
2 changed files
with
57 additions
and
88 deletions.
There are no files selected for viewing
57 changes: 57 additions & 0 deletions
57
packages/nouns-contracts/test/foundry/NounsDAOLogicV3/Propose.t.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// SPDX-License-Identifier: GPL-3.0 | ||
pragma solidity ^0.8.15; | ||
|
||
import 'forge-std/Test.sol'; | ||
import { NounsDAOLogicV3BaseTest } from './NounsDAOLogicV3BaseTest.sol'; | ||
|
||
contract ProposeTest is NounsDAOLogicV3BaseTest { | ||
address proposer = makeAddr('proposer'); | ||
|
||
function setUp() public override { | ||
super.setUp(); | ||
|
||
vm.prank(address(dao.timelock())); | ||
dao._setProposalThresholdBPS(1_000); | ||
|
||
for (uint256 i = 0; i < 10; i++) { | ||
mintTo(proposer); | ||
} | ||
} | ||
|
||
function testEmits_ProposalCreatedWithRequirements() public { | ||
address[] memory targets = new address[](1); | ||
targets[0] = makeAddr('target'); | ||
uint256[] memory values = new uint256[](1); | ||
values[0] = 42; | ||
string[] memory signatures = new string[](1); | ||
signatures[0] = 'some signature'; | ||
bytes[] memory calldatas = new bytes[](1); | ||
calldatas[0] = ''; | ||
|
||
uint256 updatablePeriodEndBlock = block.number + dao.proposalUpdatablePeriodInBlocks(); | ||
uint256 startBlock = updatablePeriodEndBlock + dao.votingDelay(); | ||
uint256 endBlock = startBlock + dao.votingPeriod(); | ||
|
||
vm.expectEmit(true, true, true, true); | ||
|
||
emit ProposalCreatedWithRequirements( | ||
1, | ||
proposer, | ||
new address[](0), | ||
targets, | ||
values, | ||
signatures, | ||
calldatas, | ||
startBlock, | ||
endBlock, | ||
updatablePeriodEndBlock, | ||
1, // prop threshold | ||
dao.minQuorumVotes(), | ||
'some description' | ||
); | ||
|
||
vm.prank(proposer); | ||
|
||
dao.propose(targets, values, signatures, calldatas, 'some description'); | ||
} | ||
} |
88 changes: 0 additions & 88 deletions
88
packages/nouns-contracts/test/governance/NounsDAO/V2/propose.test.ts
This file was deleted.
Oops, something went wrong.