Skip to content

Commit

Permalink
throw some error msgs if no tx
Browse files Browse the repository at this point in the history
  • Loading branch information
paulo-ocean committed Sep 25, 2024
1 parent 443d748 commit c701652
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 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 @@ -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,
Expand Down

0 comments on commit c701652

Please sign in to comment.