Skip to content

Commit

Permalink
v0.16.0-beta.0
Browse files Browse the repository at this point in the history
  • Loading branch information
iboss-ptk committed Jun 14, 2023
1 parent adc60f0 commit 4fad313
Show file tree
Hide file tree
Showing 11 changed files with 199 additions and 100 deletions.
2 changes: 1 addition & 1 deletion dependencies/osmosis
Submodule osmosis updated 136 files
2 changes: 1 addition & 1 deletion packages/osmosis-std-derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description = "Procedural macro for osmosis-std"
edition = "2021"
license = "MIT OR Apache-2.0"
name = "osmosis-std-derive"
version = "0.15.2"
version = "0.16.0-beta.0"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
4 changes: 2 additions & 2 deletions packages/osmosis-std/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ description = "Standard library for Osmosis with CosmWasm support included"
edition = "2021"
license = "MIT OR Apache-2.0"
name = "osmosis-std"
version = "0.15.2"
version = "0.16.0-beta.0"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
chrono = {version = "0.4.22", default-features = false}
cosmwasm-std = {version = "1.1.2", features = ["stargate"]}
osmosis-std-derive = {version = "0.15.2", path = "../osmosis-std-derive"}
osmosis-std-derive = {version = "0.16.0-beta.0", path = "../osmosis-std-derive"}
prost = {version = "0.11.0", default-features = false, features = ["prost-derive"]}
prost-types = {version = "0.11.1", default-features = false}
schemars = "0.8.8"
Expand Down
2 changes: 2 additions & 0 deletions packages/osmosis-std/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ pub const OSMOSISD_VERSION: &str = include_str!("types/OSMOSIS_COMMIT");

mod serde;
pub mod shim;

#[allow(deprecated)]
pub mod types;

pub use shim::{cosmwasm_to_proto_coins, try_proto_to_cosmwasm_coins};
2 changes: 1 addition & 1 deletion packages/osmosis-std/src/types/OSMOSIS_COMMIT
Original file line number Diff line number Diff line change
@@ -1 +1 @@
main
roman/cw-pool-final
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ pub struct FullPositionBreakdown {
::prost::alloc::vec::Vec<super::super::super::cosmos::base::v1beta1::Coin>,
#[prost(message, repeated, tag = "6")]
pub forfeited_incentives:
::prost::alloc::vec::Vec<super::super::super::cosmos::base::v1beta1::Coin>,
::prost::alloc::vec::Vec<super::super::super::cosmos::base::v1beta1::DecCoin>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Expand Down Expand Up @@ -1011,7 +1011,7 @@ pub struct ClaimableIncentivesResponse {
::prost::alloc::vec::Vec<super::super::super::cosmos::base::v1beta1::Coin>,
#[prost(message, repeated, tag = "2")]
pub forfeited_incentives:
::prost::alloc::vec::Vec<super::super::super::cosmos::base::v1beta1::Coin>,
::prost::alloc::vec::Vec<super::super::super::cosmos::base::v1beta1::DecCoin>,
}
/// ===================== QueryPoolAccumulatorRewards
#[allow(clippy::derive_partial_eq_without_eq)]
Expand Down Expand Up @@ -1160,6 +1160,57 @@ pub struct IncentiveRecordsResponse {
pub pagination:
::core::option::Option<super::super::super::cosmos::base::query::v1beta1::PageResponse>,
}
/// =============================== CFMMPoolIdLinkFromConcentratedPoolId
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(
type_url = "/osmosis.concentratedliquidity.v1beta1.CFMMPoolIdLinkFromConcentratedPoolIdRequest"
)]
#[proto_query(
path = "/osmosis.concentratedliquidity.v1beta1.Query/CFMMPoolIdLinkFromConcentratedPoolId",
response_type = CfmmPoolIdLinkFromConcentratedPoolIdResponse
)]
pub struct CfmmPoolIdLinkFromConcentratedPoolIdRequest {
#[prost(uint64, tag = "1")]
#[serde(alias = "concentrated_poolID")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub concentrated_pool_id: u64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(
type_url = "/osmosis.concentratedliquidity.v1beta1.CFMMPoolIdLinkFromConcentratedPoolIdResponse"
)]
pub struct CfmmPoolIdLinkFromConcentratedPoolIdResponse {
#[prost(uint64, tag = "1")]
#[serde(alias = "cfmm_poolID")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub cfmm_pool_id: u64,
}
/// ===================== MsgCreatePosition
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Expand Down Expand Up @@ -1230,8 +1281,6 @@ pub struct MsgCreatePositionResponse {
pub amount0: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub amount1: ::prost::alloc::string::String,
#[prost(message, optional, tag = "4")]
pub join_time: ::core::option::Option<crate::shim::Timestamp>,
#[prost(string, tag = "5")]
pub liquidity_created: ::prost::alloc::string::String,
/// the lower and upper tick are in the response because there are
Expand Down Expand Up @@ -1439,7 +1488,7 @@ pub struct MsgCollectIncentivesResponse {
::prost::alloc::vec::Vec<super::super::super::cosmos::base::v1beta1::Coin>,
#[prost(message, repeated, tag = "2")]
pub forfeited_incentives:
::prost::alloc::vec::Vec<super::super::super::cosmos::base::v1beta1::Coin>,
::prost::alloc::vec::Vec<super::super::super::cosmos::base::v1beta1::DecCoin>,
}
/// ===================== MsgFungifyChargedPositions
#[allow(clippy::derive_partial_eq_without_eq)]
Expand Down Expand Up @@ -1590,4 +1639,13 @@ impl<'a, Q: cosmwasm_std::CustomQuery> ConcentratedliquidityQuerier<'a, Q> {
}
.query(self.querier)
}
pub fn cfmm_pool_id_link_from_concentrated_pool_id(
&self,
concentrated_pool_id: u64,
) -> Result<CfmmPoolIdLinkFromConcentratedPoolIdResponse, cosmwasm_std::StdError> {
CfmmPoolIdLinkFromConcentratedPoolIdRequest {
concentrated_pool_id,
}
.query(self.querier)
}
}
112 changes: 111 additions & 1 deletion packages/osmosis-std/src/types/osmosis/cosmwasmpool/v1beta1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ pub struct MsgCreateCosmWasmPoolResponse {
)]
pub pool_id: u64,
}
/// =============================== Params
/// =============================== ContractInfoByPoolId
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
Expand Down Expand Up @@ -776,14 +776,124 @@ pub struct ParamsResponse {
#[prost(message, optional, tag = "1")]
pub params: ::core::option::Option<Params>,
}
/// =============================== Pools
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/osmosis.cosmwasmpool.v1beta1.PoolsRequest")]
#[proto_query(
path = "/osmosis.cosmwasmpool.v1beta1.Query/Pools",
response_type = PoolsResponse
)]
pub struct PoolsRequest {
/// pagination defines an optional pagination for the request.
#[prost(message, optional, tag = "2")]
pub pagination:
::core::option::Option<super::super::super::cosmos::base::query::v1beta1::PageRequest>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/osmosis.cosmwasmpool.v1beta1.PoolsResponse")]
pub struct PoolsResponse {
#[prost(message, repeated, tag = "1")]
pub pools: ::prost::alloc::vec::Vec<crate::shim::Any>,
/// pagination defines the pagination in the response.
#[prost(message, optional, tag = "2")]
pub pagination:
::core::option::Option<super::super::super::cosmos::base::query::v1beta1::PageResponse>,
}
/// =============================== ContractInfoByPoolId
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/osmosis.cosmwasmpool.v1beta1.ContractInfoByPoolIdRequest")]
#[proto_query(
path = "/osmosis.cosmwasmpool.v1beta1.Query/ContractInfoByPoolId",
response_type = ContractInfoByPoolIdResponse
)]
pub struct ContractInfoByPoolIdRequest {
/// pool_id is the pool id of the requested pool.
#[prost(uint64, tag = "1")]
#[serde(alias = "poolID")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub pool_id: u64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/osmosis.cosmwasmpool.v1beta1.ContractInfoByPoolIdResponse")]
pub struct ContractInfoByPoolIdResponse {
/// contract_address is the pool address and contract address
/// of the requested pool id.
#[prost(string, tag = "1")]
pub contract_address: ::prost::alloc::string::String,
/// code_id is the code id of the requested pool id.
#[prost(uint64, tag = "2")]
#[serde(alias = "codeID")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub code_id: u64,
}
pub struct CosmwasmpoolQuerier<'a, Q: cosmwasm_std::CustomQuery> {
querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>,
}
impl<'a, Q: cosmwasm_std::CustomQuery> CosmwasmpoolQuerier<'a, Q> {
pub fn new(querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>) -> Self {
Self { querier }
}
pub fn pools(
&self,
pagination: ::core::option::Option<
super::super::super::cosmos::base::query::v1beta1::PageRequest,
>,
) -> Result<PoolsResponse, cosmwasm_std::StdError> {
PoolsRequest { pagination }.query(self.querier)
}
pub fn params(&self) -> Result<ParamsResponse, cosmwasm_std::StdError> {
ParamsRequest {}.query(self.querier)
}
pub fn contract_info_by_pool_id(
&self,
pool_id: u64,
) -> Result<ContractInfoByPoolIdResponse, cosmwasm_std::StdError> {
ContractInfoByPoolIdRequest { pool_id }.query(self.querier)
}
}
14 changes: 14 additions & 0 deletions packages/osmosis-std/src/types/osmosis/incentives.rs
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,20 @@ pub struct MsgCreateGauge {
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub num_epochs_paid_over: u64,
/// pool_id is the ID of the pool that the gauge is meant to be associated
/// with. if pool_id is set, then the "QueryCondition.LockQueryType" must be
/// "NoLock" with all other fields of the "QueryCondition.LockQueryType" struct
/// unset, including "QueryCondition.Denom". However, note that, internally,
/// the empty string in "QueryCondition.Denom" ends up being overwritten with
/// incentivestypes.NoLockExternalGaugeDenom(<pool-id>) so that the gauges
/// associated with a pool can be queried by this prefix if needed.
#[prost(uint64, tag = "7")]
#[serde(alias = "poolID")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub pool_id: u64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Expand Down
3 changes: 3 additions & 0 deletions packages/osmosis-std/src/types/osmosis/lockup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ pub struct SyntheticLock {
pub enum LockQueryType {
ByDuration = 0,
ByTime = 1,
NoLock = 2,
}
impl LockQueryType {
/// String value of the enum field names used in the ProtoBuf definition.
Expand All @@ -143,13 +144,15 @@ impl LockQueryType {
match self {
LockQueryType::ByDuration => "ByDuration",
LockQueryType::ByTime => "ByTime",
LockQueryType::NoLock => "NoLock",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"ByDuration" => Some(Self::ByDuration),
"ByTime" => Some(Self::ByTime),
"NoLock" => Some(Self::NoLock),
_ => None,
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/proto-build/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use proto_build::{
const COSMOS_SDK_REV: &str = "osmosis-main";

/// The osmosis commit or tag to be cloned and used to build the proto files
const OSMOSIS_REV: &str = "main";
const OSMOSIS_REV: &str = "roman/cw-pool-final";

/// The wasmd commit or tag to be cloned and used to build the proto files
const WASMD_REV: &str = "v0.31.0-osmo-v16";
Expand Down
Loading

0 comments on commit 4fad313

Please sign in to comment.