Skip to content

Commit 0bc3ccf

Browse files
committed
fmt
1 parent 78ba58e commit 0bc3ccf

File tree

3 files changed

+31
-32
lines changed

3 files changed

+31
-32
lines changed

04 Advanced Foundry/DAO/src/Box.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ contract Box is Ownable {
1919
function getNumber() public view returns (uint256) {
2020
return s_number;
2121
}
22-
}
22+
}

04 Advanced Foundry/DAO/src/Timelock.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ contract Timelock is TimelockController {
88
constructor(uint256 minDelay, address[] memory proposers, address[] memory executors)
99
TimelockController(minDelay, proposers, executors, msg.sender)
1010
{}
11-
}
11+
}

04 Advanced Foundry/DAO/test/GovernorTest.t.sol

Lines changed: 29 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -47,50 +47,49 @@ contract GovernorTest is Test {
4747

4848
box = new Box();
4949
box.transferOwnership(address(timelock));
50-
5150
}
5251

5352
function testCantUpdateBoxWithoutGovernance() public {
54-
vm.expectRevert();
55-
box.store(1);
53+
vm.expectRevert();
54+
box.store(1);
5655
}
5756

5857
function testCanUpdateBoxWithGovernance() public {
59-
uint256 valueToStore = 12423;
60-
string memory description = "Store 12423 in the box";
61-
bytes memory encodedParams = abi.encodeWithSignature("store(uint256)", valueToStore);
58+
uint256 valueToStore = 12423;
59+
string memory description = "Store 12423 in the box";
60+
bytes memory encodedParams = abi.encodeWithSignature("store(uint256)", valueToStore);
6261

63-
address[] memory targets = new address[](1);
64-
uint256[] memory values = new uint256[](1);
65-
bytes[] memory calldatas = new bytes[](1);
62+
address[] memory targets = new address[](1);
63+
uint256[] memory values = new uint256[](1);
64+
bytes[] memory calldatas = new bytes[](1);
6665

67-
values[0] = 0;
68-
calldatas[0] = encodedParams;
69-
targets[0] = address(box);
66+
values[0] = 0;
67+
calldatas[0] = encodedParams;
68+
targets[0] = address(box);
7069

71-
uint256 proposalId = governor.propose(targets, values, calldatas, description);
72-
console.log("Proposal State:", uint256(governor.state(proposalId)));
70+
uint256 proposalId = governor.propose(targets, values, calldatas, description);
71+
console.log("Proposal State:", uint256(governor.state(proposalId)));
7372

74-
vm.warp(block.timestamp + VOTING_DELAY + 1);
75-
vm.roll(block.number + VOTING_DELAY + 1);
73+
vm.warp(block.timestamp + VOTING_DELAY + 1);
74+
vm.roll(block.number + VOTING_DELAY + 1);
7675

77-
console.log("Proposal State:", uint256(governor.state(proposalId)));
76+
console.log("Proposal State:", uint256(governor.state(proposalId)));
7877

79-
string memory reason = "I like this proposal";
80-
uint8 voteWay = 1; // 1 = For
81-
vm.prank(user);
82-
governor.castVoteWithReason(proposalId, voteWay, reason);
78+
string memory reason = "I like this proposal";
79+
uint8 voteWay = 1; // 1 = For
80+
vm.prank(user);
81+
governor.castVoteWithReason(proposalId, voteWay, reason);
8382

84-
vm.warp(block.timestamp + VOTING_PERIOD + 1);
85-
vm.roll(block.number + VOTING_PERIOD + 1);
83+
vm.warp(block.timestamp + VOTING_PERIOD + 1);
84+
vm.roll(block.number + VOTING_PERIOD + 1);
8685

87-
bytes32 descriptionHash = keccak256(abi.encodePacked(description));
88-
governor.queue(targets, values, calldatas, descriptionHash);
86+
bytes32 descriptionHash = keccak256(abi.encodePacked(description));
87+
governor.queue(targets, values, calldatas, descriptionHash);
8988

90-
vm.warp(block.timestamp + MIN_DELAY + 1);
91-
vm.roll(block.number + 1);
89+
vm.warp(block.timestamp + MIN_DELAY + 1);
90+
vm.roll(block.number + 1);
9291

93-
governor.execute(targets, values, calldatas, descriptionHash);
94-
assertEq(box.getNumber(), valueToStore);
92+
governor.execute(targets, values, calldatas, descriptionHash);
93+
assertEq(box.getNumber(), valueToStore);
9594
}
96-
}
95+
}

0 commit comments

Comments
 (0)