-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Change GetQueryCmd to take client.Context #6326
Conversation
Codecov Report
@@ Coverage Diff @@
## master #6326 +/- ##
=======================================
Coverage 55.66% 55.66%
=======================================
Files 448 448
Lines 26956 26956
=======================================
Hits 15005 15005
Misses 10877 10877
Partials 1074 1074 |
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.
One minor comment, other LGTM. Thanks!
@@ -52,8 +52,8 @@ type AppModuleBasic interface { | |||
|
|||
// client functionality | |||
RegisterRESTRoutes(client.Context, *mux.Router) | |||
GetTxCmd(client.Context) *cobra.Command | |||
GetQueryCmd(*codec.Codec) *cobra.Command | |||
GetTxCmd(clientCtx client.Context) *cobra.Command |
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.
nit the package and type suffice for context, no need to add a variable.
@@ -52,8 +52,8 @@ type AppModuleBasic interface { | |||
|
|||
// client functionality | |||
RegisterRESTRoutes(client.Context, *mux.Router) | |||
GetTxCmd(client.Context) *cobra.Command | |||
GetQueryCmd(*codec.Codec) *cobra.Command | |||
GetTxCmd(clientCtx client.Context) *cobra.Command |
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.
GetTxCmd(clientCtx client.Context) *cobra.Command | |
GetTxCmd(client.Context) *cobra.Command |
GetTxCmd(client.Context) *cobra.Command | ||
GetQueryCmd(*codec.Codec) *cobra.Command | ||
GetTxCmd(clientCtx client.Context) *cobra.Command | ||
GetQueryCmd(clientCtx client.Context) *cobra.Command |
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.
GetQueryCmd(clientCtx client.Context) *cobra.Command | |
GetQueryCmd(client.Context) *cobra.Command |
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.
Adding the variable name is actually helpful when implementing the method using code completion because we wanted clientCtx rather than ctx. But I can remove it if you prefer
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.
Where would one get ctx
from? I'd opt to remove it personally. Not blocking though, so proceed at your own discretion.
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.
Sorry it would be context
. I'd prefer to keep it because it helped my IDE (goland) keep the style conventions from #6290.
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.
ACK
* Change GetQueryCmd to take a client.Context * Update CHANGELOG Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
Description
ref: #5921
This makes
GetQueryCmd
similar to the newGetTxCmd
which also takesclient.Context
now. It will be used for gRPC queriers.For contributor use:
docs/
) or specification (x/<module>/spec/
)godoc
comments.Unreleased
section inCHANGELOG.md
Files changed
in the Github PR explorer