private bool IsFirstVoteFromVoter(Vote vote) { var hasVoterAlreadyVoted = this.blockchain.TryGetVoteByVoter(vote.VoterId, out var dummyVote); return(!hasVoterAlreadyVoted); }
public bool IsValid(Vote vote) { var isPastTimeLimit = DateTime.Now > this.electionEndTime; return(!isPastTimeLimit && this.IsValidVoter(vote) && this.IsFirstVoteFromVoter(vote) && IsSignatureValid(vote)); }
private bool IsValidVoter(Vote vote) { var isValidVoter = this.voterDb.DoesVoterExist(vote.VoterId); return(isValidVoter); }
public bool IsValid(Vote vote) { return(this.IsValidVoter(vote) && this.IsFirstVoteFromVoter(vote) && IsSignatureValid(vote)); }