diff --git a/x/move/ante/gas_prices.go b/x/move/ante/gas_prices.go index acae841d..8affb5c6 100644 --- a/x/move/ante/gas_prices.go +++ b/x/move/ante/gas_prices.go @@ -32,7 +32,7 @@ func (d GasPricesDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool } // CSR: store a tx gas prices - ctx = ctx.WithValue(GasPricesContextKey, sdk.NewDecCoinsFromCoins(feeCoins...).QuoDec(math.LegacyNewDec(int64(gas)))) + ctx = ctx.WithValue(GasPricesContextKey, sdk.NewDecCoinsFromCoins(feeCoins...).QuoDecTruncate(math.LegacyNewDec(int64(gas)))) } if next != nil { diff --git a/x/move/keeper/staking.go b/x/move/keeper/staking.go index 663f5172..fadfbffa 100644 --- a/x/move/keeper/staking.go +++ b/x/move/keeper/staking.go @@ -38,7 +38,7 @@ func (k Keeper) ShareToAmount(ctx context.Context, valAddr sdk.ValAddress, share return math.ZeroInt(), err } - tokens := val.TokensFromShares(sdk.NewDecCoins(share)) + tokens := val.TokensFromSharesTruncated(sdk.NewDecCoins(share)) return tokens.AmountOf(share.Denom).TruncateInt(), nil } diff --git a/x/move/types/connector.go b/x/move/types/connector.go index 7953c54a..8e6b0d0a 100644 --- a/x/move/types/connector.go +++ b/x/move/types/connector.go @@ -417,7 +417,7 @@ func GetQuoteSpotPrice( numerator := weightQuote.MulInt(balanceBase).TruncateDec() denominator := weightBase.MulInt(balanceQuote).TruncateDec() - return numerator.Quo(denominator) + return numerator.QuoTruncate(denominator) } // ReadUnbondingInfosFromStakingState util function to read unbonding coin amount from the StakingState