Skip to content

Commit

Permalink
chore: change amount cap type
Browse files Browse the repository at this point in the history
  • Loading branch information
jaeseung-bae committed May 3, 2024
1 parent 3ac87ab commit 70f9499
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions x/fswap/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,11 @@ Example of the content of messages-json:
if err != nil {
return err
}

amountCap, err := cmd.Flags().GetInt64(FlagAmountCapForToDenom)
amountCapStr, err := cmd.Flags().GetString(FlagAmountCapForToDenom)
if err != nil {
return err
}
amountCap, err := sdk.NewDecFromStr(amountCapStr)
if err != nil {
return err
}
Expand All @@ -194,7 +197,7 @@ Example of the content of messages-json:
swap := types.Swap{
FromDenom: fromDenom,
ToDenom: toDenom,
AmountCapForToDenom: sdk.NewInt(amountCap),
AmountCapForToDenom: amountCap.TruncateInt(),
SwapRate: swapRateDec,
}

Expand Down Expand Up @@ -228,7 +231,7 @@ Example of the content of messages-json:
cmd.Flags().String(govcli.FlagDeposit, "", "deposit of proposal")
cmd.Flags().String(FlagFromDenom, "", "cony")
cmd.Flags().String(FlagToDenom, "", "PDT")
cmd.Flags().Int64(FlagAmountCapForToDenom, 0, "tbd")
cmd.Flags().String(FlagAmountCapForToDenom, "0", "tbd")
cmd.Flags().String(FlagSwapRate, "0", "tbd")

return cmd
Expand Down

0 comments on commit 70f9499

Please sign in to comment.