Closed freak12techno closed 3 months ago
[!CAUTION]
Review failed
The pull request is closed.
This update introduces a comprehensive token supply management system, encompassing the creation of new fetchers and generators, enhanced error handling, and detailed testing. Key components include a structured JSON representation of token supply, new functionality to fetch and generate supply metrics, and robust testing to ensure reliability across multiple scenarios.
Files | Change Summary |
---|---|
assets/supply.json |
New JSON structure for token supply with denomination and pagination metadata. |
pkg/app.go , pkg/fetchers/supply.go , pkg/generators/supply.go |
Introduced NewSupplyFetcher and NewSupplyGenerator for handling supply data in the application. |
pkg/app_test.go |
Added nil check for request body in health check test to prevent runtime panic. |
pkg/constants/constants.go |
Introduced FetcherNameSupply constant for unified fetcher naming. |
pkg/fetchers/supply.go |
Implemented SupplyFetcher struct for concurrent fetching of supply data from multiple chains. |
pkg/fetchers/supply_test.go |
Added unit tests for SupplyFetcher covering various scenarios like success, errors, and disabled queries. |
pkg/generators/supply.go |
Created SupplyGenerator for generating Prometheus metrics related to supply data. |
pkg/generators/supply_test.go |
Unit tests for SupplyGenerator , validating behavior with empty and populated states. |
pkg/tendermint/rpc.go |
Introduced GetTotalSupply method in RPC struct to fetch total token supply. |
pkg/types/tendermint.go |
Added SupplyResponse struct to represent supply-related data responses. |
sequenceDiagram
participant User
participant App
participant SupplyFetcher
participant RPC
User->>App: Request Supply Data
App->>SupplyFetcher: Fetch Supply Data
SupplyFetcher->>RPC: GetTotalSupply()
RPC-->>SupplyFetcher: Return Supply Data
SupplyFetcher-->>App: Supply Data
App-->>User: Supply Data
π°π "In fields of code where bunnies hop,
New features bloom, our hearts won't stop!
Fetchers and generators, all in a line,
Metrics and supplies, oh, how they shine!
With tests that guard and ensure delight,
Our token tale is now just right!" πΌβ¨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Summary by CodeRabbit
New Features
SupplyFetcher
andSupplyGenerator
for enhanced fetching and metric generation of supply data across blockchain chains.Bug Fixes
Tests
SupplyFetcher
andSupplyGenerator
to ensure robust functionality and error handling.Documentation