Skip to content

Commit

Permalink
add tests for sort the borrowers
Browse files Browse the repository at this point in the history
  • Loading branch information
gsk967 committed Jun 25, 2024
1 parent 7e6d206 commit 49b82e0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
- [2494](https://github.com/umee-network/umee/pull/2494) Use go 1.22
- [2495](https://github.com/umee-network/umee/pull/2495) (util) `KeyWithUint64` and `KeyWithUint32` helper functions for db keys.
- [2504](https://github.com/umee-network/umee/pull/2504) bump `wasmd` to v0.45.0.
- [2562](https://github.com/umee-network/umee/pull/2562) (x/leverage): Improved the existing inspect account response by adding `base_denom` and `base_amount`.
- [2562](https://github.com/umee-network/umee/pull/2562) (x/leverage proto): Add `base_denom` and `base_amount` to `QueryInspectResponse`.

### Bug Fixes

Expand Down
6 changes: 6 additions & 0 deletions x/leverage/keeper/grpc_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,12 @@ func (s *IntegrationTestSuite) TestQuerier_Inspect() {
},
}
require.Equal(expected, *resp)

req := &types.QueryInspect{}
req.Symbol = "UMEE"
resp, err = s.queryClient.Inspect(ctx, req)
require.NoError(err)
require.Equal(expected, *resp)
}

func (s *IntegrationTestSuite) TestQuerier_LiquidationTargets() {
Expand Down
4 changes: 4 additions & 0 deletions x/leverage/keeper/inspector.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ func (q Querier) Inspect(
break
}
}

if a.IsNil() || b.IsNil() {
return false
}
return a.GTE(b)
}
// otherwise, sorts by borrowed value (descending)
Expand Down

0 comments on commit 49b82e0

Please sign in to comment.