proposal-25-restore-rewards/test/MockProposal.sol

37 lines
1.2 KiB
Solidity
Raw Normal View History

// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
pragma experimental ABIEncoderV2;
import { ProposalUtils } from "./ProposalUtils.sol";
import { Proposal, IGovernance } from "./interfaces/IGovernance.sol";
import { TornadoStakingRewards } from "@root/TornadoStakingRewards.sol";
import { RestoreRewardsProposal } from "@root/Proposal.sol";
import { Test } from "@forge-std/Test.sol";
contract MockProposal is Test, ProposalUtils {
modifier executeCurrentProposalBefore() {
createAndExecuteProposal();
_;
}
2023-06-13 01:17:34 +03:00
function createAndVoteProposal() public returns (uint256) {
TornadoStakingRewards governanceStakingImplementation =
new TornadoStakingRewards(_governanceAddress, _tokenAddress, _relayerRegistryAddress);
RestoreRewardsProposal proposal = new RestoreRewardsProposal(address(governanceStakingImplementation));
2023-06-13 01:17:34 +03:00
uint256 proposalId = proposeAndVote(address(proposal));
return proposalId;
}
function createAndExecuteProposal() public {
uint256 proposalId = createAndVoteProposal();
waitUntilExecutable(proposalId);
IGovernance(_governanceAddress).execute(proposalId);
}
}