dao-governance-framework/forum-network/public/classes/voter.js

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;
}
}
}