From bcfd125b72adc281cdb1094d66165f65f85320a3 Mon Sep 17 00:00:00 2001 From: Ana Loznianu Date: Tue, 5 Dec 2023 15:38:05 +0200 Subject: [PATCH 1/4] Fix non existing transaction error --- src/utils/OrderUtils.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/utils/OrderUtils.ts b/src/utils/OrderUtils.ts index 53384ad0c..da31a4960 100644 --- a/src/utils/OrderUtils.ts +++ b/src/utils/OrderUtils.ts @@ -197,7 +197,10 @@ export async function orderAsset( price, false ) - + + if (!tx) { + return + } const txApprove = typeof tx !== 'number' ? await tx.wait() : tx if (!txApprove) { return From c7b45ee10a5ce98d26ffb3528c8feee5f9da38ad Mon Sep 17 00:00:00 2001 From: Ana Loznianu Date: Tue, 5 Dec 2023 16:02:29 +0200 Subject: [PATCH 2/4] Fix linter --- src/utils/OrderUtils.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/utils/OrderUtils.ts b/src/utils/OrderUtils.ts index da31a4960..99e018c65 100644 --- a/src/utils/OrderUtils.ts +++ b/src/utils/OrderUtils.ts @@ -197,7 +197,6 @@ export async function orderAsset( price, false ) - if (!tx) { return } From 1e0c75f4a2c6b61e70dd874c33636e1864ff01eb Mon Sep 17 00:00:00 2001 From: mariacarmina Date: Tue, 24 Sep 2024 16:12:45 +0300 Subject: [PATCH 3/4] Added additional check for NFT tx. --- src/contracts/NFTFactory.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/contracts/NFTFactory.ts b/src/contracts/NFTFactory.ts index 5b37e28b0..dc095158a 100644 --- a/src/contracts/NFTFactory.ts +++ b/src/contracts/NFTFactory.ts @@ -82,11 +82,17 @@ export class NftFactory extends SmartContractWithAddress { nftData.transferable, nftData.owner ) + if (!tx) { + const e = + 'Tx for deploying new NFT contract does not exist or status is not successful.' + console.error(e) + throw e + } const trxReceipt = await tx.wait() const events = getEventFromTx(trxReceipt, 'NFTCreated') return events.args[0] } catch (e) { - console.error(`Creation of AccessList failed: ${e}`) + console.error(`Creation of NFT failed: ${e}`) } } From c701652ee7e2cd7da6c5e858f81da37ed4e6b839 Mon Sep 17 00:00:00 2001 From: paulo-ocean Date: Wed, 25 Sep 2024 09:56:00 +0100 Subject: [PATCH 4/4] 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,