Skip to content

Commit

Permalink
refactor: ListPoolsByDenom using pool.GetPoolDenoms directly (#6914)
Browse files Browse the repository at this point in the history
* refactor: using pool.GetPoolDenoms directly

* update changelog
  • Loading branch information
levisyin authored Nov 23, 2023
1 parent 8ce7db5 commit d1f6749
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* [#6861](https://github.com/osmosis-labs/osmosis/pull/6861) Protorev address added to reduced taker fee whitelist
* [#6884](https://github.com/osmosis-labs/osmosis/pull/6884) Improve ListPoolsByDenom function filter denom logic
* [#6890](https://github.com/osmosis-labs/osmosis/pull/6890) Enable arb filter for affiliate swap contract
* [#6884](https://github.com/osmosis-labs/osmosis/pull/6914) Update ListPoolsByDenom function by using pool.GetPoolDenoms to filter denom directly

### API Breaks

Expand Down
5 changes: 1 addition & 4 deletions x/poolmanager/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -563,10 +563,7 @@ func (k Keeper) ListPoolsByDenom(

var poolsByDenom []types.PoolI
for _, pool := range currentModulePools {
poolDenoms, err := poolModule.GetPoolDenoms(ctx, pool.GetId())
if err != nil {
return nil, err
}
poolDenoms := pool.GetPoolDenoms(ctx)
if osmoutils.Contains(poolDenoms, denom) {
poolsByDenom = append(poolsByDenom, pool)
}
Expand Down

0 comments on commit d1f6749

Please sign in to comment.