Skip to content

Commit

Permalink
fix logic bug in wasValidatorDownForIntervals (#5917)
Browse files Browse the repository at this point in the history
if you want to use .some, then return value should have been negated. but using .every is way more intuitive.

### Description

Fixes simple logic bug.

### Other changes

### Tested

### Related issues

### Backwards compatibility
  • Loading branch information
zviadm authored Nov 19, 2020
1 parent d6ad5af commit 2ff8fac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/contractkit/src/wrappers/DowntimeSlasher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ export class DowntimeSlasherWrapper extends BaseSlasher<DowntimeSlasher> {
const downArray = await Promise.all(
intervals.map((interval) => this.wasValidatorDownForInterval(address, interval))
)
return downArray.some((down) => !down)
return downArray.every((down) => down)
}

/**
Expand Down

0 comments on commit 2ff8fac

Please sign in to comment.