-
Notifications
You must be signed in to change notification settings - Fork 37
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
Conversation
…d. Switch to the SDK's version of AddGenesisAccountCmd since it has more options and ours didn't do anything special.
…automatically adds a 'completion' sub-commmand that does that.
…e its now redundant.
…that's beind done already now by the auto-cli stuff.
WalkthroughThe updates introduce new auto-cli commands and adjust existing SDK query commands. Key changes include replacing the Changes
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? TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Additionally, you can add CodeRabbit Configration File (
|
…cli tests because they're commonly failing because a vote is being cast just after the voting period has ended.
Eh. I guess it doesn't matter too much. Either way they'll have to pass eventually. |
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.
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 := trueThe 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
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
: TheNewRootCmd
function sets up the root command and initializes various configurations.
Line range hint
148-172
: TheExecute
function executes the root command and sets up the context.
Line range hint
174-212
: TheinitRootCmd
function initializes the root command with various subcommands.
Line range hint
214-258
: ThequeryCommand
andtxCommand
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 forautocli
andappmodule
are necessary for the newAutoCliOpts
function.
47-47
: The importruntimeservices
is necessary for extracting AutoCLI options.
1332-1352
: TheAutoCliOpts
function correctly gathers module options and returns them in the expected format. The use ofruntimeservices.ExtractAutoCLIOptions
andauthcodec.NewBech32Codec
ensures proper configuration.
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.
Actionable comments posted: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
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
# Conflicts: # cmd/provenanced/cmd/genaccounts_test.go
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.
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
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 toNewRootCmd
function for client context setup and configuration interception.
136-145
: Addition of keyring to autocli options and enhancement of root command.
177-185
: Addition ofGenesisCmd
to root command initialization.
Line range hint
214-231
: Modification ofqueryCommand
function to include new query commands.
Line range hint
239-252
: Modification oftxCommand
function to include new transaction commands.
…nesis-related stuff and doesn't even have the genaccounts command anymore.
…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.
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.
Actionable comments posted: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
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 functionTestAddGenesisMsgFeeCmd
is well-structured and covers various edge cases effectively.
Line range hint
63-63
: The functionfixEmptiesInExchangeGenState
correctly handles the conversion of nil slices to empty slices.
Line range hint
163-163
: The test functionTestAddGenesisDefaultMarketCmd
is comprehensive and effectively covers various scenarios.
Line range hint
334-334
: The test functionTestMakeDefaultMarket
is well-structured and covers different edge cases effectively.
Line range hint
426-426
: The test functionTestAddGenesisCustomMarketCmd
is comprehensive and effectively covers various scenarios.
Line range hint
563-563
: The test functionTestAddMarketsToAppState
is well-structured and effectively covers different edge cases.
Line range hint
688-688
: The test functionTestGetNextAvailableMarketID
is well-structured and effectively covers different edge cases.
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.
Actionable comments posted: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
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
: TheTestFixDebugPubkeyRawTypeFlagCanary
function looks good and ensures that the--type
flag shorthand is correctly set.
220-234
: TheTestFixTxWasmInstantiate2AliasesCanary
function looks good and ensures that the aliases for theinstantiate2
command are correctly set.
236-248
: TheTestCmdsWithPersistentPreRun
function looks good and ensures that no sub-commands override the root command'sPersistentPreRunE
function.
261-268
: TheTestCmdAliasesAreUnique
function looks good and ensures that no command aliases are duplicated.
272-320
: TheassertCommandsAndAliasesAreUnique
function looks good and correctly checks for unique command aliases.cmd/provenanced/cmd/root.go (6)
10-10
: The new imports forkeyring
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 theNewRootCmd
function, including setting upAutoCliOpts
and enhancing the root command, look good and add necessary functionalities.
Line range hint
180-199
: The modifications to theinitRootCmd
function, including adding thepruning
command and other necessary commands, look good and enhance the CLI.
Line range hint
217-234
: The modifications to thequeryCommand
function, including adding theQueryEventForTxCmd
andQueryBlockResultsCmd
commands, look good and enhance the query capabilities.
Line range hint
242-255
: The modifications to thetxCommand
function, including adding theGetMultiSignBatchCmd
command, look good and enhance the transaction capabilities.
406-421
: ThefixTxWasmInstantiate2Aliases
function looks good and ensures that the aliases for theinstantiate2
command are correctly set.
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.
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 inPersistentPreRunE
.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
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 thekeyring
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 ofautoCliOpts
.Verify that the
autoCliOpts
initialization and enhancement of the root command are correctly implemented and necessary for the functionality.
406-421
: Ensure thefixTxWasmInstantiate2Aliases
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 theoverwriteFlagDefaults
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.
…t's getting polluted by other tests.
…ands available (even hiddden ones).
… since decode has an alias of d.
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.
Actionable comments posted: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
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 ofstrings
is necessary for the new functions.
105-105
: LGTM! The new functionGetTreeCmd
is well-implemented.
106-127
: LGTM! TheGetTreeCmd
function correctly generates a tree of commands.
130-141
: LGTM! ThehasNameOrAlias
function is correctly implemented.
143-159
: LGTM! ThegetNameAndAliases
function is correctly implemented.
161-189
: LGTM! ThegetAllCommands
function is correctly implemented.cmd/provenanced/cmd/root.go (6)
10-10
: LGTM! The import ofstrings
is necessary for the new functions.
Line range hint
95-148
: LGTM! TheNewRootCmd
function is correctly implemented with proper context setup and enhancements.
Line range hint
218-235
: LGTM! ThequeryCommand
function is correctly implemented.
Line range hint
243-261
: LGTM! ThetxCommand
function is correctly implemented.
407-422
: LGTM! ThefixTxWasmInstantiate2Aliases
function is correctly implemented.
423-423
: LGTM! TheoverwriteFlagDefaults
function is correctly implemented.cmd/provenanced/cmd/config_test.go (4)
24-24
: The import ofsdk "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 theorigAddrCacheEnabled
field in theConfigTestSuite
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 theSetupTest
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 theTearDownTest
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.
…the [flags] part.
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.
Actionable comments posted: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
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 theorigAddrCacheEnabled
field is appropriate for storing the original address cache enabled status.
47-49
: The changes inSetupTest
andTearDownTest
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.
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.
Actionable comments posted: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
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
: TheGetTreeCmd
function is well-implemented and follows best practices for defining a Cobra command. The use of flags and argument handling is appropriate.
39-50
: ThehasNameOrAlias
function is straightforward and correctly iterates over the command's aliases to check for a match.
52-68
: ThegetNameAndAliases
function correctly handles the creation of a list with the command's name and aliases, avoiding duplicates.
70-98
: ThegetAllCommands
function is well-implemented, with appropriate handling of recursion and optional inclusion of aliases.cmd/provenanced/cmd/tree_test.go (2)
14-16
: TheexecuteTreeCmd
function is simple and correctly sets up the command execution for testing.
18-155
: TheTestGetTreeCmd
function contains comprehensive test cases that cover a wide range of scenarios, ensuring the correct functionality of thetree
command.
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.
Actionable comments posted: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
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 theprovenanced query account
command and genesis-related commands are well-documented.
Description
This PR:
Replaces the
tendermint
command withcomet
.Removes the
enable-cli-autocomplete
command. Cobra command now automatically adds acompletion
command that does the same thing.Moves the genesis-related commands into a new
genesis
sub-command, and removes thegenesis-
part of their name.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 asprovenanced query auth account
.Adds the following sub-commands to the
provenanced query
command:blocks
,block-results
,consensus
,event-query-tx-for
, andinterchainquery
.The
provenanced query tendermint-validator-set
is nowprovenanced query comet-validator-set
.Adds the following sub-commands to the
provenanced tx
command:auth
,consensus
,ibchooks
,interchainquery
,mint
,multisign-batch
, andupgrade
.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 fromm
tomd
to match thequery metadata alias
.The
tx oracle
command had an alias oft
that has been removed.A few other aliases were added so that the
query
andtx
commands have the same aliases for each module.Updates the aliases of the
provenanced tx wasm instantiate2
command to all end with2
so that they don't conflict with theprovenanced 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.
docs/
) or specification (x/<module>/spec/
)godoc
comments.Unreleased
section inCHANGELOG.md
Files changed
in the Github PR explorerCodecov Report
in the comment section below once CI passesSummary by CodeRabbit
New Features
Improvements
provenanced query account
withprovenanced query auth account
for better clarity.genesis
sub-command for improved organization.Bug Fixes
Testing
Chores