Skip to content

Commit

Permalink
Merge PR cosmos#5399: Fix Uint#LTE
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderbez authored Dec 12, 2019
1 parent a7e28de commit aa28dca
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 1 addition & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,9 @@ to detail this new feature and how state transitions occur.
* (docs/interfaces/) Add documentation on building interfaces for the Cosmos SDK.
* Redesigned user interface that features new dynamically generated sidebar, build-time code embedding from GitHub, new homepage as well as many other improvements.


### Bug Fixes

* (types) [\#5395](https://github.com/cosmos/cosmos-sdk/issues/5395) Fix `Uint#LTE`
* (client) [\#5303](https://github.com/cosmos/cosmos-sdk/issues/5303) Fix ignored error in tx generate only mode.
* (iavl) [\#5276](https://github.com/cosmos/cosmos-sdk/issues/5276) Fix potential race condition in `iavlIterator#Close`.
* (cli) [\#4763](https://github.com/cosmos/cosmos-sdk/issues/4763) Fix flag `--min-self-delegation` for staking `EditValidator`
Expand All @@ -221,8 +221,6 @@ to detail this new feature and how state transitions occur.
* (baseapp) [\#5350](https://github.com/cosmos/cosmos-sdk/issues/5350) Allow a node to restart successfully after a `halt-height` or `halt-time`
has been triggered.



## [v0.37.4] - 2019-11-04

### Improvements
Expand Down
2 changes: 1 addition & 1 deletion types/uint.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func (u Uint) GTE(u2 Uint) bool { return u.GT(u2) || u.Equal(u2) }
func (u Uint) LT(u2 Uint) bool { return lt(u.i, u2.i) }

// LTE returns true if first Uint is lesser than or equal to the second
func (u Uint) LTE(u2 Uint) bool { return !u.GTE(u2) }
func (u Uint) LTE(u2 Uint) bool { return !u.GT(u2) }

// Add adds Uint from another
func (u Uint) Add(u2 Uint) Uint { return NewUintFromBigInt(new(big.Int).Add(u.i, u2.i)) }
Expand Down
4 changes: 3 additions & 1 deletion types/uint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func TestArithUint(t *testing.T) {
}

func TestCompUint(t *testing.T) {
for d := 0; d < 1000; d++ {
for d := 0; d < 10000; d++ {
n1 := rand.Uint64()
i1 := NewUint(n1)
n2 := rand.Uint64()
Expand All @@ -156,6 +156,8 @@ func TestCompUint(t *testing.T) {
{i1.LT(i2), n1 < n2},
{i1.GTE(i2), !i1.LT(i2)},
{!i1.GTE(i2), i1.LT(i2)},
{i1.LTE(i2), n1 <= n2},
{i2.LTE(i1), n2 <= n1},
}

for tcnum, tc := range cases {
Expand Down

0 comments on commit aa28dca

Please sign in to comment.