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: improve ListPoolsByDenom filter logic #6884

Merged
merged 6 commits into from
Nov 22, 2023
Merged

refactor: improve ListPoolsByDenom filter logic #6884

merged 6 commits into from
Nov 22, 2023

Conversation

levisyin
Copy link
Contributor

@levisyin levisyin commented Nov 16, 2023

Refer to PR #6766, get pool denoms info by k.GetTotalPoolLiquidity will lead to:

  1. fetching pool module once again(one more io op) which already known as k.poolModules range iterator
  2. filtering denom by coins.AmountOf(denom).GT(osmomath.ZeroInt()) is odd, although there is no pool with zero amount token

Testing and Verifying

This change is already covered by existing tests, such as TestListPoolsByDenom.

Copy link
Member

@mattverse mattverse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch once again! Thanks for this PR :) Let's merge this as soon as we make CI happy (slice package replacement)

x/poolmanager/router.go Outdated Show resolved Hide resolved
@mattverse mattverse self-assigned this Nov 16, 2023
@levisyin
Copy link
Contributor Author

@mattverse I have replaced slices.Contains with osmoutils.Contains, ci shows that I need to update the changelog too, not sure about this

@mattverse mattverse added A:no-changelog V:state/compatible/no_backport State machine compatible PR, depends on prior breaks and removed A:no-changelog labels Nov 20, 2023
@mattverse
Copy link
Member

@levisyin Thanks so much! Can we add changelog so that we can track this PR after merged and include it in our future release?

@levisyin
Copy link
Contributor Author

levisyin commented Nov 20, 2023

@levisyin Thanks so much! Can we add changelog so that we can track this PR after merged and include it in our future release?

@mattverse Changelog has been updated

Copy link
Member

@mattverse mattverse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :)

@mattverse mattverse merged commit d5a8a2b into osmosis-labs:main Nov 22, 2023
1 check passed
@levisyin levisyin deleted the feat/refactor-listpoolsbydenom branch November 22, 2023 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:x/poolmanager V:state/compatible/no_backport State machine compatible PR, depends on prior breaks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants