Skip to content
Snippets Groups Projects
Commit 32be73ea authored by Carles Barrobés's avatar Carles Barrobés Committed by Hugo Trentesaux
Browse files

Make genesis format compatible with different polkadot versions

(cherry picked from commit 59ded148)
parent d7eb9990
No related branches found
No related tags found
1 merge request!22Transaction comments
......@@ -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();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment