Skip to content

Commit

Permalink
Merge pull request #136 from terra-money/fix/cli/params
Browse files Browse the repository at this point in the history
fix: cli params order
  • Loading branch information
emidev98 authored Feb 24, 2023
2 parents 68b7c62 + b109a01 commit 9d631e1
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions x/alliance/client/cli/gov.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,32 +33,34 @@ func CreateAlliance() *cobra.Command {
return err
}

denom := args[0]

rewardWeight, err := sdk.NewDecFromStr(args[1])
if err != nil {
return err
}

rewardWeightMin, err := sdk.NewDecFromStr(args[1])
rewardWeightMin, err := sdk.NewDecFromStr(args[2])
if err != nil {
return err
}

rewardWeightMax, err := sdk.NewDecFromStr(args[1])
rewardWeightMax, err := sdk.NewDecFromStr(args[3])
if err != nil {
return err
}

takeRate, err := sdk.NewDecFromStr(args[2])
takeRate, err := sdk.NewDecFromStr(args[4])
if err != nil {
return err
}

rewardChangeRate, err := sdk.NewDecFromStr(args[3])
rewardChangeRate, err := sdk.NewDecFromStr(args[5])
if err != nil {
return err
}

rewardChangeInterval, err := time.ParseDuration(args[4])
rewardChangeInterval, err := time.ParseDuration(args[6])
if err != nil {
return err
}
Expand All @@ -78,7 +80,7 @@ func CreateAlliance() *cobra.Command {
content := types.NewMsgCreateAllianceProposal(
title,
description,
args[0],
denom,
rewardWeight,
types.RewardWeightRange{
Min: rewardWeightMin,
Expand Down Expand Up @@ -134,6 +136,8 @@ func UpdateAlliance() *cobra.Command {
return err
}

denom := args[0]

rewardWeight, err := sdk.NewDecFromStr(args[1])
if err != nil {
return err
Expand Down Expand Up @@ -169,7 +173,7 @@ func UpdateAlliance() *cobra.Command {
content := types.NewMsgUpdateAllianceProposal(
title,
description,
args[0],
denom,
rewardWeight,
takeRate,
rewardChangeRate,
Expand Down Expand Up @@ -223,6 +227,8 @@ func DeleteAlliance() *cobra.Command {

from := clientCtx.GetFromAddress()

denom := args[0]

depositStr, err := cmd.Flags().GetString(govcli.FlagDeposit)
if err != nil {
return err
Expand All @@ -236,7 +242,7 @@ func DeleteAlliance() *cobra.Command {
content := types.NewMsgDeleteAllianceProposal(
title,
description,
args[0],
denom,
)

err = content.ValidateBasic()
Expand Down

0 comments on commit 9d631e1

Please sign in to comment.