Skip to content

Commit

Permalink
fix: zod validation error
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavan Soratur authored and Pavan Soratur committed Oct 18, 2024
1 parent 887a693 commit 41952ed
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions apps/tangle-dapp/lib/hyperlane/assembleChainMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
ChainMap,
ChainMetadata,
ChainMetadataSchema,
ChainTechnicalStack,
} from '@hyperlane-xyz/sdk';
import { ProtocolType } from '@hyperlane-xyz/utils';
import { z } from 'zod';
Expand Down Expand Up @@ -34,6 +35,17 @@ export default async function assembleChainMetadata() {
}

const chains = { ...defaultChainMetadata, ...customChainMetadata };

// Handle invalid ChainTechnicalStack values - ex: opstack
Object.entries(chains).forEach(([_chainName, chain]) => {
if (
typeof chain.technicalStack === 'string' &&
!Object.values(ChainTechnicalStack).includes(chain.technicalStack)
) {
chain.technicalStack = ChainTechnicalStack.Other;
}
});

return { chains, registry };
}

Expand Down

0 comments on commit 41952ed

Please sign in to comment.