Skip to content
Snippets Groups Projects
Commit 0b1ec723 authored by Miguel Braidot's avatar Miguel Braidot
Browse files

Se agrega propiedad pública al SC para saber la cantidad de proposals almacenadas

parent 7a55c380
No related branches found
No related tags found
No related merge requests found
...@@ -40,6 +40,7 @@ contract Ballot ...@@ -40,6 +40,7 @@ contract Ballot
Voter[] public voterList; Voter[] public voterList;
/// @dev Short name (up to 32 bytes) /// @dev Short name (up to 32 bytes)
bytes32[] public proposalList; bytes32[] public proposalList;
uint public proposalListLength;
uint[] private emptyuintlist; uint[] private emptyuintlist;
/// @notice When the SC is being deployed, you must define initial conditions. When specifying percentages they are to have been multiplied with 100 million (5% is written as 5 million, since 5% is actially 0.05). /// @notice When the SC is being deployed, you must define initial conditions. When specifying percentages they are to have been multiplied with 100 million (5% is written as 5 million, since 5% is actially 0.05).
...@@ -84,9 +85,11 @@ contract Ballot ...@@ -84,9 +85,11 @@ contract Ballot
/// @dev add it to the end of the proposalList /// @dev add it to the end of the proposalList
uint incoming = proposalNames.length; uint incoming = proposalNames.length;
uint i = 0; uint i = 0;
proposalListLength = 0;
while ( i < incoming ) while ( i < incoming )
{ {
proposalList.push( proposalNames[i] ); proposalList.push( proposalNames[i] );
proposalListLength++;
i++; i++;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment