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

[Documentation]: Migration Guidance Needed for Accessing Minter in Cosmos SDK v0.50 #19580

Closed
taryune opened this issue Feb 27, 2024 · 5 comments
Labels
T:Docs Changes and features related to documentation.

Comments

@taryune
Copy link

taryune commented Feb 27, 2024

I am currently upgrading a project from Cosmos SDK v0.47 to v0.50.3. In the previous version, we used the GetMinter() function from the x/mint module to access the Inflation property for our custom module.
However, with the release of v0.50, it appears that GetMinter() has been removed as part of a broader migration to collection (as detailed in the upgrading guide).

Could you provide guidance or examples on how to properly access the Minter state using the collections framework in Cosmos SDK v0.50.3? Any advice on transitioning from the direct usage of GetMinter() to the new recommended approach would be greatly appreciated.

@taryune taryune added the T:Docs Changes and features related to documentation. label Feb 27, 2024
@julienrbrt
Copy link
Member

Hi, you can access it like this:

minter, err := k.Minter.Get(ctx)

@tac0turtle
Copy link
Member

closing as the replacement is mentioned in the changelog and linked by julien

@taryune
Copy link
Author

taryune commented Feb 28, 2024

@julienrbrt Thanks.
Is it possible to access Minter from another module?
I thought it needs to define interface at expected_keepers.go to access keeper from the module.

@julienrbrt
Copy link
Member

Right, so you cannot use the struct field in an interface indeed. That's indeed a drawback but this let module expose only what they want.
There was discussion about putting all collections fields private as well.

If you need to query mint you can use its query server.

@taryune
Copy link
Author

taryune commented Feb 28, 2024

Thank you for your advice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T:Docs Changes and features related to documentation.
Projects
None yet
Development

No branches or pull requests

3 participants