add chain specific getMintInflation func #534
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Workaround for Customizing
getMintInflation
and ExtendingCosmosRestClient
Context
While integrating our application blockchain, I encountered two limitation:
Inability to Override
getMintInflation
Function:The current design does not provide a straightforward method to override the
getMintInflation
function in a manner similar to customizing the request list. This limitation restricts our ability to inject custom logic or behaviors into thegetMintInflation
process.Extending
CosmosRestClient
:The existing architecture and design patterns do not readily accommodate the extension or modification of
CosmosRestClient
functionalities without substantial alterations to the core class.Implemented Solution
To address these challenges, I have implemented a non-generic workaround. The core of this workaround involves a decision-making process based on the
chain_name
. This process determines whichgetMintInflation
function to call, effectively allowing a form of method overriding based on the chain's name.The implemented solution involves:
chain_name
, the appropriategetMintInflation
function is invoked – either the default implementation or a custom-defined function.Request for Guidance
I am aware that this solution may not align with the standards and conventions your existing codebase.
I would greatly appreciate guidance or suggestions on how to implement this functionality more elegantly, in a manner that aligns with your codebase's architectural standards and design principles. My goal is to refine this implementation to be more generic, maintainable, and in harmony with our existing code structure.
Contribution and Collaboration
I am more than willing to iterate on this solution and work closely with the team to develop a more robust and standard-compliant approach. Any feedback, suggestions, or insights from the team would be invaluable in steering this implementation towards a more optimal and standardized solution.