chore: cherry-pick some inj changes (#17109)
This commit is contained in:
+2
-1
@@ -38,7 +38,8 @@ Ref: https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.j
|
||||
|
||||
## Improvements
|
||||
|
||||
* [#16263](https://github.com/cosmos/cosmos-sdk/pull/16263) Improved math/Int.Size by computing the decimal digits count instead of firstly invoking .Marshal() then checking the length
|
||||
* [#17109](https://github.com/cosmos/cosmos-sdk/pull/17109) Add `.ToLegacyDec()` method on `math.Int` type for converting to `math.LegacyDec`.
|
||||
* [#16263](https://github.com/cosmos/cosmos-sdk/pull/16263) Improved `math/Int.Size` by computing the decimal digits count instead of firstly invoking .Marshal() then checking the length
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
|
||||
@@ -154,6 +154,11 @@ func ZeroInt() Int { return Int{big.NewInt(0)} }
|
||||
// OneInt returns Int value with one
|
||||
func OneInt() Int { return Int{big.NewInt(1)} }
|
||||
|
||||
// ToLegacyDec converts Int to LegacyDec
|
||||
func (i Int) ToLegacyDec() LegacyDec {
|
||||
return LegacyNewDecFromInt(i)
|
||||
}
|
||||
|
||||
// Int64 converts Int to int64
|
||||
// Panics if the value is out of range
|
||||
func (i Int) Int64() int64 {
|
||||
|
||||
Reference in New Issue
Block a user