-
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
feat(client): Add cobra's context to clientCtx #15458
Conversation
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!
@@ -61,6 +62,16 @@ type Context struct { | |||
|
|||
// TODO: Deprecated (remove). | |||
LegacyAmino *codec.LegacyAmino | |||
|
|||
// CmdContext is the context.Context from the Cobra command. | |||
CmdContext context.Context |
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: rename to Context, or is there a reason it called cmdContext?
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.
The struct is already called Context
. I thought being explicit here was useful to know what we're talking about. Can rename to simply Context
if other people also feel the same.
Co-authored-by: Facundo Medica <14063057+facundomedica@users.noreply.github.com>
Description
With Textual #13646, we pass a
context.Context
argument to a lot of signing functions. In a previous PR, #13747, we set this argument tocontext.TODO()
, waiting for other pieces of Textual to be finished.Now that Textual's implementation is finished, we should replace these instances of
context.TODO()
. There are 2 proposals:context.Background()
: easy, harmless, works with Textual... but feels incorrect, since we're creating a newcontext.Context
on each sign.context.Context
: more correct, needs some plumbing to pass it around to all functions.This PR implements 2.
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