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

Move genesis commands to a sub-command and add the SDK's auto-cli commands. #1971

Merged
merged 28 commits into from
May 15, 2024

Conversation

SpicyLemon
Copy link
Contributor

@SpicyLemon SpicyLemon commented May 14, 2024

Description

This PR:

  • Replaces the tendermint command with comet.

  • Removes the enable-cli-autocomplete command. Cobra command now automatically adds a completion command that does the same thing.

  • Moves the genesis-related commands into a new genesis sub-command, and removes the genesis- part of their name.

    • Old invocation New invocation
      provenanced add-genesis-account provenanced genesis add-account
      provenanced add-genesis-custom-floor provenanced genesis add-custom-floor
      provenanced add-genesis-custom-market provenanced genesis add-custom-market
      provenanced add-genesis-default-market provenanced genesis add-default-market
      provenanced add-genesis-marker provenanced genesis add-marker
      provenanced add-genesis-msg-fee provenanced genesis add-msg-fee
      provenanced add-genesis-root-name provenanced genesis add-root-name
      provenanced collect-gentxs provenanced genesis collect-gentxs
      provenanced gentx provenanced genesis gentx
      provenanced validate-genesis provenanced genesis validate
  • Removes the provenanced query account command. The same query is still available as provenanced query auth account.

  • Adds the following sub-commands to the provenanced query command: blocks, block-results, consensus, event-query-tx-for, and interchainquery.

  • The provenanced query tendermint-validator-set is now provenanced query comet-validator-set.

  • Adds the following sub-commands to the provenanced tx command: auth, consensus, ibchooks, interchainquery, mint, multisign-batch, and upgrade.

  • Updates upgrade-config.sh to account for the moved params and also stop it from outputting the entire genesis file when run.

  • The alias for tx metadata has changed from m to md to match the query metadata alias.

  • The tx oracle command had an alias of t that has been removed.

  • A few other aliases were added so that the query and tx commands have the same aliases for each module.

  • Updates the aliases of the provenanced tx wasm instantiate2 command to all end with 2 so that they don't conflict with the provenanced tx wasm instantiate command.

  • Adds a hidden tree command that will output all the possible commands optionally limited to a specific sub-command, and optionally including aliases.

Related to:


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.
  • 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
  • Review Codecov Report in the comment section below once CI passes

Summary by CodeRabbit

  • New Features

    • Introduced new auto-cli commands for enhanced automation.
    • Added a tree view command for visualizing available commands.
  • Improvements

    • Replaced provenanced query account with provenanced query auth account for better clarity.
    • Genesis-related commands have been moved to a new genesis sub-command for improved organization.
    • Enhanced usability with new command aliases for various modules.
  • Bug Fixes

    • Adjusted SDK query commands to ensure proper functionality and consistency.
  • Testing

    • Updated and removed test cases to align with the new command structures and functionalities.
  • Chores

    • Updated scripts for genesis initialization and blockchain development setup to use new command names.

Copy link
Contributor

coderabbitai bot commented May 14, 2024

Walkthrough

The updates introduce new auto-cli commands and adjust existing SDK query commands. Key changes include replacing the provenanced query account command with provenanced query auth account, moving genesis-related commands to a new genesis sub-command, and refining SDK query command usage. Additionally, imports and functions have been modified across various files to enhance functionality, including setting up keyring, pruning, and adding command aliases.

Changes

File Path Change Summary
CHANGELOG.md Added a summary of new auto-cli commands, SDK query command adjustments, and genesis command relocations.
app/app.go Added imports and a new function AutoCliOpts() in the App struct.
cmd/provenanced/cmd/cmd_test.go Removed assertions import and TestGenAutoCompleteCmd function.
cmd/provenanced/cmd/genaccounts.go Added and removed imports, modified GenesisCmd function, added new commands, and renamed existing commands.
cmd/provenanced/cmd/genaccounts_test.go Removed TestAddGenesisAccountCmd function.
cmd/provenanced/cmd/root.go Added keyring import, integrated keyring setup, adjusted command structures, and added pruning functionality.
cmd/provenanced/cmd/root_test.go Added imports for cobra, debug, and wasmcli.
networks/dev/blockchain-dev/entrypoint.sh Modified commands for setting up genesis accounts and root names.
scripts/initialize.sh Renamed commands for genesis initialization and adjusted arguments.
scripts/upgrade-config.sh Updated voting period in JSON file using jq.
x/sanction/client/testutil/cli_test.go Changed blocksPerVotingPeriod constant from 6 to 8.
cmd/provenanced/cmd/genesis.go Added and removed imports, modified function signatures for various genesis-related commands.
cmd/provenanced/cmd/genaccounts_test.go Removed testdata import and deleted TestAddGenesisAccountCmd function.
x/ibcratelimit/client/cli/query.go Added alias "rl" for querying the ibcratelimit module.
x/metadata/client/cli/tx.go Changed alias for NewTxCmd from m to md.
x/msgfees/client/cli/query.go Added aliases mf, mfees, and mbf for GetQueryCmd function.
x/oracle/client/cli/tx.go Removed Aliases field from NewTxCmd function.
x/trigger/client/cli/query.go Added alias "t" for GetQueryCmd function.
cmd/provenanced/cmd/addresses.go Added alias "e" for AddMetaAddressEncoder command.
cmd/provenanced/cmd/config_test.go Added sdk import and logic for address cache settings in tests.
cmd/provenanced/cmd/docgen.go Added functions for generating and managing command tree views and aliases.
cmd/provenanced/cmd/docgen_test.go Added sdk import and address cache management in TestDocGen function.
cmd/provenanced/cmd/genesis_test.go Removed testdata import and added address cache management in various tests.
cmd/provenanced/cmd/pre_upgrade_test.go Added sdk import and logic for address cache settings in TestPreUpgradeCmd.
cmd/provenanced/cmd/simulate_test.go Added origAddrCacheEnabled field and logic for address cache settings in SimulateTestSuite.
cmd/provenanced/cmd/tree.go Introduced functionality to generate a tree view of available commands.
cmd/provenanced/cmd/tree_test.go Added test cases for tree command functionality.

