From 17cfcffa9d44b48de2a21f4cced849504536c734 Mon Sep 17 00:00:00 2001 From: Gianfranco Date: Wed, 28 Feb 2024 06:28:34 -0300 Subject: [PATCH] spelling corrections, comments --- src/api/controllers/token.controller.js | 14 +++++++------- src/api/routes/v1/stats.route.js | 2 +- ...culating_accounts_to_ignore.js => constants.js} | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) rename src/api/utils/{circulating_accounts_to_ignore.js => constants.js} (80%) diff --git a/src/api/controllers/token.controller.js b/src/api/controllers/token.controller.js index 3801bd2..5df0311 100644 --- a/src/api/controllers/token.controller.js +++ b/src/api/controllers/token.controller.js @@ -1,6 +1,6 @@ const memcached = require("../../config/memcached"); const { executeApiCall } = require("../services/rpc.service"); -const {ACCOUNTS_TO_SUBSTRACT_AMPLITUDE, ACCOUNTS_TO_SUBSTRACT_PENDULUM} = require("../utils/circulating_accounts_to_ignore"); +const {ACCOUNTS_TO_SUBTRACT_AMPLITUDE, ACCOUNTS_TO_SUBTRACT_PENDULUM} = require("../utils/constants"); async function fetchTokenStats(network) { console.log(`Fetching token stats for network ${network}`); @@ -23,12 +23,12 @@ async function fetchTokenStats(network) { const free = BigInt(balances.free.replace(/,/g, "")); const reserved = BigInt(balances.reserved.replace(/,/g, "")); - // We maintain the supplyToIgnore to substract it from the total transferable - let accountsToSubstract = []; + // We mantain the supplyToIgnore to subtract it from the total transferable + let accountsToSubtract = []; if (network === "amplitude") { - accountsToSubstract = ACCOUNTS_TO_SUBSTRACT_AMPLITUDE; + accountsToSubtract = ACCOUNTS_TO_SUBTRACT_AMPLITUDE; } else if (network === "pendulum") { - accountsToSubstract = ACCOUNTS_TO_SUBSTRACT_PENDULUM; + accountsToSubtract = ACCOUNTS_TO_SUBTRACT_PENDULUM; } else { console.error("Invalid network"); } @@ -36,8 +36,8 @@ async function fetchTokenStats(network) { // We define the circulating supply as the total transferable (free - frozen) minus // the total transferable of a set of predefined multisig accounts (https://github.com/pendulum-chain/tasks/issues/242) // We keep track of the transferable of these accounts - // which will then will be substratect to the total transferable - if (accountsToSubstract.includes(String(account))) { + // which will then be subtracted from the total transferable + if (accountsToSubtract.includes(String(account))) { supplyToIgnore += free - frozen; } diff --git a/src/api/routes/v1/stats.route.js b/src/api/routes/v1/stats.route.js index e821ee4..af1e850 100644 --- a/src/api/routes/v1/stats.route.js +++ b/src/api/routes/v1/stats.route.js @@ -67,7 +67,7 @@ router .route("/circulatingsupply") /** * @api {get} token/stats/circulatingsupply Token circulating supply - * @apiDescription Get the current token adjusted circulating supply + * @apiDescription Get the current token stats for adjusted circulating supply * @apiVersion 1.0.0 * @apiName ListTokenStatsCirculatingSupply * diff --git a/src/api/utils/circulating_accounts_to_ignore.js b/src/api/utils/constants.js similarity index 80% rename from src/api/utils/circulating_accounts_to_ignore.js rename to src/api/utils/constants.js index 4b9195c..4ea679d 100644 --- a/src/api/utils/circulating_accounts_to_ignore.js +++ b/src/api/utils/constants.js @@ -1,4 +1,4 @@ -const ACCOUNTS_TO_SUBSTRACT_PENDULUM = [ +const ACCOUNTS_TO_SUBTRACT_PENDULUM = [ "6cY3Zrb2gr1xt3BczzJ3xoMpF7UyrcGNfR3cjkjcF7auq2Y9", "6gfLdZvfW2w6fDaPpVfUs53W8Aay17s1bjwcFaqDaBVt7Muo", "6biLQnLREwRd9aSPiN9xxR2UDCPa1XL3ZSwqNUxNEr3QvGDk", @@ -12,10 +12,10 @@ const ACCOUNTS_TO_SUBSTRACT_PENDULUM = [ "6cE1nHQu9XRH6pUSjMejCUzF39XqFx3HwgZNTMHNTZZw2c7M", ] -const ACCOUNTS_TO_SUBSTRACT_AMPLITUDE = [ +const ACCOUNTS_TO_SUBTRACT_AMPLITUDE = [ ] module.exports = { - ACCOUNTS_TO_SUBSTRACT_PENDULUM, - ACCOUNTS_TO_SUBSTRACT_AMPLITUDE, + ACCOUNTS_TO_SUBTRACT_PENDULUM, + ACCOUNTS_TO_SUBTRACT_AMPLITUDE, } \ No newline at end of file