chore: cherry-pick some inj changes (#17109)

This commit is contained in:
Julien Robert
2023-07-24 13:07:06 +00:00
committed by GitHub
parent 9c6a225932
commit 5442197d6b
14 changed files with 71 additions and 5 deletions
+2 -1
View File
@@ -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
+5
View File
@@ -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 {