Trapping for failed collective proposals (#4885)
* Trapping for failed collective proposals * revert multi * Recomment * Remove multi augmentation * Adjust
This commit is contained in:
@@ -47,7 +47,7 @@ function queryQueue (api: DeriveApi): Observable<DeriveDispatch[]> {
|
||||
);
|
||||
}
|
||||
|
||||
function schedulerEntries (api: DeriveApi): Observable<[BlockNumber[], (Option<PalletSchedulerScheduledV3 | Scheduled>[] | null)[]]> {
|
||||
function schedulerEntries (api: DeriveApi): Observable<[BlockNumber[], Option<PalletSchedulerScheduledV3 | Scheduled>[][]]> {
|
||||
// We don't get entries, but rather we get the keys (triggered via finished referendums) and
|
||||
// the subscribe to those keys - this means we pickup when the schedulers actually executes
|
||||
// at a block, the entry for that block will become empty
|
||||
@@ -64,12 +64,11 @@ function schedulerEntries (api: DeriveApi): Observable<[BlockNumber[], (Option<P
|
||||
// this should simply be api.query.scheduler.agenda.multi,
|
||||
// however we have had cases on Darwinia where the indices have moved around after an
|
||||
// upgrade, which results in invalid on-chain data
|
||||
combineLatest(blockNumbers.map((blockNumber) =>
|
||||
// this does create an issue since it discards all at that block
|
||||
api.query.scheduler.agenda(blockNumber).pipe(catchError(() => of(null)))
|
||||
))
|
||||
api.query.scheduler.agenda.multi(blockNumbers).pipe(
|
||||
catchError(() => of(blockNumbers.map(() => [])))
|
||||
)
|
||||
])
|
||||
: of<[BlockNumber[], null[]]>([[], []]);
|
||||
: of<[BlockNumber[], Option<PalletSchedulerScheduledV3 | Scheduled>[][]]>([[], []]);
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user