Skip to content

Commit

Permalink
Merge branch 'main' into fix-ipfs-test
Browse files Browse the repository at this point in the history
  • Loading branch information
mariacarmina committed Sep 26, 2024
2 parents 53d17a2 + aeae593 commit 3aa1e2d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 7 additions & 1 deletion src/contracts/NFTFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`)
}
}

Expand Down
8 changes: 5 additions & 3 deletions src/utils/OrderUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -220,10 +220,12 @@ export async function orderAsset(
price,
false
)

if (!tx) {
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,
Expand Down

0 comments on commit 3aa1e2d

Please sign in to comment.