From c09acbe2080cba1b5fc719a3b53fc740e6fdf0ae Mon Sep 17 00:00:00 2001 From: Noah Joeris Date: Thu, 23 Jan 2025 16:35:47 +0200 Subject: [PATCH] address comment --- app/src/hooks/useParaspellApi.tsx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/src/hooks/useParaspellApi.tsx b/app/src/hooks/useParaspellApi.tsx index 9ec44342..9bd74814 100644 --- a/app/src/hooks/useParaspellApi.tsx +++ b/app/src/hooks/useParaspellApi.tsx @@ -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 + } } }