From 91a6aa89405399738ad7a65a1e74732c0045cdc9 Mon Sep 17 00:00:00 2001 From: Ezerous Date: Tue, 30 Mar 2021 15:27:58 +0300 Subject: [PATCH] fix: fix last option voting --- packages/concordia-contracts/contracts/Voting.sol | 4 ++-- yarn.lock | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/concordia-contracts/contracts/Voting.sol b/packages/concordia-contracts/contracts/Voting.sol index 129e4f6..b11d9b1 100644 --- a/packages/concordia-contracts/contracts/Voting.sol +++ b/packages/concordia-contracts/contracts/Voting.sol @@ -91,7 +91,7 @@ contract Voting { address[] memory voters = new address[](totalVotes); uint serializationIndex = 0; - for (uint pollOption = 1; pollOption < polls[topicID].numOptions; pollOption++) { + for (uint pollOption = 1; pollOption <= polls[topicID].numOptions; pollOption++) { address[] memory optionVoters = getVoters(topicID, pollOption); for (uint voteIndex = 0; voteIndex < voteCounts[pollOption - 1]; voteIndex++) { @@ -132,7 +132,7 @@ contract Voting { uint[] memory voteCounts = new uint[](polls[topicID].numOptions); - for (uint pollOption = 1; pollOption < polls[topicID].numOptions; pollOption++) { + for (uint pollOption = 1; pollOption <= polls[topicID].numOptions; pollOption++) { voteCounts[pollOption - 1] = getVoteCount(topicID, pollOption); } diff --git a/yarn.lock b/yarn.lock index 61b8ce3..957d618 100644 --- a/yarn.lock +++ b/yarn.lock @@ -16493,9 +16493,6 @@ snake-case@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/snake-case/-/snake-case-3.0.4.tgz#4f2bbd568e9935abdfd593f34c691dadb49c452c" integrity sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg== - dependencies: - dot-case "^3.0.4" - tslib "^2.0.3" snapdragon-node@^2.0.1: version "2.1.1"