Merge PR #3625: Fix Fee Comparison
This commit is contained in:
parent
fa2e9b8518
commit
2216f4716e
|
@ -57,5 +57,7 @@ BUG FIXES
|
|||
|
||||
* SDK
|
||||
* [\#3582](https://github.com/cosmos/cosmos-sdk/pull/3582) Running `make test_unit was failing due to a missing tag
|
||||
* [\#3617] Fix fee comparison when the required fees does not contain any denom
|
||||
present in the tx fees.
|
||||
|
||||
* Tendermint
|
||||
|
|
|
@ -311,7 +311,7 @@ func (coins Coins) IsAnyGTE(coinsB Coins) bool {
|
|||
|
||||
for _, coin := range coins {
|
||||
amt := coinsB.AmountOf(coin.Denom)
|
||||
if coin.Amount.GTE(amt) {
|
||||
if coin.Amount.GTE(amt) && !amt.IsZero() {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
|
|
@ -517,6 +517,7 @@ func TestCoinsIsAnyGTE(t *testing.T) {
|
|||
assert.False(t, Coins{{"a", one}}.IsAnyGTE(Coins{}))
|
||||
assert.False(t, Coins{}.IsAnyGTE(Coins{{"a", one}}))
|
||||
assert.False(t, Coins{{"a", one}}.IsAnyGTE(Coins{{"a", two}}))
|
||||
assert.False(t, Coins{{"a", one}}.IsAnyGTE(Coins{{"b", one}}))
|
||||
assert.True(t, Coins{{"a", one}, {"b", two}}.IsAnyGTE(Coins{{"a", two}, {"b", one}}))
|
||||
assert.True(t, Coins{{"a", one}}.IsAnyGTE(Coins{{"a", one}}))
|
||||
assert.True(t, Coins{{"a", two}}.IsAnyGTE(Coins{{"a", one}}))
|
||||
|
|
Loading…
Reference in New Issue