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

[Feature]: Add compiler assertions to UPGRADING doc for v0.50 #17715

Closed
colin-axner opened this issue Sep 13, 2023 · 0 comments · Fixed by #17718
Closed

[Feature]: Add compiler assertions to UPGRADING doc for v0.50 #17715

colin-axner opened this issue Sep 13, 2023 · 0 comments · Fixed by #17718

Comments

@colin-axner
Copy link
Contributor

Summary

Add a list of recommended compiler assertions developers should add into their module.

Problem Definition

The API for several functions such as BeginBlock, EndBlock, InitGenesis and ExportGenesis has changed and most of theses functions are now optional removing compiler safety by default, but developers can reference the new Has interfaces to ensure their function implements the expected interface correctly.

Proposed Feature

Add a list of Has interface compiler assertions developers can copy over as necessary, such as:

var (
	_ module.AppModule           = (*AppModule)(nil)
	_ module.AppModuleBasic      = (*AppModuleBasic)(nil)
	_ module.AppModuleSimulation = (*AppModule)(nil)
	_ module.HasGenesis          = (*AppModule)(nil)
	_ appmodule.AppModule        = (*AppModule)(nil)
	_ appmodule.HasBeginBlocker  = (*AppModule)(nil)
)

you may include only the new interfaces if you like

ref: cosmos/ibc-go#4647, cosmos/ibc-go#4557, cosmos/ibc-go#4563, cosmos/ibc-go#4466

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant