Closed freak12techno closed 1 month ago
The changes involve significant modifications across multiple files, primarily focusing on the removal of Coingecko-related functionality and the introduction of a more modular price-fetching system. The NewApp
function no longer utilizes the Coingecko API, and related methods and tests have been removed. New structures and interfaces have been introduced to support various price fetchers, enhancing the overall architecture for handling price data.
Files | Change Summary |
---|---|
pkg/app.go |
Removed Coingecko instantiation and updated NewPriceFetcher to exclude Coingecko parameter. |
pkg/config/config.go |
Removed GetCoingeckoCurrencies method from Config struct. |
pkg/config/config_test.go |
Removed TestCoingeckoCurrencies function. |
pkg/config/denom_info.go |
Added PriceFetchers method to DenomInfo struct for retrieving price fetcher names based on currency configuration. |
pkg/constants/constants.go |
Introduced PriceFetcherName type, PriceFetcherNameCoingecko , and CoingeckoBaseCurrency constant. |
pkg/fetchers/price.go |
Modified PriceFetcher struct to support multiple price sources, restructured Fetch method for concurrent fetching, and updated data structures for price information. |
pkg/fetchers/price_test.go |
Removed Coingecko fetcher instantiation from tests and updated assertions to reflect new data structure. |
pkg/generators/price.go |
Enhanced Prometheus metric labels for token prices to include source and base_currency . |
pkg/generators/price_test.go |
Updated tests to reflect changes in Prices map structure, now using fetchers.PriceInfo . |
pkg/price_fetchers/coingecko/coingecko.go |
Modified FetchPrices method to accept ChainWithDenom instead of currency strings and updated response handling to return PriceInfo . |
pkg/price_fetchers/price_fetcher.go |
Introduced new price_fetchers package with ChainWithDenom , PriceInfo , and PriceFetcher interface for structured price data retrieval. |
sequenceDiagram
participant App
participant PriceFetcher
participant PriceInfo
App->>PriceFetcher: NewPriceFetcher(logger, appConfig, tracer)
PriceFetcher->>PriceInfo: Fetch(denoms)
PriceInfo-->>PriceFetcher: Return PriceInfo[]
PriceFetcher-->>App: Return PriceData
🐇 In the code we hop and play,
Fetching prices in a new way.
No more Coingecko in our sight,
Modular fetchers take the flight!
With structure clear and data bright,
We celebrate this coding delight! 🌟
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 100.00%. Comparing base (
492c69e
) to head (6f74f27
). Report is 2 commits behind head on main.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Summary by CodeRabbit
Release Notes
New Features
Bug Fixes
Documentation
Refactor