Skip to content

Commit

Permalink
fix: nil pointer panic on NewIntFromBigInt (backport cosmos#9627) (c…
Browse files Browse the repository at this point in the history
…osmos#10845)

* types: fix nil pointer panic on `NewIntFromBigInt` (cosmos#9627)

(cherry picked from commit 7f90374)

* fix conflicts

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Aleksandr Bezobchuk <aleks.bezobchuk@gmail.com>
  • Loading branch information
3 people authored and Eengineer1 committed Aug 26, 2022
1 parent a96b4cf commit 58d795d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -50,6 +50,7 @@ Ref: https://keepachangelog.com/en/1.0.0/

### Bug Fixes

* (types) [\#9627](https://github.com/cosmos/cosmos-sdk/pull/9627) Fix nil pointer panic on `NewBigIntFromInt`.
* [#10725](https://github.com/cosmos/cosmos-sdk/pull/10725) populate `ctx.ConsensusParams` for begin/end blockers.

## [v0.44.5](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.44.5) - 2021-12-02
Expand Down
3 changes: 3 additions & 0 deletions math/int_test.go
Expand Up @@ -94,6 +94,9 @@ func (s *intTestSuite) TestIntPanic() {
s.Require().NotPanics(func() { math.NewIntFromBigInt(nil) })
s.Require().True(math.NewIntFromBigInt(nil).IsNil())

s.Require().NotPanics(func() { sdk.NewIntFromBigInt(nil) })
s.Require().True(sdk.NewIntFromBigInt(nil).IsNil())

// Division-by-zero check
s.Require().Panics(func() { i1.Quo(math.NewInt(0)) })

Expand Down

0 comments on commit 58d795d

Please sign in to comment.