Skip to content

Commit

Permalink
fix delegation voting count (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
sirnicolaz authored May 10, 2024
1 parent 38d976b commit 7252a7c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions contracts/ResolutionManager/ResolutionManagerBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ abstract contract ResolutionManagerBase {
//if (!resolution.hasVoted[msg.sender]) {
// Did sender's delegate vote?
if (
!resolution.hasVoted[msg.sender] &&
resolution.hasVoted[delegate] &&
resolution.hasVotedYes[delegate]
) {
Expand Down
22 changes: 22 additions & 0 deletions test/Integration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,28 @@ describe("Integration", async () => {
expect(resolutionResult).equal(true);
});

it("bug #10", async () => {
await _makeContributor(user1, 65);
await _makeContributor(user2, 32);

await _delegate(user1, user2); // yesTotalVote == 33

const resolutionId = await _prepareResolution();
await _makeVotable(resolutionId);

await _vote(user1, false, resolutionId);
await _vote(user2, true, resolutionId);
await _vote(user1, true, resolutionId);

await _endResolution();

const resolutionResult = await resolutionManager.getResolutionResult(
resolutionId
);

expect(resolutionResult).equal(true);
});

// Mint token to a multiple shareholder
// Promote them to contributor
// Self-delegate
Expand Down

0 comments on commit 7252a7c

Please sign in to comment.