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