From 0e2bdd6d003066440d167c93dec2c9294b19dd71 Mon Sep 17 00:00:00 2001 From: Theo Date: Tue, 6 Jun 2023 13:57:07 -0700 Subject: [PATCH] Remove second voter: proposer can vote for proposal himself --- test/utils/Mock.sol | 6 ++---- test/utils/ProposalUtils.sol | 15 ++++++--------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/test/utils/Mock.sol b/test/utils/Mock.sol index 4144fa9..f3d0c00 100644 --- a/test/utils/Mock.sol +++ b/test/utils/Mock.sol @@ -12,9 +12,7 @@ contract Mock { address public constant TEST_STAKER_ADDRESS = 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266; uint256 public constant TEST_STAKER_PRIVATE_KEY = 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80; - // Two test accounts to create proposal and vote for it - uint256 public constant TEST_PRIVATE_KEY_ONE = 0x66ddbd7cbe4a566df405f6ded0b908c669f88cdb1656380c050e3a457bd21df0; - uint256 public constant TEST_PRIVATE_KEY_TWO = 0xa4c8c98120e77741a87a116074a2df4ddb20d1149069290fd4a3d7ee65c55064; + // Test account to create proposal and vote for it address public constant TEST_ADDRESS_ONE = 0x118251976c65AFAf291f5255450ddb5b6A4d8B88; - address public constant TEST_ADDRESS_TWO = 0x63aE7d90Eb37ca39FC62dD9991DbEfeE70673a20; + uint256 public constant TEST_PRIVATE_KEY_ONE = 0x66ddbd7cbe4a566df405f6ded0b908c669f88cdb1656380c050e3a457bd21df0; } diff --git a/test/utils/ProposalUtils.sol b/test/utils/ProposalUtils.sol index a2491a8..9828915 100644 --- a/test/utils/ProposalUtils.sol +++ b/test/utils/ProposalUtils.sol @@ -28,28 +28,25 @@ contract ProposalUtils is Utils { } function proposeAndVote(address proposalAddress) public returns (uint256) { - retrieveAndLockBalance(TEST_PRIVATE_KEY_ONE, TEST_ADDRESS_ONE, PROPOSAL_QOURUM_THRESHOLD); - retrieveAndLockBalance(TEST_PRIVATE_KEY_TWO, TEST_ADDRESS_TWO, 1 ether); + retrieveAndLockBalance(TEST_PRIVATE_KEY_ONE, TEST_ADDRESS_ONE, PROPOSAL_QOURUM_THRESHOLD + 1 ether); - /* ----------PROPOSER------------ */ + /* ----------PROPOSE------------ */ vm.startPrank(TEST_ADDRESS_ONE); uint256 proposalId = governance.propose(proposalAddress, PROPOSAL_DESCRIPTION); + /* ------------------------------ */ + // TIME-TRAVEL vm.warp(block.timestamp + 6 hours); + /* ------------VOTE-------------- */ + governance.castVote(proposalId, true); vm.stopPrank(); /* ------------------------------ */ - /* -------------VOTER-------------*/ - vm.startPrank(TEST_ADDRESS_TWO); - governance.castVote(proposalId, true); - vm.stopPrank(); - /* ------------------------------ */ - return proposalId; }