diff options
author | Jim McDonald <Jim@mcdee.net> | 2017-12-13 15:55:46 +0800 |
---|---|---|
committer | Jim McDonald <Jim@mcdee.net> | 2017-12-13 15:55:46 +0800 |
commit | 93cf4dee666e01d6907c75c4018a701e5069daad (patch) | |
tree | 8c3732c7a5961c00bee6adb3f916b99744c65bf7 /docs/solidity-by-example.rst | |
parent | 6e521d59b0a30fa0673aaf84559d5b74dbb1eed7 (diff) | |
download | dexon-solidity-93cf4dee666e01d6907c75c4018a701e5069daad.tar.gz dexon-solidity-93cf4dee666e01d6907c75c4018a701e5069daad.tar.zst dexon-solidity-93cf4dee666e01d6907c75c4018a701e5069daad.zip |
Fixes for failing tests
Diffstat (limited to 'docs/solidity-by-example.rst')
-rw-r--r-- | docs/solidity-by-example.rst | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/solidity-by-example.rst b/docs/solidity-by-example.rst index 6c01278a..b663083c 100644 --- a/docs/solidity-by-example.rst +++ b/docs/solidity-by-example.rst @@ -158,9 +158,9 @@ of votes. returns (uint winningProposal) { uint winningVoteCount = 0; - for (uint p = 0; p < winningProposals.length; p++) { - if (winningProposals[p].voteCount > winningVoteCount) { - winningVoteCount = winningProposals[p].voteCount; + for (uint p = 0; p < proposals.length; p++) { + if (proposals[p].voteCount > winningVoteCount) { + winningVoteCount = proposals[p].voteCount; winningProposal = p; } } @@ -172,7 +172,7 @@ of votes. function winnerName() public view returns (bytes32 winnerName) { - name = proposals[winningProposal()].name; + winnerName = proposals[winningProposal()].name; } } |