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

15 lines
351 B
JavaScript
Raw Normal View History

2022-11-12 16:20:42 -06:00
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;
}
}
}