refactor(math)!: remove aliases in math (#16040)
Co-authored-by: Julien Robert <julien@rbrt.fr>
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
"cosmossdk.io/math"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
clienttx "github.com/cosmos/cosmos-sdk/client/tx"
|
||||
@@ -25,7 +26,7 @@ var (
|
||||
|
||||
msg = testdata.NewTestMsg(tipperAddr, aux2Addr)
|
||||
memo = "test-memo"
|
||||
tip = &txtypes.Tip{Tipper: tipperAddr.String(), Amount: sdk.NewCoins(sdk.NewCoin("tip-denom", sdk.NewIntFromUint64(123)))}
|
||||
tip = &txtypes.Tip{Tipper: tipperAddr.String(), Amount: sdk.NewCoins(sdk.NewCoin("tip-denom", math.NewIntFromUint64(123)))}
|
||||
chainID = "test-chain"
|
||||
gas = testdata.NewTestGasLimit()
|
||||
fee = testdata.NewTestFeeAmount()
|
||||
|
||||
@@ -68,7 +68,7 @@ func (bva *BaseVestingAccount) TrackDelegation(balance, vestingCoins, amount sdk
|
||||
// compute x and y per the specification, where:
|
||||
// X := min(max(V - DV, 0), D)
|
||||
// Y := D - X
|
||||
x := sdk.MinInt(sdk.MaxInt(vestingAmt.Sub(delVestingAmt), math.ZeroInt()), coin.Amount)
|
||||
x := math.MinInt(math.MaxInt(vestingAmt.Sub(delVestingAmt), math.ZeroInt()), coin.Amount)
|
||||
y := coin.Amount.Sub(x)
|
||||
|
||||
if !x.IsZero() {
|
||||
@@ -105,8 +105,8 @@ func (bva *BaseVestingAccount) TrackUndelegation(amount sdk.Coins) {
|
||||
// compute x and y per the specification, where:
|
||||
// X := min(DF, D)
|
||||
// Y := min(DV, D - X)
|
||||
x := sdk.MinInt(delegatedFree, coin.Amount)
|
||||
y := sdk.MinInt(delegatedVesting, coin.Amount.Sub(x))
|
||||
x := math.MinInt(delegatedFree, coin.Amount)
|
||||
y := math.MinInt(delegatedVesting, coin.Amount.Sub(x))
|
||||
|
||||
if !x.IsZero() {
|
||||
xCoin := sdk.NewCoin(coin.Denom, x)
|
||||
|
||||
Reference in New Issue
Block a user