Non-zero lastZeroSlash (#3364)
* Displayed chilled nominators in waiting * Non-zero-era slashingSpans
This commit is contained in:
parent
dbdaed4ea6
commit
fd70692193
@ -18,9 +18,15 @@ interface Inactives {
|
||||
|
||||
function extractState (stashId: string, slashes: Option<SlashingSpans>[], nominees: string[], activeEra: EraIndex, submittedIn: EraIndex, exposures: Exposure[]): Inactives {
|
||||
// chilled
|
||||
const nomsChilled = nominees.filter((_, index) =>
|
||||
slashes[index].isSome && slashes[index].unwrap().lastNonzeroSlash.gte(submittedIn)
|
||||
);
|
||||
const nomsChilled = nominees.filter((_, index): boolean => {
|
||||
if (slashes[index].isNone) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const { lastNonzeroSlash } = slashes[index].unwrap();
|
||||
|
||||
return !lastNonzeroSlash.isZero() && lastNonzeroSlash.gte(submittedIn);
|
||||
});
|
||||
|
||||
// first a blanket find of nominations not in the active set
|
||||
let nomsInactive = exposures
|
||||
|
||||
@ -28,7 +28,7 @@ function NominatedBy ({ nominators, slashingSpans }: Props): React.ReactElement<
|
||||
if (nominators) {
|
||||
const chilled = slashingSpans
|
||||
? nominators
|
||||
.filter(([, submittedIn]) => submittedIn.lte(slashingSpans.lastNonzeroSlash))
|
||||
.filter(([, submittedIn]) => !slashingSpans.lastNonzeroSlash.isZero() && slashingSpans.lastNonzeroSlash.gte(submittedIn))
|
||||
.map(([who]) => who)
|
||||
: [];
|
||||
const active = nominators
|
||||
|
||||
Loading…
Reference in New Issue
Block a user