Harness of castVoteWithReason to be able to impose requirement on the proposal ID

This commit is contained in:
Michael M
2021-11-16 18:32:38 +02:00
parent a16eaebb25
commit 5833f52879

View File

@ -109,13 +109,12 @@ contract GovernorHarness is Governor {
return super.propose(targets, values, calldatas, ""); return super.propose(targets, values, calldatas, "");
} }
uint256 public proposalid_global;
uint8 public support_global;
function castVoteWithReason(uint256 proposalId, // Harness of castVoteWithReason to be able to impose requirement on the proposal ID.
uint8 support, string calldata reason) public virtual override returns (uint256){ uint256 public _pId_Harness;
require(proposalId == proposalid_global); function castVoteWithReason(uint256 proposalId, uint8 support, string calldata reason)
require(support == support_global); public override returns (uint256) {
require(proposalId == _pId_Harness);
return super.castVoteWithReason(proposalId, support, reason); return super.castVoteWithReason(proposalId, support, reason);
} }
} }