0g-chain/x/cdp/simulation/utils.go
drklee3 3375484f79
Update deprecated Cosmos methods (#1530)
* Use cosmossdk.io/errors for deprecated error methods

* Update error registration with cosmossdk.io/errors

* Use cosmossdk.io/math for deprecated sdk.Int alias

* Fix modified proto file

* Update sdk.Int usage in swap hooks

* Update e2e test deprecated method usage
2023-04-05 16:21:59 -07:00

27 lines
512 B
Go

package simulation
// import (
// sdk "github.com/cosmos/cosmos-sdk/types"
// )
// func ShiftDec(x sdk.Dec, places sdkmath.Int) sdk.Dec {
// neg := places.IsNegative()
// for i := 0; i < int(abs(places.Int64())); i++ {
// if neg {
// x = x.Mul(sdk.MustNewDecFromStr("0.1"))
// } else {
// x = x.Mul(sdk.NewDecFromInt(sdkmath.NewInt(10)))
// }
// }
// return x
// }
// // abs returns the absolute value of x.
// func abs(x int64) int64 {
// if x < 0 {
// return -x
// }
// return x
// }