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

getCheapestPool return proper value

This commit is contained in:
mihaisc 2020-08-05 15:24:07 +03:00
parent e87faa94df
commit 90667040fe

View File

@ -10,6 +10,12 @@ export async function getCheapestPool(
dataTokenAddress dataTokenAddress
) )
Logger.log('DT Pool found', tokenPools) Logger.log('DT Pool found', tokenPools)
if(tokenPools===undefined || tokenPools.length===0){
return {
poolAddress: '',
poolPrice: '0'
}
}
let cheapestPoolAddress let cheapestPoolAddress
let cheapestPoolPrice = new Decimal(999999999999) let cheapestPoolPrice = new Decimal(999999999999)