15 lines
351 B
JavaScript
15 lines
351 B
JavaScript
export class Voter {
|
|
constructor(reputationPublicKey) {
|
|
this.reputationPublicKey = reputationPublicKey;
|
|
this.voteHistory = [];
|
|
this.dateLastVote = null;
|
|
}
|
|
|
|
addVoteRecord(vote) {
|
|
this.voteHistory.push(vote);
|
|
if (!this.dateLastVote || vote.dateStart > this.dateLastVote) {
|
|
this.dateLastVote = vote.dateStart;
|
|
}
|
|
}
|
|
}
|