Skip to content

Commit

Permalink
Merge PR cosmos#1648: Write moniker on 'gaiad init' and 'gaiad init g…
Browse files Browse the repository at this point in the history
…en-tx'

* Write moniker on 'gaiad init' and 'gaiad init gen-tx'
* Update changelog
* Add comment to second instance
* Checkout Gopkg.lock
  • Loading branch information
cwgoes authored Jul 13, 2018
1 parent 43b9cc6 commit 78edba8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ BUG FIXES
* \#1630 - redelegation nolonger removes tokens from the delegator liquid account
* [keys] \#1629 - updating password no longer asks for a new password when the first entered password was incorrect
* [lcd] importing an account would create a random account
* [server] 'gaiad init' command family now writes provided name as the moniker in `config.toml`

## 0.20.0

Expand Down
10 changes: 10 additions & 0 deletions server/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@ func gentxWithConfig(cdc *wire.Codec, appInit AppInit, config *cfg.Config, genTx
return
}

// Write updated config with moniker
config.Moniker = genTxConfig.Name
configFilePath := filepath.Join(config.RootDir, "config", "config.toml")
cfg.WriteConfigFile(configFilePath, config)

return
}

Expand Down Expand Up @@ -240,6 +245,11 @@ func initWithConfig(cdc *wire.Codec, appInit AppInit, config *cfg.Config, initCo
viper.GetBool(FlagOWK),
"127.0.0.1",
}

// Write updated config with moniker
config.Moniker = genTxConfig.Name
configFilePath := filepath.Join(config.RootDir, "config", "config.toml")
cfg.WriteConfigFile(configFilePath, config)
appGenTx, am, validator, err := appInit.AppGenTx(cdc, pubKey, genTxConfig)
appMessage = am
if err != nil {
Expand Down

0 comments on commit 78edba8

Please sign in to comment.