1
0
mirror of https://github.com/oceanprotocol/ocean.js.git synced 2024-11-26 20:39:05 +01:00

Merge pull request #1857 from oceanprotocol/issue-1856-improve-error

throw some error msgs if no tx
This commit is contained in:
paulo@oceanprotocol 2024-09-25 12:28:24 +01:00 committed by GitHub
commit 5136d10f4c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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,