From d6246f2919e9b20b8188b6fae7875710c2f3109d Mon Sep 17 00:00:00 2001 From: Gianfranco Date: Tue, 23 Apr 2024 10:57:10 -0300 Subject: [PATCH 1/2] fix broken pallet balances types --- src/api/controllers/token.controller.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/api/controllers/token.controller.js b/src/api/controllers/token.controller.js index 5df0311..682da93 100644 --- a/src/api/controllers/token.controller.js +++ b/src/api/controllers/token.controller.js @@ -17,9 +17,8 @@ async function fetchTokenStats(network) { accounts.forEach((entry) => { const account = entry[0].toHuman()[0] const balances = entry[1].toHuman().data; - const miscFrozen = BigInt(balances.miscFrozen.replace(/,/g, "")); - const feeFrozen = BigInt(balances.feeFrozen.replace(/,/g, "")); - const frozen = miscFrozen > feeFrozen ? miscFrozen : feeFrozen; + console.log(balances) + const frozen = BigInt(balances.frozen.replace(/,/g, "")); const free = BigInt(balances.free.replace(/,/g, "")); const reserved = BigInt(balances.reserved.replace(/,/g, "")); From c45b367920e4ebd84288345f1a0af5b0d08071b4 Mon Sep 17 00:00:00 2001 From: Gianfranco Date: Tue, 23 Apr 2024 11:38:06 -0300 Subject: [PATCH 2/2] remove testing logs --- src/api/controllers/token.controller.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/api/controllers/token.controller.js b/src/api/controllers/token.controller.js index 682da93..e1e76c7 100644 --- a/src/api/controllers/token.controller.js +++ b/src/api/controllers/token.controller.js @@ -17,7 +17,6 @@ async function fetchTokenStats(network) { accounts.forEach((entry) => { const account = entry[0].toHuman()[0] const balances = entry[1].toHuman().data; - console.log(balances) const frozen = BigInt(balances.frozen.replace(/,/g, "")); const free = BigInt(balances.free.replace(/,/g, "")); const reserved = BigInt(balances.reserved.replace(/,/g, ""));