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

Message interceptor #28

Closed
liorzilp opened this issue Mar 7, 2023 · 0 comments · Fixed by #29
Closed

Message interceptor #28

liorzilp opened this issue Mar 7, 2023 · 0 comments · Fixed by #29
Assignees
Labels
enhancement New feature or request

Comments

@liorzilp
Copy link

liorzilp commented Mar 7, 2023

Overview

Following #14 we could also add hooks for more IBC messages.
Instead of hooks, we can export the message server that is registered for the IBC messages.
Say am.msgSrvInterceptor is implementing the required interface, we can just change the registry:

// RegisterServices registers module services.
func (am AppModule) RegisterServices(cfg module.Configurator) {
	clienttypes.RegisterMsgServer(cfg.MsgServer(), am.msgSrvInterceptor)
	connectiontypes.RegisterMsgServer(cfg.MsgServer(), am.msgSrvInterceptor)
	channeltypes.RegisterMsgServer(cfg.MsgServer(), am.msgSrvInterceptor)

	...
}

That way, we can define one interface that is implementing the required message handling and initialize the IBC module with it.
The default would be to initialize with the IBC keeper, but other application logic could be applied as well.
The common use should be wrapping the IBC keeper handling with the required logic.

The interception is needed for creating a framework to support more features of the IRC that middleware can't achieve.

Remove client hooks

The use of client hooks should be replaced with this interceptor.

@liorzilp liorzilp self-assigned this Mar 7, 2023
@liorzilp liorzilp added the enhancement New feature or request label Mar 7, 2023
@liorzilp liorzilp linked a pull request Mar 8, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant