-
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
R4R: CLIContext Refactor #3321
R4R: CLIContext Refactor #3321
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #3321 +/- ##
===========================================
- Coverage 58.88% 56.47% -2.42%
===========================================
Files 131 137 +6
Lines 9836 10247 +411
===========================================
- Hits 5792 5787 -5
- Misses 3669 4084 +415
- Partials 375 376 +1 |
872893c
to
f2ea39c
Compare
96de99e
to
dd02445
Compare
f2ea39c
to
b6bea2b
Compare
3851a2a
to
9cda8aa
Compare
7ee769d
to
cca2f31
Compare
a73ba9b
to
fbcd835
Compare
CLIContext is once again treated as an immutable object. This PR is ready for review again. |
@@ -34,6 +28,7 @@ type CLIContext struct { | |||
Codec *codec.Codec | |||
AccDecoder auth.AccountDecoder | |||
Client rpcclient.Client | |||
TxBldr authtxb.TxBuilder |
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.
IMO it should be TxBuilder
to encapsulate a CLIContext
- rationale:
CLIContext
never callsTxBuilder
methods. The opposite is true, thusTxBuilder
should depend onCLIContext
, not the contrary.- This introduces a dependency on
github.com/cosmos/cosmos-sdk/x/auth/client/txbuilder
. Again, should be TxBuilder dependending on CLIContext
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.
Would be interested to hear other thoughts from the team @cosmos/cosmossdk
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.
@alessio's points make sense to me - are there counterarguments?
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.
Totally agree here. I also think the fromName
and fromAddress
fields (and corresponding logic to get these values) should be moved into the TxBuilder
.
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.
In all honesti, I think we'd better keep CLIContext
and TxBuilder
separate to avoid establishing any unnecessary dependency link between the two. For sake of caller's convenience though, I'm OK with TxBuilder
to encapsulate .CLIContext
.
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.
Yeahhh, I really don't see a big reason for this PR then imho. Sure, the CLI context can be cleaned up a bit (some of which I'll be doing in #3396)
756d38b
to
601c7a7
Compare
Please allow me to review this prior to merging @jackzampolin (will do shortly). |
Well @alexanderbez sounds like theres no alignment here so I wouldn't merge anyway. |
Going to go ahead and close this in favor of other work on these same issues. |
Fixes: #3249 #3255 #3178 #2953 #2856
This PR is the follow up to #3320 and contains:
client/utils
package intoclient/context
packageauth.TxBuilder
to theCLIContext
object and ensures it is properly initialized at the times it is called.I've also tried to add some comments explaining the code. Hopefully this helps reviewers.
docs/
)PENDING.md
with issue #Files changed
in the github PR explorerFor Admin Use: