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

Add Pool Type Query #2832

Merged
merged 5 commits into from
Sep 26, 2022
Merged

Add Pool Type Query #2832

merged 5 commits into from
Sep 26, 2022

Conversation

mattverse
Copy link
Member

@mattverse mattverse commented Sep 23, 2022

Closes: #2739

What is the purpose of the change

Adds pool type query to query the type of pool. The query would return a string of the type of pool in a string, depending on the type of pool, would return an error otherwise.

Brief Changelog

  • Add pool type query

Testing and Verifying

Added new test cases

Documentation and Release Note

  • Does this pull request introduce a new feature or user-facing behavior changes? yes
  • Is a relevant changelog entry added to the Unreleased section in CHANGELOG.md?yes
  • How is the feature or change documented? (not applicable / specification (x/<module>/spec/) / Osmosis docs repo / not documented)

@mattverse mattverse requested a review from a team September 23, 2022 04:39
@github-actions github-actions bot added the C:x/gamm Changes, features and bugs related to the gamm module. label Sep 23, 2022
@github-actions github-actions bot added the C:docs Improvements or additions to documentation label Sep 23, 2022
@ValarDragon ValarDragon added the A:backport/v12.x backport patches to v12.x branch label Sep 25, 2022

switch pool := pool.(type) {
case *balancer.Pool:
return &types.QueryPoolTypeResponse{PoolType: "Balancer"}, nil
Copy link
Member

Choose a reason for hiding this comment

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

We should have this be exposed as a method on the pool interface, right?

Or at least, lets make a go API for keeper.PoolType(ctx, poolId) (string, error), to have it in a more discoverable point

Copy link
Member Author

Choose a reason for hiding this comment

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

Changed to having go API, I would prefer having further discussion in adding pool type to PoolI, I'd like to go ahead and open an issue for this for further discussion for this if you agree!

Copy link
Member

Choose a reason for hiding this comment

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

SGTM

Copy link
Member

@ValarDragon ValarDragon left a comment

Choose a reason for hiding this comment

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

Perfect!

Can you make a followup issue for discussing adding it to the poolI api?

@mergify mergify bot merged commit ae6a366 into main Sep 26, 2022
@mergify mergify bot deleted the mattverse/pool-type branch September 26, 2022 09:32
mergify bot pushed a commit that referenced this pull request Sep 26, 2022
Closes: #2739

## What is the purpose of the change

Adds pool type query to query the type of pool. The query would return a string of the type of pool in a string, depending on the type of pool, would return an error otherwise.

## Brief Changelog
- Add pool type query

## Testing and Verifying
Added new test cases
## Documentation and Release Note

  - Does this pull request introduce a new feature or user-facing behavior changes? yes
  - Is a relevant changelog entry added to the `Unreleased` section in `CHANGELOG.md`?yes
  - How is the feature or change documented? (not applicable   /   specification (`x/<module>/spec/`)  /  [Osmosis docs repo](https://github.com/osmosis-labs/docs)   /   not documented)

(cherry picked from commit ae6a366)

# Conflicts:
#	CHANGELOG.md
@mattverse
Copy link
Member Author

#2868

pysel pushed a commit to pysel/osmosis that referenced this pull request Sep 28, 2022
Closes: osmosis-labs#2739 

## What is the purpose of the change

Adds pool type query to query the type of pool. The query would return a string of the type of pool in a string, depending on the type of pool, would return an error otherwise.


## Brief Changelog
- Add pool type query 


## Testing and Verifying
Added new test cases 
## Documentation and Release Note

  - Does this pull request introduce a new feature or user-facing behavior changes? yes 
  - Is a relevant changelog entry added to the `Unreleased` section in `CHANGELOG.md`?yes
  - How is the feature or change documented? (not applicable   /   specification (`x/<module>/spec/`)  /  [Osmosis docs repo](https://github.com/osmosis-labs/docs)   /   not documented)
mattverse added a commit that referenced this pull request Sep 30, 2022
* Add Pool Type Query (#2832)

Closes: #2739

## What is the purpose of the change

Adds pool type query to query the type of pool. The query would return a string of the type of pool in a string, depending on the type of pool, would return an error otherwise.

## Brief Changelog
- Add pool type query

## Testing and Verifying
Added new test cases
## Documentation and Release Note

  - Does this pull request introduce a new feature or user-facing behavior changes? yes
  - Is a relevant changelog entry added to the `Unreleased` section in `CHANGELOG.md`?yes
  - How is the feature or change documented? (not applicable   /   specification (`x/<module>/spec/`)  /  [Osmosis docs repo](https://github.com/osmosis-labs/docs)   /   not documented)

(cherry picked from commit ae6a366)

# Conflicts:
#	CHANGELOG.md

* fix merge conflict

Co-authored-by: Matt, Park <[email protected]>
Co-authored-by: mattverse <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A:automerge A:backport/v12.x backport patches to v12.x branch C:docs Improvements or additions to documentation C:x/gamm Changes, features and bugs related to the gamm module.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

x/gamm: Make a PoolType() query, that returns a string type name
2 participants