-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: Add msg service router interface #2
feat: Add msg service router interface #2
Conversation
…ey can charge fees for certain msg types.
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.
See comment about the feemsghandler in here ... it also seems weird that we have to add a context into these methods ... I haven't compared to how the middleware refector does it yet–maybe they added a similar hoook?
baseapp/baseapp.go
Outdated
@@ -133,6 +133,9 @@ type BaseApp struct { // nolint: maligned | |||
// indexEvents defines the set of events in the form {eventType}.{attributeKey}, | |||
// which informs Tendermint what to index. If empty, all events will be indexed. | |||
indexEvents map[string]struct{} | |||
|
|||
// msg fee handler | |||
additionalMsgFeeHandler sdk.AdditionalMsgFeeHandler // ante handler for fee and auth |
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.
Since this is the core SDK and the msg fee module isn't part of the core cosmos sdk ... it feels like there shouldn't be anything named "msg fee handler" here...
They do in fact have context available in DeliverTx for middleware ... looks like that won't be an issue. |
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.
LGTM.
* Updated and fixed Rosetta * add changelog * added prs to changelog * update release notes * feat: Add msg service router interface (#2) * convert message router to interface * Add setter for msg service interface * Adding a custom fee charging handler, so that if provenance want's they can charge fees for certain msg types. * refactored variable name. * Fixing comments on changed files. * Return transaction context from runTx * emitting events from AdditionalMsgFeeHandler, since authz and wasm calls need the event too. * test: Fix comppile issues on existing tests * handling error on failure to charge additional fee. * fixing err while deliverTx. * Update return values to have err at end * Fix tests * Refactor to remove pio specific stuff Co-authored-by: arnabmitra <[email protected]> * fixed @arnabmitra cr request * go mod vendor * cleanup * fmt * adding msg fee work to the changelog under unreleased section. * fixed tests * updated changelog to reflect provenance releases * remove unused db copy cmd * updated release notes * updating comment. * updating comment based on code review. * adding anteevents which were missed in the merge. * update release notes wording * baseapp changes the way they propagate antehandler events, this commit takes care of the order of ante and base events, since ante events are charged before all events and fee events are charged at the end. * Error from fee invoker is not getting propagated properly. * merging. * updating release notes. * Add missing iavl config size value to config parser Co-authored-by: fkneeland <[email protected]> Co-authored-by: fkneeland-figure <[email protected]> Co-authored-by: Carlton Hanna <[email protected]> Co-authored-by: Carlton Hanna <[email protected]>
Add an interface to the msg router service for customization of msg handling. The current format for the msg_router_service is a struct. This design does not allow for adding custom behavior to the
MsgServiceRouter
. Therefore, we added an interface to theMsgServiceRouter
calledIMsgServiceRouter
this allows for applications to add a custom router in the app.go file of their application. The default can also still be used that is defined in the baseapp.Provenance needed to modify the behavior of the router to add additional fees to specific msg types. i.e.) The MsgSend can have an additional 500nhash charge when executed. Therefore, fees would be addition charges + gas fees = total fees.
Description
Closes: #XXXX
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