Skip to content

Commit

Permalink
chore: minor change for convert to-coin-amount-cap
Browse files Browse the repository at this point in the history
  • Loading branch information
jaeseung-bae committed May 3, 2024
1 parent ebefc77 commit 99f9193
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions x/fswap/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/Finschia/finschia-sdk/client/flags"
"github.com/Finschia/finschia-sdk/client/tx"
sdk "github.com/Finschia/finschia-sdk/types"
sdkerrors "github.com/Finschia/finschia-sdk/types/errors"
bank "github.com/Finschia/finschia-sdk/x/bank/types"
"github.com/Finschia/finschia-sdk/x/fswap/types"
govcli "github.com/Finschia/finschia-sdk/x/gov/client/cli"
Expand Down Expand Up @@ -181,9 +182,9 @@ Example of the content of messages-json:
if err != nil {
return err
}
amountCap, err := sdk.NewDecFromStr(amountCapStr)
if err != nil {
return err
amountCap, ok := sdk.NewIntFromString(amountCapStr)
if !ok {
return sdkerrors.ErrInvalidRequest.Wrapf("failed to parse %s %s", FlagAmountCapForToDenom, amountCap.String())
}

swapRate, err := cmd.Flags().GetString(FlagSwapRate)
Expand All @@ -197,7 +198,7 @@ Example of the content of messages-json:
swap := types.Swap{
FromDenom: fromDenom,
ToDenom: toDenom,
AmountCapForToDenom: amountCap.TruncateInt(),
AmountCapForToDenom: amountCap,
SwapRate: swapRateDec,
}

Expand Down

0 comments on commit 99f9193

Please sign in to comment.