Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: ListPoolsByDenom using pool.GetPoolDenoms directly #6914

Merged
merged 3 commits into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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