Closed fabriziovigevani closed 4 years ago
I think that going with the option 1 is the best option right now. If we set the endTime as endblock -1 we are not going to have the problem that the timer keeps running but you can not vote right?
Yes exactly, i think also for now is ok and if in the future we see a problem can consider changing it
Seems like a simple fix on the front-end. If it's consistent across the front-end UI components I think it's worth doing.
In the contract, the conditions for a vote to be open or not are the following:
Frontend wise, technically votes will already have started in
startBlock - 1
since when performing a tx at that block, the block number that will include said tx will bestartBlock
. (same logic goes for ending and execution)So for instance if the
startBlock
is 20 and the block time is 15, users will be able to vote in the 15 second period from 19th block and thestartBlock
. This means that they will not be able to vote in the 15 second period fromendBlock -1
toendBlock
.There are two options:
Leave it as it is right now and maybe put a warning or info message stating this in case we are at the
endBlock - 1
Convert every threshold block to its previous block on the frontend, unfortunately this comes with other complications (e.g vote is closed in the ui but is not in the contract, so when performing a call to
canVote
orcanExecute
the result is not consistent).Speaking with @willjgriff we think that leaving as it is, is ok.
What do you think?