added ghost and counter implementation for castWithReason and castBySig
This commit is contained in:
@ -120,8 +120,13 @@ contract GovernorHarness is Governor {
|
|||||||
string calldata reason
|
string calldata reason
|
||||||
) public virtual override returns (uint256) {
|
) public virtual override returns (uint256) {
|
||||||
address voter = _msgSender();
|
address voter = _msgSender();
|
||||||
counter_vote_power_by_id[proposalId] += _castVote(proposalId, voter, support, reason);
|
// 2)
|
||||||
return _castVote(proposalId, voter, support, reason);
|
ghost_vote_power_by_id[proposalId] = _castVote(proposalId, voter, support, reason);
|
||||||
|
|
||||||
|
// 1)
|
||||||
|
counter_vote_power_by_id[proposalId] += ghost_vote_power_by_id[proposalId];
|
||||||
|
|
||||||
|
return ghost_vote_power_by_id[proposalId];
|
||||||
}
|
}
|
||||||
|
|
||||||
function castVoteBySig(
|
function castVoteBySig(
|
||||||
@ -137,7 +142,12 @@ contract GovernorHarness is Governor {
|
|||||||
r,
|
r,
|
||||||
s
|
s
|
||||||
);
|
);
|
||||||
counter_vote_power_by_id[proposalId] += _castVote(proposalId, voter, support, "");
|
// 2)
|
||||||
return _castVote(proposalId, voter, support, "");
|
ghost_vote_power_by_id[proposalId] = _castVote(proposalId, voter, support, "");
|
||||||
|
|
||||||
|
// 1)
|
||||||
|
counter_vote_power_by_id[proposalId] += ghost_vote_power_by_id[proposalId];
|
||||||
|
|
||||||
|
return ghost_vote_power_by_id[proposalId];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user