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:
commit
5136d10f4c
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user