Skip to content
This repository was archived by the owner on Mar 18, 2025. It is now read-only.

Commit d15533e

Browse files
chaindata: always track active, not current era
Co-authored-by: penumbra23 <[email protected]>
1 parent 0e8cda5 commit d15533e

File tree

1 file changed

+2
-2
lines changed
  • packages/common/src/chaindata/queries

1 file changed

+2
-2
lines changed

packages/common/src/chaindata/queries/Era.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,12 +204,12 @@ export const findEraBlockHash = async (
204204
return ["", "API at block hash is null"];
205205
}
206206

207-
const testEra = await apiAt.query.staking.currentEra();
207+
const testEra = await apiAt.query.staking.activeEra();
208208
if (testEra && testEra.isEmpty) {
209209
logger.info(`Test era is empty: ${JSON.stringify(testEra)}`);
210210
return ["", "Test era is none"];
211211
}
212-
const testIndex = testEra.unwrap().toNumber();
212+
const testIndex = testEra.unwrap().index.toNumber();
213213
if (era == testIndex) {
214214
return [blockHash.toString(), null];
215215
}

0 commit comments

Comments
 (0)