-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
docs(adr): ADR-045: BaseApp {Check,Deliver}Tx
as Middlewares
#9996
Conversation
{Check,Deliver}Tx
as Middlewares{Check,Deliver}Tx
as Middlewares
{Check,Deliver}Tx
as Middlewares{Check,Deliver}Tx
as Middlewares
Visit https://dashboard.github.orijtech.com?back=0&pr=9996&remote=false&repo=cosmos%2Fcosmos-sdk to see benchmark details. |
``` | ||
A.pre | ||
B.pre | ||
C.pre | ||
H # The base tx.handler, for example `RunMsgsTxHandler` | ||
C.post | ||
B.post | ||
A.post | ||
``` | ||
|
||
We define a `ComposeMiddlewares` function for composing middlewares. It takes the base handler as first argument, and middlewares in the "outer to inner" order. For the above stack, the final `tx.Handler` is: | ||
|
||
```go | ||
txHandler := middleware.ComposeMiddlewares(H, A, B, C) | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
given the diagram, do you think ComposeMiddlewares(H, A, B, C)
is clearer or ComposeMiddlewares(H, C, B, A)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think ComposeMiddlewares(H, C, B, A) is easier to point that it goes from the inner layer up to the outer one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nicely written, thank you!
@aaronc since you're on the ADR reviewing committee, would you like to give the final approval before merge? |
Good work @AmauryM 🎉 |
Description
rendered
Closes: #9953
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
to the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
!
in the type prefix if API or client breaking change