-
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
Changes from all commits
42ce783
3f73800
e0d35ec
70e7bd5
7b33640
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
GetQueryCmd(clientCtx client.Context) *cobra.Command | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. Where would one get There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry it would be |
||||||
} | ||||||
|
||||||
// BasicManager is a collection of AppModuleBasic | ||||||
|
@@ -113,9 +113,9 @@ func (bm BasicManager) AddTxCommands(rootTxCmd *cobra.Command, ctx client.Contex | |||||
} | ||||||
|
||||||
// AddQueryCommands adds all query commands to the rootQueryCmd | ||||||
func (bm BasicManager) AddQueryCommands(rootQueryCmd *cobra.Command, cdc *codec.Codec) { | ||||||
func (bm BasicManager) AddQueryCommands(rootQueryCmd *cobra.Command, clientCtx client.Context) { | ||||||
for _, b := range bm { | ||||||
if cmd := b.GetQueryCmd(cdc); cmd != nil { | ||||||
if cmd := b.GetQueryCmd(clientCtx); cmd != nil { | ||||||
rootQueryCmd.AddCommand(cmd) | ||||||
} | ||||||
} | ||||||
|
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.