Skip to content

Commit

Permalink
address comment
Browse files Browse the repository at this point in the history
  • Loading branch information
noahjoeris committed Jan 23, 2025
1 parent 886f20e commit c09acbe
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions app/src/hooks/useParaspellApi.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,21 +161,19 @@ const useParaspellApi = () => {
try {
const result = await dryRun(params, params.sourceChain.rpcConnection)

const dryRunResult: DryRunResult = {
return {
type: 'Supported',
...result,
}

return dryRunResult
} catch (e: unknown) {
if (e instanceof Error && e.message.includes('DryRunApi is not available'))
return { type: 'Unsupported', success: false, failureReason: e.message } as DryRunResult
return { type: 'Unsupported', success: false, failureReason: e.message }

return {
type: 'Supported',
success: false,
failureReason: (e as Error).message,
} as DryRunResult
}
}
}

Expand Down

0 comments on commit c09acbe

Please sign in to comment.