2022-11-12 16:20:42 -06:00
|
|
|
export class Voter {
|
|
|
|
constructor(reputationPublicKey) {
|
|
|
|
this.reputationPublicKey = reputationPublicKey;
|
|
|
|
this.voteHistory = [];
|
|
|
|
this.dateLastVote = null;
|
|
|
|
}
|
|
|
|
|
2023-01-12 16:41:55 -06:00
|
|
|
addVoteRecord(stake) {
|
|
|
|
this.voteHistory.push(stake);
|
|
|
|
if (!this.dateLastVote || stake.dateStart > this.dateLastVote) {
|
|
|
|
this.dateLastVote = stake.dateStart;
|
2022-11-12 16:20:42 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|