lastNonzeroSlash > submittedIn for chilled (#8518)
* lastNonzeroSlash > submittedIn for chilled * Note on logic * Cleanups
This commit is contained in:
parent
61b7374156
commit
72b0f96176
@ -42,17 +42,17 @@ function expandOngoing (info: Referendum['info'], track?: PalletReferendaTrackIn
|
||||
const { deciding, submitted } = ongoing;
|
||||
|
||||
if (deciding.isSome) {
|
||||
const d = deciding.unwrap();
|
||||
const { confirming, since } = deciding.unwrap();
|
||||
|
||||
if (d.confirming.isSome) {
|
||||
// we are confirming (it details the actual end-block)
|
||||
confirmEnd = d.confirming.unwrap(); // .add(track.confirmPeriod);
|
||||
if (confirming.isSome) {
|
||||
// we are confirming with the specific end block
|
||||
confirmEnd = confirming.unwrap();
|
||||
} else {
|
||||
// we are still deciding
|
||||
decideEnd = d.since.add(track.decisionPeriod);
|
||||
// we are still deciding, start + length
|
||||
decideEnd = since.add(track.decisionPeriod);
|
||||
}
|
||||
} else {
|
||||
// we are still preparing
|
||||
// we are still preparing, start + length
|
||||
prepareEnd = submitted.add(track.preparePeriod);
|
||||
}
|
||||
}
|
||||
|
||||
@ -31,7 +31,9 @@ function extractState (api: ApiPromise, stashId: string, slashes: Option<Slashin
|
||||
|
||||
const { lastNonzeroSlash } = slashes[index].unwrap();
|
||||
|
||||
return !lastNonzeroSlash.isZero() && lastNonzeroSlash.gte(submittedIn);
|
||||
// to be chilled, we have a slash era and it is later than the submission era
|
||||
// (if submitted in the same, the nomination will only take effect after the era)
|
||||
return !lastNonzeroSlash.isZero() && lastNonzeroSlash.gt(submittedIn);
|
||||
});
|
||||
|
||||
// all nominations that are oversubscribed
|
||||
|
||||
Loading…
Reference in New Issue
Block a user