Skip to content

Commit

Permalink
Uncomment extendedStats code
Browse files Browse the repository at this point in the history
  • Loading branch information
mpicco committed Apr 7, 2020
1 parent 5cbfdf9 commit 244fa24
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
13 changes: 7 additions & 6 deletions src/api/Api.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions src/api/modules/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 244fa24

Please sign in to comment.