diff --git a/src/genesis/genesis.ts b/src/genesis/genesis.ts index 373c4a9376f2d65a0eb684a76a77f30673d8417b..d3378ddeaa1e51a1a9f5f8ce881dfa48ccc063b4 100644 --- a/src/genesis/genesis.ts +++ b/src/genesis/genesis.ts @@ -89,7 +89,9 @@ export async function saveGenesis(ctx: Ctx, block: Block) { ctx.log.info("Loading genesis"); // Read genesis json - const genesis: Genesis = JSON.parse(readFileSync(path.resolve(genesis_path)).toString()).genesis.runtimeAndCode.runtime; + const genesisData = JSON.parse(readFileSync(path.resolve(process.cwd(), genesis_path)).toString()); + // Accomodate for versions of polkadot before and after 1.6.0: + const genesis: Genesis = genesisData.genesis.runtimeAndCode?.runtime || genesisData.genesis.runtimeGenesis.patch; const accounts: Map<Address, Account> = new Map(); const identities: Map<IdtyIndex, Identity> = new Map();