diff --git a/packages/contractkit/src/wrappers/Election.ts b/packages/contractkit/src/wrappers/Election.ts index 76837ca7c75..b8cd4f0675b 100644 --- a/packages/contractkit/src/wrappers/Election.ts +++ b/packages/contractkit/src/wrappers/Election.ts @@ -400,7 +400,7 @@ export class ElectionWrapper extends BaseWrapper { }) const validators = await this.kit.contracts.getValidators() const validatorGroup: ValidatorGroup[] = await concurrentMap(10, events, (e: EventLog) => - validators.getValidatorGroup(e.returnValues.group, true, blockNumber) + validators.getValidatorGroup(e.returnValues.group, false, blockNumber) ) return events.map( (e: EventLog, index: number): GroupVoterReward => ({ @@ -435,16 +435,17 @@ export class ElectionWrapper extends BaseWrapper { (e: GroupVoterReward) => normalizeAddress(e.group.address) in activeVoterVotes ) return voterRewards.map( - (e: GroupVoterReward): VoterReward => ({ - address, - addressPayment: e.groupVoterPayment.times( - activeVoterVotes[normalizeAddress(e.group.address)].dividedBy( - activeGroupVotes[normalizeAddress(e.group.address)] - ) - ), - group: e.group, - epochNumber: e.epochNumber, - }) + (e: GroupVoterReward): VoterReward => { + const group = normalizeAddress(e.group.address) + return { + address, + addressPayment: e.groupVoterPayment.times( + activeVoterVotes[group].dividedBy(activeGroupVotes[group]) + ), + group: e.group, + epochNumber: e.epochNumber, + } + } ) } } diff --git a/packages/contractkit/src/wrappers/Validators.ts b/packages/contractkit/src/wrappers/Validators.ts index dd15373ccab..8ff20b76460 100644 --- a/packages/contractkit/src/wrappers/Validators.ts +++ b/packages/contractkit/src/wrappers/Validators.ts @@ -484,7 +484,7 @@ export class ValidatorsWrapper extends BaseWrapper { this.getValidator(e.returnValues.validator, blockNumber) ) const validatorGroup: ValidatorGroup[] = await concurrentMap(10, events, (e: EventLog) => - this.getValidatorGroup(e.returnValues.group, true, blockNumber) + this.getValidatorGroup(e.returnValues.group, false, blockNumber) ) return events.map( (e: EventLog, index: number): ValidatorReward => ({