-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
fix: init with config chain-id #9762
Conversation
Codecov Report
@@ Coverage Diff @@
## master #9762 +/- ##
==========================================
- Coverage 63.47% 63.31% -0.16%
==========================================
Files 566 563 -3
Lines 52794 52729 -65
==========================================
- Hits 33513 33388 -125
- Misses 17378 17435 +57
- Partials 1903 1906 +3
|
3535b9a
to
41d3039
Compare
Visit https://dashboard.github.orijtech.com?pr=9762&repo=cosmos%2Fcosmos-sdk to see benchmark details. |
x/genutil/client/cli/init.go
Outdated
chainID, _ := cmd.Flags().GetString(flags.FlagChainID) | ||
if chainID == "" { | ||
chainID = fmt.Sprintf("test-chain-%v", tmrand.Str(6)) | ||
if clientCtx.ChainID == "" { | ||
chainID = fmt.Sprintf("test-chain-%v", tmrand.Str(6)) | ||
} else { | ||
chainID = clientCtx.ChainID | ||
} |
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.
nit: this could be cleaned up with just a single switch
clause.
switch {
case chainID != "":
case clientCtx.ChainID != ""
default:
}
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.
looks good!
Description
Closes: #9604, Ref: #9644
The
init
command uses thechain-id
from the client config if--chain-id
is not provided.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...
!
to the type prefix if API or client breaking changeCHANGELOG.md
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...
!
in the type prefix if API or client breaking change