From d7deafccf5262d77b0c3643fb5eb0bd4710bf232 Mon Sep 17 00:00:00 2001 From: Michael FIG Date: Thu, 1 Jul 2021 13:06:11 -0600 Subject: [PATCH] fix: enable gentx `--keyring-dir` flag to take effect (#9574) ## Description Closes: #XXXX The `--keyring-dir=xxx` flag was allowed by `appd gentx`, but wasn't actually used to search for key parameters. On investigation, it appears that `gentx` only initialized the query-side of the client context, but the tx-side needed to be initialized since keys and signing were involved. --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change (not a breaking change) - [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] provided a link to the relevant issue or specification - [x] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [x] added a changelog entry to `CHANGELOG.md` - [x] included comments for [documenting Go code](https://blog.golang.org/godoc) - [x] updated the relevant documentation or specification - [x] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable) --- CHANGELOG.md | 5 +++++ x/genutil/client/cli/gentx.go | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 33fd7a9009..2054833b29 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -59,6 +59,11 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Improvements * (cli) [\#9593](https://github.com/cosmos/cosmos-sdk/pull/9593) Check if chain-id is blank before verifying signatures in multisign and error. +### Bug Fixes + +* (x/genutil) [\#9574](https://github.com/cosmos/cosmos-sdk/pull/9575) Actually use the `gentx` client tx flags (like `--keyring-dir`) + + ## [v0.43.0-rc0](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.43.0-rc0) - 2021-06-25 ### Features diff --git a/x/genutil/client/cli/gentx.go b/x/genutil/client/cli/gentx.go index 3b1aaceb02..db00129a07 100644 --- a/x/genutil/client/cli/gentx.go +++ b/x/genutil/client/cli/gentx.go @@ -57,7 +57,7 @@ $ %s gentx my-key-name 1000000stake --home=/path/to/home/dir --keyring-backend=o ), RunE: func(cmd *cobra.Command, args []string) error { serverCtx := server.GetServerContextFromCmd(cmd) - clientCtx, err := client.GetClientQueryContext(cmd) + clientCtx, err := client.GetClientTxContext(cmd) if err != nil { return err }