1
0
mirror of https://github.com/oceanprotocol/react.git synced 2024-12-25 02:26:25 +01:00

correct price when no pools

This commit is contained in:
mihaisc 2020-08-06 12:13:17 +03:00
parent 6c1bfcbfd9
commit 56e6dc688e

View File

@ -13,7 +13,7 @@ export async function getCheapestPool(
if (tokenPools === undefined || tokenPools.length === 0) { if (tokenPools === undefined || tokenPools.length === 0) {
return { return {
poolAddress: '', poolAddress: '',
poolPrice: '0' poolPrice: ''
} }
} }
let cheapestPoolAddress let cheapestPoolAddress
@ -27,7 +27,7 @@ export async function getCheapestPool(
'1' '1'
) )
const decimalPoolPrice = new Decimal(poolPrice) const decimalPoolPrice = new Decimal(poolPrice)
Logger.log('Pool price ', tokenPools[i], poolPrice) Logger.log('Pool price ', tokenPools[i], decimalPoolPrice.toString())
if (decimalPoolPrice < cheapestPoolPrice) { if (decimalPoolPrice < cheapestPoolPrice) {
cheapestPoolPrice = decimalPoolPrice cheapestPoolPrice = decimalPoolPrice
cheapestPoolAddress = tokenPools[i] cheapestPoolAddress = tokenPools[i]