Closed freak12techno closed 4 months ago
The update primarily refactors how consumer information is managed and generated. The NewConsumerInfoGenerator
function now takes a list of chains as a parameter, facilitating more detailed and structured information handling. Nested maps replace flat structures in the ConsumerInfoFetcher
to better organize consumer data. Tests are updated accordingly to validate these structural changes, ensuring the system processes and retrieves consumer chain info correctly.
File | Change Summary |
---|---|
pkg/app.go |
NewConsumerInfoGenerator function call updated to include appConfig.Chains as a parameter. |
pkg/fetchers/consumer_info.go |
Changed allInfos and Info to use nested maps for detailed structuring; adjustments in processChain method to reflect this new structure. |
pkg/fetchers/consumer_info_test.go |
Modified test assertions to match the new nested map structure in ConsumerInfoFetcher and validate empty states directly or through nested structures. |
pkg/generators/consumer_info.go |
Constructor of ConsumerInfoGenerator updated to accept a slice of config.Chain ; iterates over these chains for updating consumer metrics. |
pkg/generators/consumer_info_test.go |
Import config added; tests updated to call NewConsumerInfoGenerator with slice of config.Chain and validate the generator against the nested map structure. |
sequenceDiagram
participant AppConfig
participant App
participant ConsumerInfoGenerator
participant ConsumerInfoFetcher
AppConfig->>App: Provide Chains
App->>ConsumerInfoGenerator: Initialize with Chains
ConsumerInfoGenerator->>ConsumerInfoFetcher: Fetch Consumer Data
ConsumerInfoFetcher->>ConsumerInfoGenerator: Return Nested Map Data
ConsumerInfoGenerator->>App: Return Generated Consumer Info
In fields of code, where logic meets delight,
Changes ripple, making the old new and bright.
Chains now flow through maps nested deep,
Fetchers and generators in sync, no secrets they keep.
Tests affirm the future, stable and strong,
In the world of code, we continue to belong. 🌱
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
Bug Fixes
Refactor
Tests