🐇 In the land of code, commands align,
Genesis shifts, new paths define.
Aliases bloom, like flowers in spring,
Enhancing the CLI, a joyful thing.
With pruning and queries, the code does grow,
A garden of features, in neat rows.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

…cli tests because they're commonly failing because a vote is being cast just after the voting period has ended.
@SpicyLemon
Copy link
Contributor Author

SpicyLemon commented May 15, 2024

This is ready for review, but we should wait to merge it until #1968 has merged so that all the cmd unit tests are re-enabled in the github action.

Eh. I guess it doesn't matter too much. Either way they'll have to pass eventually.

@SpicyLemon SpicyLemon marked this pull request as ready for review May 15, 2024 00:18
@SpicyLemon SpicyLemon requested a review from a team as a code owner May 15, 2024 00:18
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 14

Out of diff range and nitpick comments (14)
cmd/provenanced/cmd/genaccounts.go (7)

Line range hint 130-219: Handle potential errors more gracefully.

Consider providing more user-friendly error messages and handling edge cases, such as invalid addresses and duplicate names, more gracefully.


Line range hint 221-421: Ensure proper validation of manager addresses and flags.

Ensure that the manager addresses are properly validated and that conflicting flags (e.g., --finalize and --activate) are handled correctly to prevent errors.


Line range hint 422-472: Ensure robust coin parsing and validation.

Ensure that the coin parsing and validation are robust to handle various edge cases and prevent errors.


Line range hint 473-560: Ensure robust message type validation and fee addition.

Ensure that the message type validation is robust and that the fees are correctly added to the genesis state to prevent any inconsistencies.


Line range hint 554-554: Remove redundant type assertion.

- _, ok := msg.(sdk.Msg)
+ ok := true

The type assertion to the same type is redundant and can be simplified.


Line range hint 561-674: Ensure robust market creation and permission assignment.

Ensure that the market creation and permission assignment are robust to handle various edge cases and prevent errors.


Line range hint 675-714: Ensure robust market creation and validation.

Ensure that the market creation and validation are robust to handle various edge cases and prevent errors.

CHANGELOG.md (7)

Line range hint 91-105: Use asterisks for unordered list items for consistency.

