Browse Source

fix: fix last option voting

develop
Ezerous 4 years ago
parent
commit
91a6aa8940
  1. 4
      packages/concordia-contracts/contracts/Voting.sol
  2. 3
      yarn.lock

4
packages/concordia-contracts/contracts/Voting.sol

@ -91,7 +91,7 @@ contract Voting {
address[] memory voters = new address[](totalVotes); address[] memory voters = new address[](totalVotes);
uint serializationIndex = 0; 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); address[] memory optionVoters = getVoters(topicID, pollOption);
for (uint voteIndex = 0; voteIndex < voteCounts[pollOption - 1]; voteIndex++) { for (uint voteIndex = 0; voteIndex < voteCounts[pollOption - 1]; voteIndex++) {
@ -132,7 +132,7 @@ contract Voting {
uint[] memory voteCounts = new uint[](polls[topicID].numOptions); 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); voteCounts[pollOption - 1] = getVoteCount(topicID, pollOption);
} }

3
yarn.lock

@ -16493,9 +16493,6 @@ snake-case@^3.0.4:
version "3.0.4" version "3.0.4"
resolved "https://registry.yarnpkg.com/snake-case/-/snake-case-3.0.4.tgz#4f2bbd568e9935abdfd593f34c691dadb49c452c" resolved "https://registry.yarnpkg.com/snake-case/-/snake-case-3.0.4.tgz#4f2bbd568e9935abdfd593f34c691dadb49c452c"
integrity sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg== integrity sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==
dependencies:
dot-case "^3.0.4"
tslib "^2.0.3"
snapdragon-node@^2.0.1: snapdragon-node@^2.0.1:
version "2.1.1" version "2.1.1"

Loading…
Cancel
Save