From 25a43effdec2748d4bde2705b5684db3d6af926e Mon Sep 17 00:00:00 2001 From: g1nt0ki <99907941+g1nt0ki@users.noreply.github.com> Date: Mon, 5 Aug 2024 12:40:40 +0200 Subject: [PATCH] lint fix --- projects/meso-finance/index.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/projects/meso-finance/index.js b/projects/meso-finance/index.js index 51bb73931797..1afc27b17865 100644 --- a/projects/meso-finance/index.js +++ b/projects/meso-finance/index.js @@ -5,17 +5,19 @@ let _poolData function getPoolData() { if (!_poolData) { - _poolData = new Promise(async (resolve, reject) => { - try { - const poolAddresses = await getPoolAddresses() - const poolInfos = await Promise.all(poolAddresses.map(getPoolInfo)) - resolve(poolInfos) - } catch (e) { reject(e) } - }) + _poolData = new Promise(fetchPoolData) } return _poolData + async function fetchPoolData(resolve, reject) { + try { + const poolAddresses = await getPoolAddresses() + const poolInfos = await Promise.all(poolAddresses.map(getPoolInfo)) + resolve(poolInfos) + } catch (e) { reject(e) } + } + async function getPoolAddresses() { const pools = await function_view({ functionStr: "0x68476f9d437e3f32fd262ba898b5e3ee0a23a1d586a6cf29a28add35f253f6f7::meso::pools" }) return pools[0]['data'].map(obj => { return { coin: obj.key, poolAddress: obj.value.inner } })