Merge branch 'master' into ab-fetch-total-supply-from-coinmarketcap

pull/1803/head
Victor Baranov 6 years ago committed by GitHub
commit aaa54d41fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      CHANGELOG.md
  2. 3
      apps/explorer/config/config.exs
  3. 2
      apps/explorer/lib/explorer/exchange_rates/source/coin_market_cap.ex

@ -23,6 +23,7 @@
- [#1793](https://github.com/poanetwork/blockscout/pull/1793) - fix top nav autocomplete - [#1793](https://github.com/poanetwork/blockscout/pull/1793) - fix top nav autocomplete
- [#1795](https://github.com/poanetwork/blockscout/pull/1795) - fix line numbers for decompiled contracts - [#1795](https://github.com/poanetwork/blockscout/pull/1795) - fix line numbers for decompiled contracts
- [#1803](https://github.com/poanetwork/blockscout/pull/1803) - use coinmarketcap for total_supply by default - [#1803](https://github.com/poanetwork/blockscout/pull/1803) - use coinmarketcap for total_supply by default
- [#1802](https://github.com/poanetwork/blockscout/pull/1802) - make coinmarketcap's number of pages configurable
### Chore ### Chore

@ -13,6 +13,9 @@ config :explorer,
config :explorer, Explorer.Counters.AverageBlockTime, enabled: true config :explorer, Explorer.Counters.AverageBlockTime, enabled: true
config :explorer, Explorer.ExchangeRates.Source.CoinMarketCap,
pages: String.to_integer(System.get_env("COINMARKETCAP_PAGES") || "10")
balances_update_interval = balances_update_interval =
if System.get_env("ADDRESS_WITH_BALANCES_UPDATE_INTERVAL") do if System.get_env("ADDRESS_WITH_BALANCES_UPDATE_INTERVAL") do
case Integer.parse(System.get_env("ADDRESS_WITH_BALANCES_UPDATE_INTERVAL")) do case Integer.parse(System.get_env("ADDRESS_WITH_BALANCES_UPDATE_INTERVAL")) do

@ -39,7 +39,7 @@ defmodule Explorer.ExchangeRates.Source.CoinMarketCap do
"#{base_url()}/v1/ticker/?start=#{page - 1}00" "#{base_url()}/v1/ticker/?start=#{page - 1}00"
end end
def max_page_number, do: 10 def max_page_number, do: config(:pages)
defp base_url do defp base_url do
config(:base_url) || "https://api.coinmarketcap.com" config(:base_url) || "https://api.coinmarketcap.com"

Loading…
Cancel
Save