diff --git a/src/mappings/era/ValidatorEraInfoDataSource.ts b/src/mappings/era/ValidatorEraInfoDataSource.ts index a65bfa0..23ed889 100644 --- a/src/mappings/era/ValidatorEraInfoDataSource.ts +++ b/src/mappings/era/ValidatorEraInfoDataSource.ts @@ -22,11 +22,19 @@ export class ValidatorEraInfoDataSource extends CachingEraInfoDataSource { protected async fetchEraStakers(): Promise { const era = await this.era() + let stakers: StakeTarget[] if (api.query.staking.erasStakersOverview) { - return await this.fetchEraStakersPaged(era); - } else { - return await this.fetchEraStakersClipped(era); + stakers = await this.fetchEraStakersPaged(era); + if (stakers.length > 0) { + return stakers + } + } + + stakers = await this.fetchEraStakersClipped(era); + if (stakers.length == 0) { + throw new Error("Empty era stakers fetched") } + return stakers } private async fetchEraStakersClipped(era: number): Promise {