Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add example implementation for mint's InflationCalculationFn to SimApp #11919

Closed
4 tasks
anilcse opened this issue May 10, 2022 · 2 comments · Fixed by #11945
Closed
4 tasks

Add example implementation for mint's InflationCalculationFn to SimApp #11919

anilcse opened this issue May 10, 2022 · 2 comments · Fixed by #11945
Assignees

Comments

@anilcse
Copy link
Collaborator

anilcse commented May 10, 2022

Summary

Now with #10441, app developers have an option to set custom inflation function to override default mint module's infaltion calculation function.

We don't have any example implementations to make it easy for app developers to use it.

Proposal

Adding a simple ExampleInflationCalculationFn in SimApp would help the developers to use this feature reasily. If this makes SimApp heavy, atleast we should have some documentation explaining this.


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@facundomedica
Copy link
Member

I think this can be solved via docs, as there's a default function that can be really helpful to look at:

// DefaultInflationCalculationFn is the default function used to calculate inflation.
func DefaultInflationCalculationFn(_ sdk.Context, minter Minter, params Params, bondedRatio sdk.Dec) sdk.Dec {
return minter.NextInflationRate(params, bondedRatio)
}

Modifying the NextInflationRate section might be the way to go.
What do you think?

@facundomedica facundomedica self-assigned this May 10, 2022
@anilcse
Copy link
Collaborator Author

anilcse commented May 11, 2022

I think this can be solved via docs, as there's a default function that can be really helpful to look at:

// DefaultInflationCalculationFn is the default function used to calculate inflation.
func DefaultInflationCalculationFn(_ sdk.Context, minter Minter, params Params, bondedRatio sdk.Dec) sdk.Dec {
return minter.NextInflationRate(params, bondedRatio)
}

Modifying the NextInflationRate section might be the way to go. What do you think?

That sounds reasonable

@alexanderbez alexanderbez moved this to 📝 Todo in Cosmos-SDK May 11, 2022
Repository owner moved this from 📝 Todo to 👏 Done in Cosmos-SDK May 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants