Skip to content

Commit

Permalink
Fix crash bug from chain connection warning
Browse files Browse the repository at this point in the history
Disable balance validation for now
  • Loading branch information
jmrossy committed Jan 14, 2025
1 parent e0a2794 commit 7d70e92
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/features/chains/ChainConnectionWarning.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import { getChainDisplayName } from './utils';
export function ChainConnectionWarning({ chains }: { chains: ChainName[] }) {
const multiProvider = useMultiProvider();
const chainMetadataList = useMemo(
() => chains.map((c) => multiProvider.getChainMetadata(c)),
() =>
chains.map((c) => (c ? multiProvider.tryGetChainMetadata(c) : undefined)).filter((c) => !!c),
[chains, multiProvider],
);

Expand Down
12 changes: 7 additions & 5 deletions src/features/deployment/warp/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,11 @@ export async function validateWarpDeploymentForm(
return { form: warpRouteDeployConfigResult.error };
}

const balanceResult = await validateAccountBalances(chainNames, accounts, multiProvider);
if (!balanceResult.success) {
return { form: balanceResult.error };
}
// TODO re-enable or move to later
// const balanceResult = await validateAccountBalances(chainNames, accounts, multiProvider);
// if (!balanceResult.success) {
// return { form: balanceResult.error };
// }

onSuccess({
type: DeploymentType.Warp,
Expand Down Expand Up @@ -172,7 +173,8 @@ function assembleWarpConfig(
return success(warpRouteConfigValidationResult.data);
}

async function validateAccountBalances(
// TODO remove export
export async function validateAccountBalances(
chains: ChainName[],
accounts: Record<ProtocolType, AccountInfo>,
multiProvider: MultiProtocolProvider,
Expand Down

0 comments on commit 7d70e92

Please sign in to comment.