-
Notifications
You must be signed in to change notification settings - Fork 608
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
x/gamm: Consider deleting IsActive and related checks #1904
Comments
The suggested design makes sense. This should be removed to avoid confusing people and opening up potential vectors for errors with the unused code in one of the core modules |
Following up on the discussion offline:
|
Agreed for both. I think we also discussed adding a test that would cover the "flipping" functionality – @ValarDragon you briefly mentioned mock testing as an option. Do we have any examples of something like that in our codebase/how did you envision it would look? |
Mocks refer to making a sample implementation of an interface, satisfying the minimal testing needs wanted at that spot. This is a tool that can help generating such an interface stub, but it may be easier to just make a struct in place that implements the Pool interface. I think its fine to leave the latter as a future issue, and for now just having a test for the IsActive functionality that roman noted sounds good to me. |
Sounds good! |
Background
Consider deleting
IsActive
and related checks, includinggetPoolForSwap()
. These checks were introduced for a feature that no longer exists (namely, letting people add/remove liquidity from a pool while disallowing swaps in it). Currently,IsActive
is hard-coded to return true, and every check it is used in never fails. In the spirit of not keeping code that doesn't do anything in our codebase, I think it's worth considering removing this check and its related functions.osmosis/x/gamm/pool-models/balancer/balancer_pool.go
Lines 473 to 475 in 85529c7
Suggested Design
IsActive
andgetPoolForSwap()
getPoolForSwap()
withGetPoolAndPoke()
Acceptance Criteria
The text was updated successfully, but these errors were encountered: