Skip to content

Commit

Permalink
make the code beautiful
Browse files Browse the repository at this point in the history
  • Loading branch information
MrXJC committed Oct 30, 2018
1 parent 2373e97 commit c0aa619
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
1 change: 0 additions & 1 deletion Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions app/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ const (
defaultUnbondingTime time.Duration = 60 * 10 * time.Second
// DefaultKeyPass contains the default key password for genesis transactions
DefaultKeyPass = "1234567890"

DefaultCommissionRate = "0.1"
DefaultCommissionMaxRate = "0.2"
DefaultCommissionMaxChangeRate = "0.01"
)

// State to Unmarshal
Expand Down Expand Up @@ -291,7 +287,6 @@ func CollectStdTxs(moniker string, genTxsDir string, cdc *codec.Codec) (
func NewDefaultGenesisAccount(addr sdk.AccAddress) GenesisAccount {
accAuth := auth.NewBaseAccountWithAddress(addr)
accAuth.Coins = []sdk.Coin{
{"fooToken", sdk.NewInt(1000)},
FreeFermionAcc,
}
return NewGenesisAccount(&accAuth)
Expand Down
8 changes: 4 additions & 4 deletions init/gentx.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ following delegation and commission default parameters:
commission rate: %s
commission max rate: %s
commission max change rate: %s
`, app.FreeFermionVal.String(),app.DefaultCommissionRate, app.DefaultCommissionMaxRate, app.DefaultCommissionMaxChangeRate),
`, app.FreeFermionVal.String(),defaultCommissionRate, defaultCommissionMaxRate, defaultCommissionMaxChangeRate),
RunE: func(cmd *cobra.Command, args []string) error {

config := ctx.Config
Expand Down Expand Up @@ -91,9 +91,9 @@ func prepareFlagsForTxCreateValidator(config *cfg.Config, nodeID, ip string, val
viper.Set(cli.FlagIP, ip) // --ip
viper.Set(cli.FlagPubKey, sdk.MustBech32ifyConsPub(valPubKey)) // --pubkey
viper.Set(cli.FlagAmount, app.FreeFermionVal.String()) // --amount
viper.Set(cli.FlagCommissionRate, app.DefaultCommissionRate)
viper.Set(cli.FlagCommissionMaxRate, app.DefaultCommissionMaxRate)
viper.Set(cli.FlagCommissionMaxChangeRate, app.DefaultCommissionMaxChangeRate)
viper.Set(cli.FlagCommissionRate, defaultCommissionRate)
viper.Set(cli.FlagCommissionMaxRate, defaultCommissionMaxRate)
viper.Set(cli.FlagCommissionMaxChangeRate, defaultCommissionMaxChangeRate)
viper.Set(cli.FlagGenesisFormat, true) // --genesis-format
viper.Set(cli.FlagMoniker, config.Moniker) // --moniker
if config.Moniker == "" {
Expand Down
6 changes: 6 additions & 0 deletions init/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ const (
flagMoniker = "moniker"
)

const (
defaultCommissionRate = "0.1"
defaultCommissionMaxRate = "0.2"
defaultCommissionMaxChangeRate = "0.01"
)

type initConfig struct {
ChainID string
GenTxsDir string
Expand Down

0 comments on commit c0aa619

Please sign in to comment.