11# Middleware
22
33This package contains a middleware implementation for a generic ` HyperlaneApp ` .
4- The middleware allows to hook
5- before and after the execution of the application's ` Handle ` method.
4+ Middleware allows integrators to add custom logic
5+ before and after the execution of an application's ` Handle ` method.
66
77## Usage
88
9- To wrap n Hyperlane application with a middleware, two components are required:
9+ To wrap a Hyperlane application with middleware, two components are required:
1010
1111- The Hyperlane core keeper.
1212- A Hyperlane application, like Warp.
1313
1414Once the Cosmos SDK application has been built,
1515it is possible to build and register the middleware.
16- Assuming we want to provide hook functionalities
17- around the Warp application for the collateral token, we can do as follow .
16+ Assuming we want to provide hook functionalities around the Warp application for collateral tokens,
17+ we can do the following .
1818
1919Import the required types:
2020
@@ -31,7 +31,7 @@ import (
3131```
3232
3333Now we have to create a concrete value implementing the ` HandleHook ` interface. It is possible to
34- use the simple hook type already provided in the package :
34+ use the simple hook type already provided:
3535
3636``` go
3737hook := middleware.NewHandleHook (
@@ -50,7 +50,7 @@ For more complex applications, a custom type can be created.
5050It is also possible to use another Cosmos SDK module as middleware,
5151as long as it implements the required methods.
5252At this point, it is possible to create the middleware. In the example below,
53- we are going to create two wrapped middlewares around the warp application:
53+ we are going to create two wrapped middlewares around the Warp application:
5454
5555``` go
5656warpKeeper := &warpkeeper.Keeper {}
0 commit comments