From c3b90185a2f56f0ef10a993bdbc0dca65c6a04ef Mon Sep 17 00:00:00 2001 From: cbrzn Date: Mon, 4 Apr 2022 19:06:11 +0200 Subject: [PATCH] common: minor refactor genesis state function --- packages/common/src/index.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/common/src/index.ts b/packages/common/src/index.ts index 3f4012aa5f..5322909972 100644 --- a/packages/common/src/index.ts +++ b/packages/common/src/index.ts @@ -1032,11 +1032,9 @@ export default class Common extends EventEmitter { */ genesisState(): GenesisState { // Custom chains with genesis state provided - if (this._customChains?.length && Array.isArray(this._customChains[0])) { - for (const chainArrayWithGenesis of this._customChains as [IChain, GenesisState][]) { - if (chainArrayWithGenesis[0].name === this.chainName()) { - return chainArrayWithGenesis[1] - } + for (const customChain of this._customChains) { + if (Array.isArray(customChain) && customChain[0].name === this.chainName()) { + return customChain[1] as GenesisState } }