From c701652ee7e2cd7da6c5e858f81da37ed4e6b839 Mon Sep 17 00:00:00 2001 From: paulo-ocean Date: Wed, 25 Sep 2024 09:56:00 +0100 Subject: [PATCH] throw some error msgs if no tx --- src/utils/OrderUtils.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/OrderUtils.ts b/src/utils/OrderUtils.ts index 33b5eb5b8..fe6b8284f 100644 --- a/src/utils/OrderUtils.ts +++ b/src/utils/OrderUtils.ts @@ -189,7 +189,7 @@ export async function orderAsset( ) const txApprove = typeof tx !== 'number' ? await tx.wait() : tx if (!txApprove) { - throw new Error(`Failed to appove ${exchange.baseToken} !`) + throw new Error(`Failed to approve ${exchange.baseToken} !`) } const freTx = await fre.buyDatatokens( exchange.exchangeId, @@ -221,11 +221,11 @@ export async function orderAsset( false ) if (!tx) { - return + throw new Error(`Failed to approve ${exchange.baseToken} !`) } const txApprove = typeof tx !== 'number' ? await tx.wait() : tx if (!txApprove) { - return + throw new Error(`Failed to confirm/mine approval transaction!`) } const txBuy = await datatoken.buyFromFreAndOrder( asset.datatokens[datatokenIndex].address,