mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-12-27 08:45:19 +00:00
3375484f79
* 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
27 lines
512 B
Go
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
|
|
// }
|