Skip to content

Commit

Permalink
common: minor refactor genesis state function
Browse files Browse the repository at this point in the history
  • Loading branch information
cbrzn committed Apr 4, 2022
1 parent 58c8d16 commit c3b9018
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions packages/common/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down

0 comments on commit c3b9018

Please sign in to comment.