Fix comment position in the voting example

This commit is contained in:
Denis T 2022-06-09 15:09:02 +03:00 committed by GitHub
parent 9b220a2007
commit 811fa193af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -128,15 +128,17 @@ of votes.
// We found a loop in the delegation, not allowed.
require(to != msg.sender, "Found loop in delegation.");
}
// Since `sender` is a reference, this
// modifies `voters[msg.sender].voted`
Voter storage delegate_ = voters[to];
// Voters cannot delegate to accounts that cannot vote.
require(delegate_.weight >= 1);
// Since `sender` is a reference, this
// modifies `voters[msg.sender]`.
sender.voted = true;
sender.delegate = to;
if (delegate_.voted) {
// If the delegate already voted,
// directly add to the number of votes