From 58cf1ada9d0f7c7d357103c05533ac8b0449bb1a Mon Sep 17 00:00:00 2001 From: Aleksandr Pismenskiy Date: Sun, 25 Aug 2024 16:43:55 +0300 Subject: [PATCH] regen proto --- packages/neutron-sdk/src/bindings/msg.rs | 13 +++-- .../src/proto_types/NEUTRON_COMMIT | 2 +- .../src/proto_types/neutron/cron/mod.rs | 51 ++++++++++++------- .../src/proto_types/neutron/cron/v1.rs | 5 +- proto-build/src/main.rs | 2 +- 5 files changed, 46 insertions(+), 27 deletions(-) diff --git a/packages/neutron-sdk/src/bindings/msg.rs b/packages/neutron-sdk/src/bindings/msg.rs index 7085787d..440fa324 100644 --- a/packages/neutron-sdk/src/bindings/msg.rs +++ b/packages/neutron-sdk/src/bindings/msg.rs @@ -218,8 +218,8 @@ pub enum NeutronMsg { period: u64, /// list of cosmwasm messages to be executed msgs: Vec, - /// execution stage where schedule will be executed - execution_stage: String, + /// execution stages where schedule will be executed + execution_stages: Vec, }, /// RemoveSchedule removes the schedule with a given `name`. @@ -512,18 +512,21 @@ impl NeutronMsg { /// * **name** is a name of the schedule; /// * **period** is a period of schedule execution in blocks; /// * **msgs** is the messages that will be executed. - /// * **execution_stage** is a stage where schedule will be executed. + /// * **execution_stages** is the stages where schedule will be executed. pub fn submit_add_schedule( name: String, period: u64, msgs: Vec, - execution_stage: ExecutionStage, + execution_stages: Vec, ) -> Self { NeutronMsg::AddSchedule { name, period, msgs, - execution_stage: execution_stage.as_str_name().to_string(), + execution_stages: execution_stages + .into_iter() + .map(|x| x.as_str_name().to_string()) + .collect(), } } diff --git a/packages/neutron-sdk/src/proto_types/NEUTRON_COMMIT b/packages/neutron-sdk/src/proto_types/NEUTRON_COMMIT index 6b2dc5da..597eff6d 100644 --- a/packages/neutron-sdk/src/proto_types/NEUTRON_COMMIT +++ b/packages/neutron-sdk/src/proto_types/NEUTRON_COMMIT @@ -1 +1 @@ -fd5e5e5bd6d061f19a566e71aaaeaabe59406069 \ No newline at end of file +5c3d8f19a0c47dbd8644257536279f55cbe8b40f \ No newline at end of file diff --git a/packages/neutron-sdk/src/proto_types/neutron/cron/mod.rs b/packages/neutron-sdk/src/proto_types/neutron/cron/mod.rs index d8463b70..02b1bee7 100644 --- a/packages/neutron-sdk/src/proto_types/neutron/cron/mod.rs +++ b/packages/neutron-sdk/src/proto_types/neutron/cron/mod.rs @@ -25,6 +25,7 @@ pub struct Params { )] pub limit: u64, } +/// Schedule defines the schedule for execution #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -48,7 +49,7 @@ pub struct Schedule { deserialize_with = "crate::serde::as_str::deserialize" )] pub period: u64, - /// Msgs that will be executed every period amount of time + /// Msgs that will be executed every certain number of blocks, specified in the `period` field #[prost(message, repeated, tag = "3")] pub msgs: ::prost::alloc::vec::Vec, /// Last execution's block height @@ -58,14 +59,15 @@ pub struct Schedule { deserialize_with = "crate::serde::as_str::deserialize" )] pub last_execute_height: u64, - /// Execution stage when messages will be executed - #[prost(enumeration = "ExecutionStage", tag = "5")] + /// Execution stages when messages will be executed + #[prost(enumeration = "ExecutionStage", repeated, packed = "false", tag = "5")] #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" )] - pub execution_stage: i32, + pub execution_stages: ::prost::alloc::vec::Vec, } +/// MsgExecuteContract defines the contract and the message to pass #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -86,6 +88,7 @@ pub struct MsgExecuteContract { #[prost(string, tag = "2")] pub msg: ::prost::alloc::string::String, } +/// ScheduleCount defines the number of current schedules #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -112,9 +115,10 @@ pub struct ScheduleCount { #[repr(i32)] #[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] pub enum ExecutionStage { - BeginBlocker = 0, - EndBlocker = 1, - BothBlockers = 2, + /// Execution at the end of the block + EndBlocker = 0, + /// Execution at the beginning of the block + BeginBlocker = 1, } impl ExecutionStage { /// String value of the enum field names used in the ProtoBuf definition. @@ -123,17 +127,15 @@ impl ExecutionStage { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - ExecutionStage::BeginBlocker => "BEGIN_BLOCKER", - ExecutionStage::EndBlocker => "END_BLOCKER", - ExecutionStage::BothBlockers => "BOTH_BLOCKERS", + ExecutionStage::EndBlocker => "EXECUTION_STAGE_END_BLOCKER", + ExecutionStage::BeginBlocker => "EXECUTION_STAGE_BEGIN_BLOCKER", } } /// Creates an enum from field names used in the ProtoBuf definition. pub fn from_str_name(value: &str) -> ::core::option::Option { match value { - "BEGIN_BLOCKER" => Some(Self::BeginBlocker), - "END_BLOCKER" => Some(Self::EndBlocker), - "BOTH_BLOCKERS" => Some(Self::BothBlockers), + "EXECUTION_STAGE_END_BLOCKER" => Some(Self::EndBlocker), + "EXECUTION_STAGE_BEGIN_BLOCKER" => Some(Self::BeginBlocker), _ => None, } } @@ -158,6 +160,7 @@ pub struct GenesisState { #[prost(message, optional, tag = "1")] pub params: ::core::option::Option, } +/// QueryParamsRequest is the request type for the Query/Params RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -172,6 +175,7 @@ pub struct GenesisState { #[proto_message(type_url = "/neutron.cron.QueryParamsRequest")] #[proto_query(path = "/neutron.cron.Query/Params", response_type = QueryParamsResponse)] pub struct QueryParamsRequest {} +/// QueryParamsResponse is the response type for the Query/Params RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -189,6 +193,7 @@ pub struct QueryParamsResponse { #[prost(message, optional, tag = "1")] pub params: ::core::option::Option, } +/// QueryGetScheduleRequest is the request type for the Query/Schedule RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -209,6 +214,7 @@ pub struct QueryGetScheduleRequest { #[prost(string, tag = "1")] pub name: ::prost::alloc::string::String, } +/// QueryGetScheduleResponse is the response type for the Query/Params RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -225,6 +231,7 @@ pub struct QueryGetScheduleResponse { #[prost(message, optional, tag = "1")] pub schedule: ::core::option::Option, } +/// QuerySchedulesRequest is the request type for the Query/Schedules RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -245,6 +252,7 @@ pub struct QuerySchedulesRequest { #[prost(message, optional, tag = "1")] pub pagination: ::core::option::Option, } +/// QuerySchedulesResponse is the response type for the Query/Params RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -281,22 +289,26 @@ pub struct MsgAddSchedule { /// Authority is the address of the governance account. #[prost(string, tag = "1")] pub authority: ::prost::alloc::string::String, + /// Name of the schedule #[prost(string, tag = "2")] pub name: ::prost::alloc::string::String, + /// Period in blocks #[prost(uint64, tag = "3")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub period: u64, + /// Msgs that will be executed every certain number of blocks, specified in the `period` field #[prost(message, repeated, tag = "4")] pub msgs: ::prost::alloc::vec::Vec, - #[prost(enumeration = "ExecutionStage", tag = "5")] + /// Execution stages when messages will be executed + #[prost(enumeration = "ExecutionStage", repeated, packed = "false", tag = "5")] #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" )] - pub execution_stage: i32, + pub execution_stages: ::prost::alloc::vec::Vec, } /// MsgAddScheduleResponse defines the response structure for executing a /// MsgAddSchedule message. @@ -330,6 +342,7 @@ pub struct MsgRemoveSchedule { /// Authority is the address of the governance account. #[prost(string, tag = "1")] pub authority: ::prost::alloc::string::String, + /// Name of the schedule #[prost(string, tag = "2")] pub name: ::prost::alloc::string::String, } diff --git a/packages/neutron-sdk/src/proto_types/neutron/cron/v1.rs b/packages/neutron-sdk/src/proto_types/neutron/cron/v1.rs index 9b0cd757..41d06fe8 100644 --- a/packages/neutron-sdk/src/proto_types/neutron/cron/v1.rs +++ b/packages/neutron-sdk/src/proto_types/neutron/cron/v1.rs @@ -1,4 +1,5 @@ use neutron_std_derive::CosmwasmExt; +/// Schedule defines the schedule for execution #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -22,7 +23,7 @@ pub struct Schedule { deserialize_with = "crate::serde::as_str::deserialize" )] pub period: u64, - /// Msgs that will be executed every period amount of time + /// Msgs that will be executed every certain number of blocks, specified in the `period` field #[prost(message, repeated, tag = "3")] pub msgs: ::prost::alloc::vec::Vec, /// Last execution's block height @@ -33,6 +34,7 @@ pub struct Schedule { )] pub last_execute_height: u64, } +/// MsgExecuteContract defines the contract and the message to pass #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -53,6 +55,7 @@ pub struct MsgExecuteContract { #[prost(string, tag = "2")] pub msg: ::prost::alloc::string::String, } +/// ScheduleCount defines the number of current schedules #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, diff --git a/proto-build/src/main.rs b/proto-build/src/main.rs index 47d86d82..4cc7b524 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.8-neutron"; /// The Neutron commit or tag to be cloned and used to build the proto files -const NEUTRON_REV: &str = "fd5e5e5bd6d061f19a566e71aaaeaabe59406069"; +const NEUTRON_REV: &str = "5c3d8f19a0c47dbd8644257536279f55cbe8b40f"; /// The wasmd commit or tag to be cloned and used to build the proto files const WASMD_REV: &str = "v0.51.0";