Skip to content

Commit

Permalink
Votes and juror subscriptions mapping fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Alan Donoso Naumczuk committed Jun 4, 2021
1 parent d9694d9 commit 6b1ac8c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export function handleJurorSubscription(event: JurorTopicSubscription): void {
if (juror == null) {
juror = new Juror(jurorId);
}
juror.save();
let topicId = event.params._topicId.toString();
let jurorSubscriptionId = getJurorSubscriptionId(jurorId, topicId);
let jurorSubscription = JurorSubscription.load(jurorSubscriptionId);
Expand Down Expand Up @@ -141,9 +142,9 @@ function jurorWasRewarded(voting: Voting, jurorVote: Vote): boolean {
}

function getVoteId(jurorId: string, publicationId: string): string {
return `${jurorId}@${publicationId}`;
return jurorId.concat("@").concat(publicationId);
}

function getJurorSubscriptionId(jurorId: string, topicId: string): string {
return `${jurorId}@${topicId}`;
return jurorId.concat("@").concat(topicId);
}

0 comments on commit 6b1ac8c

Please sign in to comment.