Skip to content
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

x/bank: Refactor CLI & Tests #6525

Merged
merged 27 commits into from
Jun 30, 2020
Merged

Conversation

alexanderbez
Copy link
Contributor

@alexanderbez alexanderbez commented Jun 26, 2020

Description

  • Remove Indent from client logic (should have never existed -- sorry should be separate PR)
  • Add TxGenerator, Marshaler and AccountRetriever to testutil.Config
  • Refactor x/bank CLI handlers and tests
  • New NewFactoryCLI (NewFactoryFrom needs to be removed)
  • New GenerateOrBroadcastTxCLI (GenerateOrBroadcastTx needs to be removed)

ref: #6423


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer

@alexanderbez alexanderbez mentioned this pull request Jun 26, 2020
19 tasks
@codecov
Copy link

codecov bot commented Jun 26, 2020

Codecov Report

Merging #6525 into master will increase coverage by 1.21%.
The diff coverage is 63.28%.

@@            Coverage Diff             @@
##           master    #6525      +/-   ##
==========================================
+ Coverage   55.60%   56.81%   +1.21%     
==========================================
  Files         457      481      +24     
  Lines       27440    28935    +1495     
==========================================
+ Hits        15257    16439    +1182     
- Misses      11083    11328     +245     
- Partials     1100     1168      +68     

x/bank/client/cli/query.go Outdated Show resolved Hide resolved
string amount = 1 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false];
// amount is the supply of the coin
cosmos.Coin amount = 1
[(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin", (gogoproto.nullable) = false];
Copy link
Contributor Author

@alexanderbez alexanderbez Jun 26, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This returns an sdk.Coin, which matches the querier behavior and other queries similar to this.

client/cmd.go Outdated Show resolved Hide resolved
client/cmd.go Show resolved Hide resolved
@alexanderbez alexanderbez marked this pull request as ready for review June 30, 2020 13:07
@alexanderbez alexanderbez added the T: API Breaking Breaking changes that impact APIs and the SDK only (not state machine). label Jun 30, 2020
client/cmd.go Show resolved Hide resolved
Copy link
Member

@aaronc aaronc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you verified that setting node, keyring, etc. from the config file still works with these changes? I imagine it still works from other cli methods but not bank query and tx because the standard New/Init which uses viper is no longer called there.

@aaronc aaronc added the T: Proto Breaking Protobuf breaking changes: never don't do this! label Jun 30, 2020
@alexanderbez
Copy link
Contributor Author

alexanderbez commented Jun 30, 2020

It does not @aaronc which is a huge PIA. There is so much work to be done here. The CLI is such a cluster f#ck right now.

However, I think I can manage to keep the current flow while working on the new.

@alexanderbez alexanderbez marked this pull request as draft June 30, 2020 14:12
@dauTT dauTT mentioned this pull request Jun 30, 2020
8 tasks
@alexanderbez alexanderbez marked this pull request as ready for review June 30, 2020 18:36
@alexanderbez
Copy link
Contributor Author

alexanderbez commented Jun 30, 2020

@alessio, @aaronc et al. I ask you that review this under the following assumptions:

  • Review (and accept) knowing integration-tests will fail.
    • Current CLI integration tests & fixtures need to be completely gutted (I'll do this in a followup PR).
  • Current config.toml (client) will be removed entirely (which is a half-working pile of crap). I know this adds some convenience to users, but it can mask errors/problems. If we really wish to have this, we can add a new client stanza to the existing app.toml.

Copy link
Member

@tac0turtle tac0turtle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙈

@alexanderbez alexanderbez merged commit d504941 into master Jun 30, 2020
@alexanderbez alexanderbez deleted the bez/6423-x-bank-cli-refactor branch June 30, 2020 20:59
@alexanderbez
Copy link
Contributor Author

Don't worry -- we're in good hands. I can see the light at the end of the tunnel...

@aaronc
Copy link
Member

aaronc commented Jul 1, 2020

@alessio, @aaronc et al. I ask you that review this under the following assumptions:

  • Review (and accept) knowing integration-tests will fail.

    • Current CLI integration tests & fixtures need to be completely gutted (I'll do this in a followup PR).
  • Current config.toml (client) will be removed entirely (which is a half-working pile of crap). I know this adds some convenience to users, but it can mask errors/problems. If we really wish to have this, we can add a new client stanza to the existing app.toml.

oh boy 🙈. anyway upward and onward! we'll make it happen.

@tac0turtle tac0turtle mentioned this pull request Jul 2, 2020
9 tasks
larry0x pushed a commit to larry0x/cosmos-sdk that referenced this pull request May 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:CLI C:x/bank T: API Breaking Breaking changes that impact APIs and the SDK only (not state machine). T: Proto Breaking Protobuf breaking changes: never don't do this! T: Tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants