Skip to content

Commit

Permalink
regen proto
Browse files Browse the repository at this point in the history
  • Loading branch information
joldie777 committed Aug 25, 2024
1 parent c965f9d commit 58cf1ad
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 27 deletions.
13 changes: 8 additions & 5 deletions packages/neutron-sdk/src/bindings/msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,8 @@ pub enum NeutronMsg {
period: u64,
/// list of cosmwasm messages to be executed
msgs: Vec<MsgExecuteContract>,
/// execution stage where schedule will be executed
execution_stage: String,
/// execution stages where schedule will be executed
execution_stages: Vec<String>,
},

/// RemoveSchedule removes the schedule with a given `name`.
Expand Down Expand Up @@ -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<MsgExecuteContract>,
execution_stage: ExecutionStage,
execution_stages: Vec<ExecutionStage>,
) -> 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(),
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/neutron-sdk/src/proto_types/NEUTRON_COMMIT
Original file line number Diff line number Diff line change
@@ -1 +1 @@
fd5e5e5bd6d061f19a566e71aaaeaabe59406069
5c3d8f19a0c47dbd8644257536279f55cbe8b40f
51 changes: 32 additions & 19 deletions packages/neutron-sdk/src/proto_types/neutron/cron/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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<MsgExecuteContract>,
/// Last execution's block height
Expand All @@ -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<i32>,
}
/// MsgExecuteContract defines the contract and the message to pass
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
Expand All @@ -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,
Expand All @@ -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.
Expand All @@ -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<Self> {
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,
}
}
Expand All @@ -158,6 +160,7 @@ pub struct GenesisState {
#[prost(message, optional, tag = "1")]
pub params: ::core::option::Option<Params>,
}
/// QueryParamsRequest is the request type for the Query/Params RPC method.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
Expand All @@ -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,
Expand All @@ -189,6 +193,7 @@ pub struct QueryParamsResponse {
#[prost(message, optional, tag = "1")]
pub params: ::core::option::Option<Params>,
}
/// QueryGetScheduleRequest is the request type for the Query/Schedule RPC method.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
Expand All @@ -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,
Expand All @@ -225,6 +231,7 @@ pub struct QueryGetScheduleResponse {
#[prost(message, optional, tag = "1")]
pub schedule: ::core::option::Option<Schedule>,
}
/// QuerySchedulesRequest is the request type for the Query/Schedules RPC method.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
Expand All @@ -245,6 +252,7 @@ pub struct QuerySchedulesRequest {
#[prost(message, optional, tag = "1")]
pub pagination: ::core::option::Option<super::super::cosmos::base::query::v1beta1::PageRequest>,
}
/// QuerySchedulesResponse is the response type for the Query/Params RPC method.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
Expand Down Expand Up @@ -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<MsgExecuteContract>,
#[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<i32>,
}
/// MsgAddScheduleResponse defines the response structure for executing a
/// MsgAddSchedule message.
Expand Down Expand Up @@ -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,
}
Expand Down
5 changes: 4 additions & 1 deletion packages/neutron-sdk/src/proto_types/neutron/cron/v1.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use neutron_std_derive::CosmwasmExt;
/// Schedule defines the schedule for execution
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
Expand All @@ -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<MsgExecuteContract>,
/// Last execution's block height
Expand All @@ -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,
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion proto-build/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit 58cf1ad

Please sign in to comment.