From 70f9499ab1a68e3d7e88b4b919914db5d24270c4 Mon Sep 17 00:00:00 2001 From: "jaeseung.bae" Date: Fri, 3 May 2024 21:00:17 +0900 Subject: [PATCH] chore: change amount cap type --- x/fswap/client/cli/tx.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/x/fswap/client/cli/tx.go b/x/fswap/client/cli/tx.go index 75bc1dd1d1..fcf1d1ce59 100644 --- a/x/fswap/client/cli/tx.go +++ b/x/fswap/client/cli/tx.go @@ -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 } @@ -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, } @@ -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