Skip to content

Commit

Permalink
Add Stargate queries for cosmwasm pool types (#6309)
Browse files Browse the repository at this point in the history
* Add Stargate queries for cosmwasm pool types

* update changelog

* Generated protofile changes

---------

Co-authored-by: devbot-wizard <141283918+devbot-wizard@users.noreply.github.com>
Co-authored-by: github-actions <github-actions@github.com>
  • Loading branch information
3 people authored Sep 18, 2023
1 parent 9f664d7 commit f9f5f0d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

### Misc Improvements

* [#6309](https://github.com/osmosis-labs/osmosis/pull/6309) Add Cosmwasm Pool Queries to Stargate Query
### Features

* [#6416](https://github.com/osmosis-labs/osmosis/pull/6416) feat[CL]: add num initialized ticks query
Expand Down
7 changes: 7 additions & 0 deletions wasmbinding/stargate_whitelist.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
gammv2types "github.com/osmosis-labs/osmosis/v19/x/gamm/v2types"

concentratedliquidityquery "github.com/osmosis-labs/osmosis/v19/x/concentrated-liquidity/client/queryproto"
cosmwasmpooltypes "github.com/osmosis-labs/osmosis/v19/x/cosmwasmpool/client/queryproto"
downtimequerytypes "github.com/osmosis-labs/osmosis/v19/x/downtime-detector/client/queryproto"
gammtypes "github.com/osmosis-labs/osmosis/v19/x/gamm/types"
incentivestypes "github.com/osmosis-labs/osmosis/v19/x/incentives/types"
Expand All @@ -33,6 +34,8 @@ import (

// stargateWhitelist keeps whitelist and its deterministic
// response binding for stargate queries.
// CONTRACT: since results of queries go into blocks, queries being added here should always be
// deterministic or can cause non-determinism in the state machine.
//
// The query can be multi-thread, so we have to use
// thread safe sync.Map.
Expand Down Expand Up @@ -78,6 +81,10 @@ func init() {
setWhitelistedQuery("/cosmos.staking.v1beta1.Query/Validator", &stakingtypes.QueryValidatorResponse{})

// osmosis queries
// cosmwasm pool
setWhitelistedQuery("/osmosis.cosmwasmpool.v1beta1.Query/Pools", &cosmwasmpooltypes.PoolsResponse{})
setWhitelistedQuery("/osmosis.cosmwasmpool.v1beta1.Query/Params", &cosmwasmpooltypes.ParamsResponse{})
setWhitelistedQuery("/osmosis.cosmwasmpool.v1beta1.Query/ContractInfoByPoolId", &cosmwasmpooltypes.ContractInfoByPoolIdResponse{})

// epochs
setWhitelistedQuery("/osmosis.epochs.v1beta1.Query/EpochInfos", &epochtypes.QueryEpochsInfoResponse{})
Expand Down

0 comments on commit f9f5f0d

Please sign in to comment.