Skip to content

Instantly share code, notes, and snippets.

@iboss-ptk
Created September 24, 2022 04:58
Show Gist options
  • Save iboss-ptk/0abc98c698cfbdc96ac12e44db11febf to your computer and use it in GitHub Desktop.
Save iboss-ptk/0abc98c698cfbdc96ac12e44db11febf to your computer and use it in GitHub Desktop.
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
struct Pool {
id: String,
address: String,
pool_params: osmosis_std::types::osmosis::gamm::v1beta1::PoolParams,
future_pool_governor: String,
pool_assets: Vec<osmosis_std::types::osmosis::gamm::v1beta1::PoolAsset>,
total_shares: osmosis_std::types::cosmos::base::v1beta1::Coin,
total_weight: String,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
struct QueryPoolResponse {
pool: Pool,
}
fn query_pool(deps: Deps, pool_id: u64) -> StdResult<QueryPoolResponse> {
let req: cosmwasm_std::QueryRequest<Empty> = QueryPoolRequest { pool_id }.into();
deps.querier.query(&req)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment