From c15042156e1e31f2cd8630f147f0d5280d23b11f Mon Sep 17 00:00:00 2001 From: mpicco Date: Wed, 12 Feb 2020 13:52:36 -0300 Subject: [PATCH] Uncomment extendedStats code --- src/api/Api.js | 13 +++++++------ src/api/modules/index.js | 4 ++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/api/Api.js b/src/api/Api.js index 57211606..87c4d58d 100644 --- a/src/api/Api.js +++ b/src/api/Api.js @@ -139,12 +139,13 @@ class Api extends DataCollector { const stats = await Stats.run('getLatest') if (!stats) return - /* const ExtendedStats = this.getModule('ExtendedStats') - if (ExtendedStats) { - const blockNumber = parseInt(stats.blockNumber) - const extendedStats = await ExtendedStats.getExtendedStats(blockNumber) - Object.assign(stats, extendedStats) - } */ + const ExtendedStats = this.getModule('ExtendedStats') + if (ExtendedStats) { + const blockNumber = parseInt(stats.blockNumber) + const extendedStats = await ExtendedStats.getExtendedStats(blockNumber) + Object.assign(stats, extendedStats) + } + let circulatingSupply = stats.circulatingSupply || await this.getCirculatingSupplyFromDb() this.circulatingSupply = circulatingSupply this.stats = Object.assign({}, stats) diff --git a/src/api/modules/index.js b/src/api/modules/index.js index 752d6be0..92a94658 100644 --- a/src/api/modules/index.js +++ b/src/api/modules/index.js @@ -6,11 +6,11 @@ import { Token } from './Token' import { TxPending } from './TxPending' import { Stats } from './Stats' import { Summary } from './Summary' -// import { ExtendedStats } from './ExtendedStats' +import { ExtendedStats } from './ExtendedStats' import { ContractVerification } from './ContractVerification' import { getModulesNames, getEnabledModules } from '../lib/apiTools' -const apiModules = { Block, Tx, Address, Event, Token, TxPending, Stats, Summary, ContractVerification } +const apiModules = { ExtendedStats, Block, Tx, Address, Event, Token, TxPending, Stats, Summary, ContractVerification } export const getEnabledApiModules = modules => { const enabled = getModulesNames(getEnabledModules(modules))