- - Bump `github.com/cosmos/ibc-go/v8` from 8.0.0 to 8.2.1 ([#1910](https://github.com/provenance-io/provenance/pull/1910), [#1956](https://github.com/provenance-io/provenance/pull/1956))
- - Bump `google.golang.org/grpc` from 1.62.1 to 1.63.2 ([#1903](https://github.com/provenance-io/provenance/pull/1903), [#1918](https://github.com/provenance-io/provenance/pull/1918))
- - Bump `bufbuild/buf-breaking-action` from 1.1.3 to 1.1.4 ([#1894](https://github.com/provenance-io/provenance/pull/1894))
- - Bump `bufbuild/buf-lint-action` from 1.1.0 to 1.1.1 ([#1895](https://github.com/provenance-io/provenance/pull/1895))
- - Bump `bufbuild/buf-setup-action` from 1.30.0 to 1.31.0 ([#1904](https://github.com/provenance-io/provenance/pull/1904), [#1949](https://github.com/provenance-io/provenance/pull/1949))
- - Bump `github.com/cometbft/cometbft` from 0.38.5 to 0.38.7 ([#1912](https://github.com/provenance-io/provenance/pull/1912), [#1959](https://github.com/provenance-io/provenance/pull/1959))
- - Bump `cosmossdk.io/x/upgrade` from 0.1.0 to 0.1.1 ([#1913](https://github.com/provenance-io/provenance/pull/1913))
- - Bump `github.com/hashicorp/go-metrics` from 0.5.2 to 0.5.3 ([#1914](https://github.com/provenance-io/provenance/pull/1914))
- - Bump `peter-evans/create-pull-request` from 6.0.2 to 6.0.5 ([#1929](https://github.com/provenance-io/provenance/pull/1929), [#1940](https://github.com/provenance-io/provenance/pull/1940), [#1955](https://github.com/provenance-io/provenance/pull/1955))
- - Bump `cosmossdk.io/x/tx` from 0.13.1 to 0.13.3 ([#1928](https://github.com/provenance-io/provenance/pull/1928), [#1944](https://github.com/provenance-io/provenance/pull/1944))
- - Bump `cosmwasm-std` from 1.4.1 to 1.4.4 ([#1950](https://github.com/provenance-io/provenance/pull/1950))
- - Bump `golangci/golangci-lint-action` from 4 to 6 ([#1951](https://github.com/provenance-io/provenance/pull/1951), [#1965](https://github.com/provenance-io/provenance/pull/1965))
- - Bump `google.golang.org/protobuf` from 1.33.0 to 1.34.1 ([#1960](https://github.com/provenance-io/provenance/pull/1960), [#1966](https://github.com/provenance-io/provenance/pull/1966))
- - Bump `github.com/hashicorp/go-getter` from 1.7.3 to 1.7.4 ([#1958](https://github.com/provenance-io/provenance/pull/1958))
- - Bump `golang.org/x/text` from 0.14.0 to 0.15.0 ([#1964](https://github.com/provenance-io/provenance/pull/1964))
+ * Bump `github.com/cosmos/ibc-go/v8` from 8.0.0 to 8.2.1 ([#1910](https://github.com/provenance-io/provenance/pull/1910), [#1956](https://github.com/provenance-io/provenance/pull/1956))
+ * Bump `google.golang.org/grpc` from 1.62.1 to 1.63.2 ([#1903](https://github.com/provenance-io/provenance/pull/1903), [#1918](https://github.com/provenance-io/provenance/pull/1918))
+ * Bump `bufbuild/buf-breaking-action` from 1.1.3 to 1.1.4 ([#1894](https://github.com/provenance-io/provenance/pull/1894))
+ * Bump `bufbuild/buf-lint-action` from 1.1.0 to 1.1.1 ([#1895](https://github.com/provenance-io/provenance/pull/1895))
+ * Bump `bufbuild/buf-setup-action` from 1.30.0 to 1.31.0 ([#1904](https://github.com/provenance-io/provenance/pull/1904), [#1949](https://github.com/provenance-io/provenance/pull/1949))
+ * Bump `github.com/cometbft/cometbft` from 0.38.5 to 0.38.7 ([#1912](https://github.com/provenance-io/provenance/pull/1912), [#1959](https://github.com/provenance-io/provenance/pull/1959))
+ * Bump `cosmossdk.io/x/upgrade` from 0.1.0 to 0.1.1 ([#1913](https://github.com/provenance-io/provenance/pull/1913))
+ * Bump `github.com/hashicorp/go-metrics` from 0.5.2 to 0.5.3 ([#1914](https://github.com/provenance-io/provenance/pull/1914))
+ * Bump `peter-evans/create-pull-request` from 6.0.2 to 6.0.5 ([#1929](https://github.com/provenance-io/provenance/pull/1929), [#1940](https://github.com/provenance-io/provenance/pull/1940), [#1955](https://github.com/provenance-io/provenance/pull/1955))
+ * Bump `cosmossdk.io/x/tx` from 0.13.1 to 0.13.3 ([#1928](https://github.com/provenance-io/provenance/pull/1928), [#1944](https://github.com/provenance-io/provenance/pull/1944))
+ * Bump `cosmwasm-std` from 1.4.1 to 1.4.4 ([#1950](https://github.com/provenance-io/provenance/pull/1950))
+ * Bump `golangci/golangci-lint-action` from 4 to 6 ([#1951](https://github.com/provenance-io/provenance/pull/1951), [#1965](https://github.com/provenance-io/provenance/pull/1965))
+ * Bump `google.golang.org/protobuf` from 1.33.0 to 1.34.1 ([#1960](https://github.com/provenance-io/provenance/pull/1960), [#1966](https://github.com/provenance-io/provenance/pull/1966))
+ * Bump `github.com/hashicorp/go-getter` from 1.7.3 to 1.7.4 ([#1958](https://github.com/provenance-io/provenance/pull/1958))
+ * Bump `golang.org/x/text` from 0.14.0 to 0.15.0 ([#1964](https://github.com/provenance-io/provenance/pull/1964))

Line range hint 175-205: Use asterisks for unordered list items for consistency.

- - The `provenanced query account` command has been removed. It is still available as `provenanced query auth account` [#1971](https://github.com/provenance-io/provenance/pull/1971).
- - Move the genesis-related commands into a new `genesis` sub-command, and remove the `genesis-` parts of their names [#1971](https://github.com/provenance-io/provenance/pull/1971).
- - Many of the SDK's query commands have had their usage altered [#1971](https://github.com/provenance-io/provenance/pull/1971).
+ * The `provenanced query account` command has been removed. It is still available as `provenanced query auth account` [#1971](https://github.com/provenance-io/provenance/pull/1971).
+ * Move the genesis-related commands into a new `genesis` sub-command, and remove the `genesis-` parts of their names [#1971](https://github.com/provenance-io/provenance/pull/1971).
+ * Many of the SDK's query commands have had their usage altered [#1971](https://github.com/provenance-io/provenance/pull/1971).

Line range hint 235-237: Use asterisks for unordered list items for consistency.

- - Bump `github.com/cosmos/ibc-go/v8` from 8.0.0 to 8.2.1 ([#1910](https://github.com/provenance-io/provenance/pull/1910), [#1956](https://github.com/provenance-io/provenance/pull/1956))
- - Bump `google.golang.org/grpc` from 1.62.1 to 1.63.2 ([#1903](https://github.com/provenance-io/provenance/pull/1903), [#1918](https://github.com/provenance-io/provenance/pull/1918))
+ * Bump `github.com/cosmos/ibc-go/v8` from 8.0.0 to 8.2.1 ([#1910](https://github.com/provenance-io/provenance/pull/1910), [#1956](https://github.com/provenance-io/provenance/pull/1956))
+ * Bump `google.golang.org/grpc` from 1.62.1 to 1.63.2 ([#1903](https://github.com/provenance-io/provenance/pull/1903), [#1918](https://github.com/provenance-io/provenance/pull/1918))

Line range hint 799-800: Remove multiple consecutive blank lines for consistency.

- 
- 
+ 

Also applies to: 1200-1201, 1217-1218, 1269-1270, 1373-1374


Line range hint 210-210: Format URLs as links for better readability.

- https://keepachangelog.com/en/1.0.0/
+ [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

Also applies to: 241-241, 340-340, 390-390, 402-402, 418-418, 489-489, 500-500, 508-508, 544-544, 569-569, 581-581, 627-631, 678-678, 719-719, 772-772, 885-885


Line range hint 927-927: Remove spaces inside emphasis markers for consistency.

- * message #<issue-number>
+ *message #<issue-number>*

Line range hint 323-323: Remove spaces inside code span elements for consistency.

- ` <issue-number> `
+ `<issue-number>`
Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 6b0c442 and 8b267f7.
Files ignored due to path filters (1)
  • go.mod is excluded by !**/*.mod
Files selected for processing (10)
  • CHANGELOG.md (1 hunks)
  • app/app.go (3 hunks)
  • cmd/provenanced/cmd/cmd_test.go (2 hunks)
  • cmd/provenanced/cmd/genaccounts.go (11 hunks)
  • cmd/provenanced/cmd/genaccounts_test.go (2 hunks)
  • cmd/provenanced/cmd/root.go (9 hunks)
  • networks/dev/blockchain-dev/entrypoint.sh (1 hunks)
  • scripts/initialize.sh (1 hunks)
  • scripts/upgrade-config.sh (1 hunks)
  • x/sanction/client/testutil/cli_test.go (1 hunks)
Files skipped from review due to trivial changes (3)
  • cmd/provenanced/cmd/cmd_test.go
  • cmd/provenanced/cmd/genaccounts_test.go
  • x/sanction/client/testutil/cli_test.go
Additional Context Used
ShellCheck (16)
networks/dev/blockchain-dev/entrypoint.sh (4)

[info] 18-18: Double quote to prevent globbing and word splitting.


[info] 20-20: Double quote to prevent globbing and word splitting.


[info] 21-21: Double quote to prevent globbing and word splitting.


[style] 22-22: Instead of 'let expr', prefer (( expr )) .

scripts/initialize.sh (11)

[info] 80-80: Double quote to prevent globbing and word splitting.


[info] 80-80: Double quote to prevent globbing and word splitting.


[info] 81-81: Double quote to prevent globbing and word splitting.


[info] 82-82: Double quote to prevent globbing and word splitting.


[info] 83-83: Double quote to prevent globbing and word splitting.


[info] 84-84: Double quote to prevent globbing and word splitting.


[info] 85-85: Double quote to prevent globbing and word splitting.


[info] 86-86: Double quote to prevent globbing and word splitting.


[info] 87-87: Double quote to prevent globbing and word splitting.


[info] 87-87: Double quote to prevent globbing and word splitting.


[info] 91-91: Double quote to prevent globbing and word splitting.

scripts/upgrade-config.sh (1)

[style] 9-9: Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead.

GitHub Check Runs (1)
golangci-lint failure (11)

cmd/provenanced/cmd/genaccounts.go: [failure] 554-554:
S1040: type assertion to the same type: msg already has type sdk.Msg (gosimple)

Additional comments not posted (9)
cmd/provenanced/cmd/root.go (5)

35-35: Imports and constants are well-organized and necessary for the functionality.


Line range hint 94-145: The NewRootCmd function sets up the root command and initializes various configurations.


Line range hint 148-172: The Execute function executes the root command and sets up the context.


Line range hint 174-212: The initRootCmd function initializes the root command with various subcommands.


Line range hint 214-258: The queryCommand and txCommand functions set up the query and transaction subcommands.

cmd/provenanced/cmd/genaccounts.go (1)

49-83: Ensure all new sub-commands are correctly integrated and tested.

Please verify that all new sub-commands added to the GenesisCmd function are correctly integrated and have corresponding test cases to ensure their functionality.

app/app.go (3)

22-23: New imports for autocli and appmodule are necessary for the new AutoCliOpts function.


47-47: The import runtimeservices is necessary for extracting AutoCLI options.


1332-1352: The AutoCliOpts function correctly gathers module options and returns them in the expected format. The use of runtimeservices.ExtractAutoCLIOptions and authcodec.NewBech32Codec ensures proper configuration.

scripts/upgrade-config.sh Outdated Show resolved Hide resolved
networks/dev/blockchain-dev/entrypoint.sh Show resolved Hide resolved
networks/dev/blockchain-dev/entrypoint.sh Show resolved Hide resolved
networks/dev/blockchain-dev/entrypoint.sh Show resolved Hide resolved
networks/dev/blockchain-dev/entrypoint.sh Show resolved Hide resolved
scripts/initialize.sh Show resolved Hide resolved
scripts/initialize.sh Show resolved Hide resolved
scripts/initialize.sh Show resolved Hide resolved
scripts/initialize.sh Show resolved Hide resolved
scripts/initialize.sh Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 8b267f7 and 0881797.
Files selected for processing (1)
  • scripts/upgrade-config.sh (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • scripts/upgrade-config.sh

Taztingo
Taztingo previously approved these changes May 15, 2024
# Conflicts:
#	cmd/provenanced/cmd/genaccounts_test.go
@SpicyLemon SpicyLemon dismissed stale reviews from nullpointer0x00 and Taztingo via 1ed19a8 May 15, 2024 15:25
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Out of diff range and nitpick comments (3)
CHANGELOG.md (3)

Line range hint 100-114: Use asterisks for unordered list items for consistency.

- Bump `github.com/cosmos/ibc-go/v8` from 8.0.0 to 8.2.1 ([#1910](https://github.com/provenance-io/provenance/pull/1910), [#1956](https://github.com/provenance-io/provenance/pull/1956))
- Bump `google.golang.org/grpc` from 1.62.1 to 1.63.2 ([#1903](https://github.com/provenance-io/provenance/pull/1903), [#1918](https://github.com/provenance-io/provenance/pull/1918))
- Bump `bufbuild/buf-breaking-action` from 1.1.3 to 1.1.4 ([#1894](https://github.com/provenance-io/provenance/pull/1894))
- Bump `bufbuild/buf-lint-action` from 1.1.0 to 1.1.1 ([#1895](https://github.com/provenance-io/provenance/pull/1895))
- Bump `bufbuild/buf-setup-action` from 1.30.0 to 1.31.0 ([#1904](https://github.com/provenance-io/provenance/pull/1904), [#1949](https://github.com/provenance-io/provenance/pull/1949))
- Bump `github.com/cometbft/cometbft` from 0.38.5 to 0.38.7 ([#1912](https://github.com/provenance-io/provenance/pull/1912), [#1959](https://github.com/provenance-io/provenance/pull/1959))
- Bump `cosmossdk.io/x/upgrade` from 0.1.0 to 0.1.1 ([#1913](https://github.com/provenance-io/provenance/pull/1913))
- Bump `github.com/hashicorp/go-metrics` from 0.5.2 to 0.5.3 ([#1914](https://github.com/provenance-io/provenance/pull/1914))
- Bump `peter-evans/create-pull-request` from 6.0.2 to 6.0.5 ([#1929](https://github.com/provenance-io/provenance/pull/1929), [#1940](https://github.com/provenance-io/provenance/pull/1940), [#1955](https://github.com/provenance-io/provenance/pull/1955))
- Bump `cosmossdk.io/x/tx` from 0.13.1 to 0.13.3 ([#1928](https://github.com/provenance-io/provenance/pull/1928), [#1944](https://github.com/provenance-io/provenance/pull/1944))
- Bump `cosmwasm-std` from 1.4.1 to 1.4.4 ([#1950](https://github.com/provenance-io/provenance/pull/1950))
- Bump `golangci/golangci-lint-action` from 4 to 6 ([#1951](https://github.com/provenance-io/provenance/pull/1951), [#1965](https://github.com/provenance-io/provenance/pull/1965))
- Bump `google.golang.org/protobuf` from 1.33.0 to 1.34.1 ([#1960](https://github.com/provenance-io/provenance/pull/1960), [#1966](https://github.com/provenance-io/provenance/pull/1966))
- Bump `github.com/hashicorp/go-getter` from 1.7.3 to 1.7.4 ([#1958](https://github.com/provenance-io/provenance/pull/1958))
+ * Bump `github.com/cosmos/ibc-go/v8` from 8.0.0 to 8.2.1 ([#1910](https://github.com/provenance-io/provenance/pull/1910), [#1956](https://github.com/provenance-io/provenance/pull/1956))
+ * Bump `google.golang.org/grpc` from 1.62.1 to 1.63.2 ([#1903](https://github.com/provenance-io/provenance/pull/1903), [#1918](https://github.com/provenance-io/provenance/pull/1918))
+ * Bump `bufbuild/buf-breaking-action` from 1.1.3 to 1.1.4 ([#1894](https://github.com/provenance-io/provenance/pull/1894))
+ * Bump `bufbuild/buf-lint-action` from 1.1.0 to 1.1.1 ([#1895](https://github.com/provenance-io/provenance/pull/1895))
+ * Bump `bufbuild/buf-setup-action` from 1.30.0 to 1.31.0 ([#1904](https://github.com/provenance-io/provenance/pull/1904), [#1949](https://github.com/provenance-io/provenance/pull/1949))
+ * Bump `github.com/cometbft/cometbft` from 0.38.5 to 0.38.7 ([#1912](https://github.com/provenance-io/provenance/pull/1912), [#1959](https://github.com/provenance-io/provenance/pull/1959))
+ * Bump `cosmossdk.io/x/upgrade` from 0.1.0 to 0.1.1 ([#1913](https://github.com/provenance-io/provenance/pull/1913))
+ * Bump `github.com/hashicorp/go-metrics` from 0.5.2 to 0.5.3 ([#1914](https://github.com/provenance-io/provenance/pull/1914))
+ * Bump `peter-evans/create-pull-request` from 6.0.2 to 6.0.5 ([#1929](https://github.com/provenance-io/provenance/pull/1929), [#1940](https://github.com/provenance-io/provenance/pull/1940), [#1955](https://github.com/provenance-io/provenance/pull/1955))
+ * Bump `cosmossdk.io/x/tx` from 0.13.1 to 0.13.3 ([#1928](https://github.com/provenance-io/provenance/pull/1928), [#1944](https://github.com/provenance-io/provenance/pull/1944))
+ * Bump `cosmwasm-std` from 1.4.1 to 1.4.4 ([#1950](https://github.com/provenance-io/provenance/pull/1950))
+ * Bump `golangci/golangci-lint-action` from 4 to 6 ([#1951](https://github.com/provenance-io/provenance/pull/1951), [#1965](https://github.com/provenance-io/provenance/pull/1965))
+ * Bump `google.golang.org/protobuf` from 1.33.0 to 1.34.1 ([#1960](https://github.com/provenance-io/provenance/pull/1960), [#1966](https://github.com/provenance-io/provenance/pull/1966))
+ * Bump `github.com/hashicorp/go-getter` from 1.7.3 to 1.7.4 ([#1958](https://github.com/provenance-io/provenance/pull/1958))

Line range hint 184-188: Use asterisks for unordered list items for consistency.

- Bump `github.com/google/uuid` from 1.3.1 to 1.6.0 ([#1723](https://github.com/provenance-io/provenance/pull/1723), [#1781](https://github.com/provenance-io/provenance/pull/1781), [#1819](https://github.com/provenance-io/provenance/pull/1819))
- Bump `github.com/gorilla/mux` from 1.8.0 to 1.8.1 ([#1734](https://github.com/provenance-io/provenance/pull/1734))
- Bump `golang.org/x/text` from 0.13.0 to 0.14.0 ([#1735](https://github.com/provenance-io/provenance/pull/1735))
- Bump `cosmossdk.io/math` from 1.1.2 to 1.3.0 ([#1739](https://github.com/provenance-io/provenance/pull/1739), [#1857](https://github.com/provenance-io/provenance/pull/1857))
- Update `async-icq` from `github.com/strangelove-ventures/async-icq/v6` to `github.com/cosmos/ibc-apps/modules/async-icq/v6.1.0` ([#1748](https://github.com/provenance-io/provenance/pull/1748))
+ * Bump `github.com/google/uuid` from 1.3.1 to 1.6.0 ([#1723](https://github.com/provenance-io/provenance/pull/1723), [#1781](https://github.com/provenance-io/provenance/pull/1781), [#1819](https://github.com/provenance-io/provenance/pull/1819))
+ * Bump `github.com/gorilla/mux` from 1.8.0 to 1.8.1 ([#1734](https://github.com/provenance-io/provenance/pull/1734))
+ * Bump `golang.org/x/text` from 0.13.0 to 0.14.0 ([#1735](https://github.com/provenance-io/provenance/pull/1735))
+ * Bump `cosmossdk.io/math` from 1.1.2 to 1.3.0 ([#1739](https://github.com/provenance-io/provenance/pull/1739), [#1857](https://github.com/provenance-io/provenance/pull/1857))
+ * Update `async-icq` from `github.com/strangelove-ventures/async-icq/v6` to `github.com/cosmos/ibc-apps/modules/async-icq/v6.1.0` ([#1748](https://github.com/provenance-io/provenance/pull/1748))

Line range hint 244-246: Use asterisks for unordered list items for consistency.

- Bump `github.com/spf13/viper` from 1.17.0 to 1.18.2 ([#1777](https://github.com/provenance-io/provenance/pull/1777), [#1795](https://github.com/provenance-io/provenance/pull/1795))
- Bump `actions/setup-go` from 4 to 5 ([#1776](https://github.com/provenance-io/provenance/pull/1776))
- Bump `github.com/spf13/cast` from 1.5.1 to 1.6.0 ([#1769](https://github.com/provenance-io/provenance/pull/1769))
+ * Bump `github.com/spf13/viper` from 1.17.0 to 1.18.2 ([#1777](https://github.com/provenance-io/provenance/pull/1777), [#1795](https://github.com/provenance-io/provenance/pull/1795))
+ * Bump `actions/setup-go` from 4 to 5 ([#1776](https://github.com/provenance-io/provenance/pull/1776))
+ * Bump `github.com/spf13/cast` from 1.5.1 to 1.6.0 ([#1769](https://github.com/provenance-io/provenance/pull/1769))
Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 0881797 and 1ed19a8.
Files selected for processing (4)
  • CHANGELOG.md (1 hunks)
  • app/app.go (3 hunks)
  • cmd/provenanced/cmd/genaccounts_test.go (2 hunks)
  • cmd/provenanced/cmd/root.go (9 hunks)
Files skipped from review as they are similar to previous changes (2)
  • app/app.go
  • cmd/provenanced/cmd/genaccounts_test.go
Additional comments not posted (6)
cmd/provenanced/cmd/root.go (6)

35-35: Import addition for keyring functionality.


Line range hint 94-128: Changes to NewRootCmd function for client context setup and configuration interception.


136-145: Addition of keyring to autocli options and enhancement of root command.


177-185: Addition of GenesisCmd to root command initialization.


Line range hint 214-231: Modification of queryCommand function to include new query commands.


Line range hint 239-252: Modification of txCommand function to include new transaction commands.

CHANGELOG.md Show resolved Hide resolved
CHANGELOG.md Show resolved Hide resolved
@SpicyLemon SpicyLemon enabled auto-merge (squash) May 15, 2024 15:38
…nesis-related stuff and doesn't even have the genaccounts command anymore.
@SpicyLemon SpicyLemon disabled auto-merge May 15, 2024 17:45
…heir old names (but still under the new genesis sub-command). Also make the add-account command alterations more robust so that we can always call it using the old and new names, even if the SDK changes it.
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 1ed19a8 and e4f6080.
Files selected for processing (7)
  • cmd/provenanced/cmd/genesis.go (11 hunks)
  • cmd/provenanced/cmd/genesis_test.go (2 hunks)
  • x/ibcratelimit/client/cli/query.go (1 hunks)
  • x/metadata/client/cli/tx.go (1 hunks)
  • x/msgfees/client/cli/query.go (1 hunks)
  • x/oracle/client/cli/tx.go (1 hunks)
  • x/trigger/client/cli/query.go (1 hunks)
Files skipped from review due to trivial changes (4)
  • x/ibcratelimit/client/cli/query.go
  • x/metadata/client/cli/tx.go
  • x/msgfees/client/cli/query.go
  • x/oracle/client/cli/tx.go
Additional comments not posted (15)
x/trigger/client/cli/query.go (1)

24-24: Alias addition looks good.

cmd/provenanced/cmd/genesis.go (7)

46-77: The added sub-commands enhance the functionality and are consistent with the existing structure.


79-137: The renaming and alias addition are handled correctly, ensuring backward compatibility.


Line range hint 184-275: The renaming and alias addition are handled correctly, ensuring backward compatibility.


Line range hint 276-477: The renaming and alias addition are handled correctly, ensuring backward compatibility.


Line range hint 478-529: The renaming and alias addition are handled correctly, ensuring backward compatibility.


Line range hint 530-618: The renaming and alias addition are handled correctly, ensuring backward compatibility.


Line range hint 619-733: The renaming and alias addition are handled correctly, ensuring backward compatibility.

cmd/provenanced/cmd/genesis_test.go (7)

24-24: The test function TestAddGenesisMsgFeeCmd is well-structured and covers various edge cases effectively.


Line range hint 63-63: The function fixEmptiesInExchangeGenState correctly handles the conversion of nil slices to empty slices.


Line range hint 163-163: The test function TestAddGenesisDefaultMarketCmd is comprehensive and effectively covers various scenarios.


Line range hint 334-334: The test function TestMakeDefaultMarket is well-structured and covers different edge cases effectively.


Line range hint 426-426: The test function TestAddGenesisCustomMarketCmd is comprehensive and effectively covers various scenarios.


Line range hint 563-563: The test function TestAddMarketsToAppState is well-structured and effectively covers different edge cases.


Line range hint 688-688: The test function TestGetNextAvailableMarketID is well-structured and effectively covers different edge cases.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between e4f6080 and cea6659.
Files selected for processing (2)
  • cmd/provenanced/cmd/root.go (11 hunks)
  • cmd/provenanced/cmd/root_test.go (2 hunks)
Additional comments not posted (11)
cmd/provenanced/cmd/root_test.go (5)

211-218: The TestFixDebugPubkeyRawTypeFlagCanary function looks good and ensures that the --type flag shorthand is correctly set.


220-234: The TestFixTxWasmInstantiate2AliasesCanary function looks good and ensures that the aliases for the instantiate2 command are correctly set.


236-248: The TestCmdsWithPersistentPreRun function looks good and ensures that no sub-commands override the root command's PersistentPreRunE function.


261-268: The TestCmdAliasesAreUnique function looks good and ensures that no command aliases are duplicated.


272-320: The assertCommandsAndAliasesAreUnique function looks good and correctly checks for unique command aliases.

cmd/provenanced/cmd/root.go (6)

10-10: The new imports for keyring and other modules are necessary for the added functionalities and look good.

Also applies to: 36-36


Line range hint 95-148: The modifications to the NewRootCmd function, including setting up AutoCliOpts and enhancing the root command, look good and add necessary functionalities.


Line range hint 180-199: The modifications to the initRootCmd function, including adding the pruning command and other necessary commands, look good and enhance the CLI.


Line range hint 217-234: The modifications to the queryCommand function, including adding the QueryEventForTxCmd and QueryBlockResultsCmd commands, look good and enhance the query capabilities.


Line range hint 242-255: The modifications to the txCommand function, including adding the GetMultiSignBatchCmd command, look good and enhance the transaction capabilities.


406-421: The fixTxWasmInstantiate2Aliases function looks good and ensures that the aliases for the instantiate2 command are correctly set.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Out of diff range and nitpick comments (1)
cmd/provenanced/cmd/root.go (1)

Line range hint 95-129: Ensure proper error handling in PersistentPreRunE.

The PersistentPreRunE function should handle errors more gracefully. Instead of panicking, consider logging the error and exiting gracefully.

-	panic(err)
+	fmt.Fprintf(os.Stderr, "Error: %v\n", err)
+	os.Exit(1)
Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between cea6659 and f160d3b.
Files selected for processing (1)
  • cmd/provenanced/cmd/root.go (11 hunks)
Additional comments not posted (4)
cmd/provenanced/cmd/root.go (4)

36-36: Ensure the keyring import is necessary.

Verify that the keyring package is used in the code. If not, it should be removed to avoid unnecessary imports.


137-146: Ensure proper initialization of autoCliOpts.

Verify that the autoCliOpts initialization and enhancement of the root command are correctly implemented and necessary for the functionality.


406-421: Ensure the fixTxWasmInstantiate2Aliases function is necessary.

Verify that the fixTxWasmInstantiate2Aliases function is necessary and correctly implemented. If it is not required, consider removing it to avoid unnecessary code.


422-422: Ensure the overwriteFlagDefaults function is necessary.

Verify that the overwriteFlagDefaults function is necessary and correctly implemented. If it is not required, consider removing it to avoid unnecessary code.

cmd/provenanced/cmd/root.go Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between f160d3b and 4284406.
Files selected for processing (4)
  • cmd/provenanced/cmd/addresses.go (1 hunks)
  • cmd/provenanced/cmd/config_test.go (3 hunks)
  • cmd/provenanced/cmd/docgen.go (2 hunks)
  • cmd/provenanced/cmd/root.go (11 hunks)
Files skipped from review due to trivial changes (1)
  • cmd/provenanced/cmd/addresses.go
Additional comments not posted (16)
cmd/provenanced/cmd/docgen.go (6)

6-6: LGTM! The import of strings is necessary for the new functions.


105-105: LGTM! The new function GetTreeCmd is well-implemented.


106-127: LGTM! The GetTreeCmd function correctly generates a tree of commands.


130-141: LGTM! The hasNameOrAlias function is correctly implemented.


143-159: LGTM! The getNameAndAliases function is correctly implemented.


161-189: LGTM! The getAllCommands function is correctly implemented.

cmd/provenanced/cmd/root.go (6)

10-10: LGTM! The import of strings is necessary for the new functions.


Line range hint 95-148: LGTM! The NewRootCmd function is correctly implemented with proper context setup and enhancements.


Line range hint 218-235: LGTM! The queryCommand function is correctly implemented.


Line range hint 243-261: LGTM! The txCommand function is correctly implemented.


407-422: LGTM! The fixTxWasmInstantiate2Aliases function is correctly implemented.


423-423: LGTM! The overwriteFlagDefaults function is correctly implemented.

cmd/provenanced/cmd/config_test.go (4)

24-24: The import of sdk "github.com/cosmos/cosmos-sdk/types" is appropriate and necessary for the changes made in the setup and teardown methods.


50-51: The addition of the origAddrCacheEnabled field in the ConfigTestSuite struct is a good practice to ensure tests do not have side effects on the global state.


56-57: Storing the original state of the address cache enabled setting and disabling it in the SetupTest method is a good practice to ensure tests do not have side effects on the global state.


91-92: Restoring the original state of the address cache enabled setting in the TearDownTest method ensures that tests do not have side effects on the global state.

…t find the one stupid one's that are causing the cache to have bad entries.
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 4284406 and fbcf2e0.
Files selected for processing (4)
  • cmd/provenanced/cmd/docgen_test.go (2 hunks)
  • cmd/provenanced/cmd/genesis_test.go (6 hunks)
  • cmd/provenanced/cmd/pre_upgrade_test.go (2 hunks)
  • cmd/provenanced/cmd/simulate_test.go (2 hunks)
Additional comments not posted (10)
cmd/provenanced/cmd/simulate_test.go (2)

42-43: The addition of the origAddrCacheEnabled field is appropriate for storing the original address cache enabled status.


47-49: The changes in SetupTest and TearDownTest methods correctly manage the address cache enabled status during tests.

Also applies to: 93-93

cmd/provenanced/cmd/docgen_test.go (1)

29-32: The changes related to managing the address cache enabled status ensure that the cache status is correctly handled during the tests.

cmd/provenanced/cmd/pre_upgrade_test.go (1)

215-218: The changes related to managing the address cache enabled status ensure that the cache status is correctly handled during the tests.

cmd/provenanced/cmd/genesis_test.go (6)

41-43: Good practice to ensure the address cache is reset after the test.


212-214: Good practice to ensure the address cache is reset after the test.


403-405: Good practice to ensure the address cache is reset after the test.


Line range hint 614-616: Good practice to ensure the address cache is reset after the test.


714-716: Good practice to ensure the address cache is reset after the test.


845-847: Good practice to ensure the address cache is reset after the test.

…nag and move to other versions if needed. Also output an error if no commands are found.
@SpicyLemon SpicyLemon enabled auto-merge (squash) May 15, 2024 21:24
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between fbcf2e0 and 703abf1.
Files selected for processing (3)
  • cmd/provenanced/cmd/pre_upgrade_test.go (3 hunks)
  • cmd/provenanced/cmd/tree.go (1 hunks)
  • cmd/provenanced/cmd/tree_test.go (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • cmd/provenanced/cmd/pre_upgrade_test.go
Additional comments not posted (6)
cmd/provenanced/cmd/tree.go (4)

10-37: The GetTreeCmd function is well-implemented and follows best practices for defining a Cobra command. The use of flags and argument handling is appropriate.


39-50: The hasNameOrAlias function is straightforward and correctly iterates over the command's aliases to check for a match.


52-68: The getNameAndAliases function correctly handles the creation of a list with the command's name and aliases, avoiding duplicates.


70-98: The getAllCommands function is well-implemented, with appropriate handling of recursion and optional inclusion of aliases.

cmd/provenanced/cmd/tree_test.go (2)

14-16: The executeTreeCmd function is simple and correctly sets up the command execution for testing.


18-155: The TestGetTreeCmd function contains comprehensive test cases that cover a wide range of scenarios, ensuring the correct functionality of the tree command.

@SpicyLemon SpicyLemon disabled auto-merge May 15, 2024 21:36
@SpicyLemon SpicyLemon enabled auto-merge (squash) May 15, 2024 21:36
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 703abf1 and 9c51585.
Files ignored due to path filters (1)
  • go.mod is excluded by !**/*.mod
Files selected for processing (1)
  • CHANGELOG.md (1 hunks)
Additional Context Used
Learnings (1)
CHANGELOG.md (1)
User: SpicyLemon
URL: https://github.com/provenance-io/provenance/pull/1930

Timestamp: 2024-04-16T20:13:24.272Z
Learning: Avoid pointing out list item marker inconsistencies in the CHANGELOG.md or similar files as per user request.
Additional comments not posted (2)
CHANGELOG.md (2)

86-86: The new feature entry for adding auto-cli commands looks good.


90-92: The client breaking changes for the provenanced query account command and genesis-related commands are well-documented.

@SpicyLemon SpicyLemon merged commit 3feae77 into main May 15, 2024
25 of 37 checks passed
@SpicyLemon SpicyLemon deleted the dwedul/1760-auto-cli branch May 15, 2024 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants