From f8168e5727bf8d397b144e700b9c22af40c9710c Mon Sep 17 00:00:00 2001 From: nhpd Date: Tue, 15 Oct 2024 12:42:50 +0400 Subject: [PATCH 1/4] introduce contractmanager#ResubmitFailure tx message and tokenfactory#FullDenom query --- .../src/types/neutron/contractmanager/mod.rs | 41 ++++++++++++++++ .../src/types/osmosis/tokenfactory/v1beta1.rs | 47 +++++++++++++++++++ proto-build/src/main.rs | 2 +- 3 files changed, 89 insertions(+), 1 deletion(-) diff --git a/packages/neutron-std/src/types/neutron/contractmanager/mod.rs b/packages/neutron-std/src/types/neutron/contractmanager/mod.rs index 19185a5..7e8334c 100644 --- a/packages/neutron-std/src/types/neutron/contractmanager/mod.rs +++ b/packages/neutron-std/src/types/neutron/contractmanager/mod.rs @@ -251,6 +251,47 @@ pub struct MsgUpdateParams { )] #[proto_message(type_url = "/neutron.contractmanager.MsgUpdateParamsResponse")] pub struct MsgUpdateParamsResponse {} +/// MsgResubmitFailure - contract that has failed acknowledgement can resubmit its failure +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/neutron.contractmanager.MsgResubmitFailure")] +pub struct MsgResubmitFailure { + /// sender is the contract which failure to acknowledge is resubmitted. + #[prost(string, tag = "1")] + pub sender: ::prost::alloc::string::String, + /// failure_id is id of failure to resubmit + /// + /// NOTE: All parameters must be supplied. + #[prost(uint64, tag = "2")] + #[serde(alias = "failureID")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub failure_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 = "/neutron.contractmanager.MsgResubmitFailureResponse")] +pub struct MsgResubmitFailureResponse {} pub struct ContractmanagerQuerier<'a, Q: cosmwasm_std::CustomQuery> { querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, } diff --git a/packages/neutron-std/src/types/osmosis/tokenfactory/v1beta1.rs b/packages/neutron-std/src/types/osmosis/tokenfactory/v1beta1.rs index a440483..7eb9607 100644 --- a/packages/neutron-std/src/types/osmosis/tokenfactory/v1beta1.rs +++ b/packages/neutron-std/src/types/osmosis/tokenfactory/v1beta1.rs @@ -255,6 +255,46 @@ pub struct QueryBeforeSendHookAddressResponse { #[prost(string, tag = "1")] pub contract_addr: ::prost::alloc::string::String, } +#[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.tokenfactory.v1beta1.QueryFullDenomRequest")] +#[proto_query( + path = "/osmosis.tokenfactory.v1beta1.Query/FullDenom", + response_type = QueryFullDenomResponse +)] +pub struct QueryFullDenomRequest { + #[prost(string, tag = "1")] + pub creator: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub subdenom: ::prost::alloc::string::String, +} +/// QueryBeforeSendHookAddressResponse defines the response structure for the +/// DenomBeforeSendHook gRPC query. +#[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.tokenfactory.v1beta1.QueryFullDenomResponse")] +pub struct QueryFullDenomResponse { + #[prost(string, tag = "1")] + pub full_denom: ::prost::alloc::string::String, +} /// MsgCreateDenom defines the message structure for the CreateDenom gRPC service /// method. It allows an account to create a new denom. It requires a sender /// address and a sub denomination. The (sender_address, sub_denomination) tuple @@ -587,4 +627,11 @@ impl<'a, Q: cosmwasm_std::CustomQuery> TokenfactoryQuerier<'a, Q> { ) -> Result { QueryBeforeSendHookAddressRequest { creator, subdenom }.query(self.querier) } + pub fn full_denom( + &self, + creator: ::prost::alloc::string::String, + subdenom: ::prost::alloc::string::String, + ) -> Result { + QueryFullDenomRequest { creator, subdenom }.query(self.querier) + } } diff --git a/proto-build/src/main.rs b/proto-build/src/main.rs index 661c056..560feff 100644 --- a/proto-build/src/main.rs +++ b/proto-build/src/main.rs @@ -23,7 +23,7 @@ const SLINKY_REPO: &str = "https://github.com/skip-mev/slinky.git"; const COSMOS_SDK_REV: &str = "v0.50.9-neutron"; /// The Neutron commit or tag to be cloned and used to build the proto files -const NEUTRON_REV: &str = "main"; +const NEUTRON_REV: &str = "cfd2e5fb9ce7a4096b2d49b654a7674313bf1c45"; /// The wasmd commit or tag to be cloned and used to build the proto files const WASMD_REV: &str = "v0.53.0-neutron"; From 1e61039a6c59bc58292029c00bf4f7758dc31b4f Mon Sep 17 00:00:00 2001 From: nhpd Date: Tue, 15 Oct 2024 15:27:16 +0400 Subject: [PATCH 2/4] rerun generate-proto --- packages/neutron-std/src/types/NEUTRON_COMMIT | 2 +- packages/neutron-std/src/types/neutron/dex/mod.rs | 5 +++++ proto-build/src/main.rs | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/neutron-std/src/types/NEUTRON_COMMIT b/packages/neutron-std/src/types/NEUTRON_COMMIT index 88d050b..ddb178d 100644 --- a/packages/neutron-std/src/types/NEUTRON_COMMIT +++ b/packages/neutron-std/src/types/NEUTRON_COMMIT @@ -1 +1 @@ -main \ No newline at end of file +ff760da49be613b8dd6971681736c86dd7741421 \ No newline at end of file diff --git a/packages/neutron-std/src/types/neutron/dex/mod.rs b/packages/neutron-std/src/types/neutron/dex/mod.rs index 007b04f..4222f70 100644 --- a/packages/neutron-std/src/types/neutron/dex/mod.rs +++ b/packages/neutron-std/src/types/neutron/dex/mod.rs @@ -454,6 +454,11 @@ pub struct MsgPlaceLimitOrder { pub max_amount_out: ::prost::alloc::string::String, #[prost(string, tag = "11")] pub limit_sell_price: ::prost::alloc::string::String, + /// min_average_sell_price is an optional parameter that sets a required minimum average price for the entire trade. + /// if the min_average_sell_price is not met the trade will fail. + /// If min_average_sell_price is omitted limit_sell_price will be used instead + #[prost(string, tag = "12")] + pub min_average_sell_price: ::prost::alloc::string::String, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive( diff --git a/proto-build/src/main.rs b/proto-build/src/main.rs index 560feff..a46e287 100644 --- a/proto-build/src/main.rs +++ b/proto-build/src/main.rs @@ -23,7 +23,7 @@ const SLINKY_REPO: &str = "https://github.com/skip-mev/slinky.git"; const COSMOS_SDK_REV: &str = "v0.50.9-neutron"; /// The Neutron commit or tag to be cloned and used to build the proto files -const NEUTRON_REV: &str = "cfd2e5fb9ce7a4096b2d49b654a7674313bf1c45"; +const NEUTRON_REV: &str = "ff760da49be613b8dd6971681736c86dd7741421"; /// The wasmd commit or tag to be cloned and used to build the proto files const WASMD_REV: &str = "v0.53.0-neutron"; From e4e54dcf999dcafa1b71040c5c75d58f82c9122b Mon Sep 17 00:00:00 2001 From: nhpd Date: Mon, 28 Oct 2024 19:16:55 +0400 Subject: [PATCH 3/4] regenerate neutron types --- packages/neutron-std/src/types/NEUTRON_COMMIT | 2 +- .../src/types/neutron/contractmanager/mod.rs | 2 -- packages/neutron-std/src/types/neutron/dex/mod.rs | 13 +++++++++++++ .../src/types/osmosis/tokenfactory/v1beta1.rs | 10 +++++++--- proto-build/src/main.rs | 2 +- 5 files changed, 22 insertions(+), 7 deletions(-) diff --git a/packages/neutron-std/src/types/NEUTRON_COMMIT b/packages/neutron-std/src/types/NEUTRON_COMMIT index ddb178d..45330a4 100644 --- a/packages/neutron-std/src/types/NEUTRON_COMMIT +++ b/packages/neutron-std/src/types/NEUTRON_COMMIT @@ -1 +1 @@ -ff760da49be613b8dd6971681736c86dd7741421 \ No newline at end of file +59ce5bc67924feaf953ef728d0a6537c75c7ada0 \ No newline at end of file diff --git a/packages/neutron-std/src/types/neutron/contractmanager/mod.rs b/packages/neutron-std/src/types/neutron/contractmanager/mod.rs index 7e8334c..e27e251 100644 --- a/packages/neutron-std/src/types/neutron/contractmanager/mod.rs +++ b/packages/neutron-std/src/types/neutron/contractmanager/mod.rs @@ -269,8 +269,6 @@ pub struct MsgResubmitFailure { #[prost(string, tag = "1")] pub sender: ::prost::alloc::string::String, /// failure_id is id of failure to resubmit - /// - /// NOTE: All parameters must be supplied. #[prost(uint64, tag = "2")] #[serde(alias = "failureID")] #[serde( diff --git a/packages/neutron-std/src/types/neutron/dex/mod.rs b/packages/neutron-std/src/types/neutron/dex/mod.rs index 4222f70..862c629 100644 --- a/packages/neutron-std/src/types/neutron/dex/mod.rs +++ b/packages/neutron-std/src/types/neutron/dex/mod.rs @@ -82,10 +82,18 @@ pub struct PoolReserves { pub key: ::core::option::Option, #[prost(string, tag = "2")] pub reserves_maker_denom: ::prost::alloc::string::String, + /// DEPRECATED: price_taker_to_maker will be removed in future release, `maker_price` should always be used. + #[deprecated] #[prost(string, tag = "3")] pub price_taker_to_maker: ::prost::alloc::string::String, + /// DEPRECATED: price_opposite_taker_maker was an internal implementation detail and will be removed in a future release. + /// It is being kept strictly for backwards compatibility. The actual field value is unused. + #[deprecated] #[prost(string, tag = "4")] pub price_opposite_taker_to_maker: ::prost::alloc::string::String, + /// This is the price of the PoolReserves denominated in the opposite token. (ie. 1 TokenA with a maker_price of 10 is worth 10 TokenB ) + #[prost(string, tag = "5")] + pub maker_price: ::prost::alloc::string::String, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive( @@ -213,8 +221,13 @@ pub struct LimitOrderTranche { /// Order deletion still functions the same and the orders will be deleted at the end of the block #[prost(message, optional, tag = "6")] pub expiration_time: ::core::option::Option, + /// DEPRECATED: price_taker_to_maker will be removed in future release, `maker_price` should always be used. + #[deprecated] #[prost(string, tag = "7")] pub price_taker_to_maker: ::prost::alloc::string::String, + /// This is the price of the LimitOrder denominated in the opposite token. (ie. 1 TokenA with a maker_price of 10 is worth 10 TokenB ) + #[prost(string, tag = "8")] + pub maker_price: ::prost::alloc::string::String, } /// Params defines the parameters for the module. #[allow(clippy::derive_partial_eq_without_eq)] diff --git a/packages/neutron-std/src/types/osmosis/tokenfactory/v1beta1.rs b/packages/neutron-std/src/types/osmosis/tokenfactory/v1beta1.rs index 7eb9607..1938859 100644 --- a/packages/neutron-std/src/types/osmosis/tokenfactory/v1beta1.rs +++ b/packages/neutron-std/src/types/osmosis/tokenfactory/v1beta1.rs @@ -215,6 +215,8 @@ pub struct QueryDenomsFromCreatorResponse { #[prost(string, repeated, tag = "1")] pub denoms: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } +/// QueryBeforeSendHookAddressRequest defines the request structure for the +/// BeforeSendHookAddress gRPC query. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -238,7 +240,7 @@ pub struct QueryBeforeSendHookAddressRequest { pub subdenom: ::prost::alloc::string::String, } /// QueryBeforeSendHookAddressResponse defines the response structure for the -/// DenomBeforeSendHook gRPC query. +/// BeforeSendHookAddress gRPC query. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -255,6 +257,8 @@ pub struct QueryBeforeSendHookAddressResponse { #[prost(string, tag = "1")] pub contract_addr: ::prost::alloc::string::String, } +/// QueryFullDenomRequest defines the request structure for the +/// FullDenom gRPC query. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -277,8 +281,8 @@ pub struct QueryFullDenomRequest { #[prost(string, tag = "2")] pub subdenom: ::prost::alloc::string::String, } -/// QueryBeforeSendHookAddressResponse defines the response structure for the -/// DenomBeforeSendHook gRPC query. +/// QueryFullDenomResponse defines the response structure for the +/// FullDenom gRPC query. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, diff --git a/proto-build/src/main.rs b/proto-build/src/main.rs index a46e287..55bca6f 100644 --- a/proto-build/src/main.rs +++ b/proto-build/src/main.rs @@ -23,7 +23,7 @@ const SLINKY_REPO: &str = "https://github.com/skip-mev/slinky.git"; const COSMOS_SDK_REV: &str = "v0.50.9-neutron"; /// The Neutron commit or tag to be cloned and used to build the proto files -const NEUTRON_REV: &str = "ff760da49be613b8dd6971681736c86dd7741421"; +const NEUTRON_REV: &str = "59ce5bc67924feaf953ef728d0a6537c75c7ada0"; /// The wasmd commit or tag to be cloned and used to build the proto files const WASMD_REV: &str = "v0.53.0-neutron"; From e196be936045944c3b8625d4f172eb96c78faa20 Mon Sep 17 00:00:00 2001 From: nhpd Date: Wed, 30 Oct 2024 18:37:49 +0400 Subject: [PATCH 4/4] use v5.0.0 for neutron --- packages/neutron-std/src/types/NEUTRON_COMMIT | 2 +- proto-build/src/main.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/neutron-std/src/types/NEUTRON_COMMIT b/packages/neutron-std/src/types/NEUTRON_COMMIT index 45330a4..8eb3891 100644 --- a/packages/neutron-std/src/types/NEUTRON_COMMIT +++ b/packages/neutron-std/src/types/NEUTRON_COMMIT @@ -1 +1 @@ -59ce5bc67924feaf953ef728d0a6537c75c7ada0 \ No newline at end of file +v5.0.0 \ No newline at end of file diff --git a/proto-build/src/main.rs b/proto-build/src/main.rs index 55bca6f..0a5061b 100644 --- a/proto-build/src/main.rs +++ b/proto-build/src/main.rs @@ -23,7 +23,7 @@ const SLINKY_REPO: &str = "https://github.com/skip-mev/slinky.git"; const COSMOS_SDK_REV: &str = "v0.50.9-neutron"; /// The Neutron commit or tag to be cloned and used to build the proto files -const NEUTRON_REV: &str = "59ce5bc67924feaf953ef728d0a6537c75c7ada0"; +const NEUTRON_REV: &str = "v5.0.0"; /// The wasmd commit or tag to be cloned and used to build the proto files const WASMD_REV: &str = "v0.53.0-neutron";