Skip to content

Commit

Permalink
regen proto for Neutron Cron module
Browse files Browse the repository at this point in the history
  • Loading branch information
joldie777 committed Aug 14, 2024
1 parent 240ab2c commit 45007a5
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 4 deletions.
17 changes: 15 additions & 2 deletions packages/neutron-sdk/src/bindings/msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,8 @@ pub enum NeutronMsg {
period: u64,
/// list of cosmwasm messages to be executed
msgs: Vec<MsgExecuteContract>,
/// blocker where schedule should be executed
blocker: u64,
},

/// RemoveSchedule removes the schedule with a given `name`.
Expand Down Expand Up @@ -509,8 +511,19 @@ 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.
pub fn submit_add_schedule(name: String, period: u64, msgs: Vec<MsgExecuteContract>) -> Self {
NeutronMsg::AddSchedule { name, period, msgs }
/// * **blocker** is a blocker where schedule will be executed.
pub fn submit_add_schedule(
name: String,
period: u64,
msgs: Vec<MsgExecuteContract>,
blocker: u64,
) -> Self {
NeutronMsg::AddSchedule {
name,
period,
msgs,
blocker,
}
}

/// Basic helper to define remove schedule passed to Cron module:
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 @@
v4.1.0
ef1d7992fbdd6a927a2c7c4b4eebe2dfe2cdd27a
38 changes: 38 additions & 0 deletions packages/neutron-sdk/src/proto_types/neutron/cron.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ pub struct Schedule {
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub last_execute_height: u64,
/// Blocker where the messages will be executed
#[prost(enumeration = "BlockerType", tag = "5")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub blocker: i32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Expand Down Expand Up @@ -99,6 +106,37 @@ pub struct ScheduleCount {
)]
pub count: i32,
}
/// BlockerType defines when messages will be executed in the block
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)]
pub enum BlockerType {
Begin = 0,
End = 1,
Both = 2,
}
impl BlockerType {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
BlockerType::Begin => "BEGIN",
BlockerType::End => "END",
BlockerType::Both => "BOTH",
}
}
/// 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" => Some(Self::Begin),
"END" => Some(Self::End),
"BOTH" => Some(Self::Both),
_ => None,
}
}
}
/// GenesisState defines the cron module's genesis state.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
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 = "v4.1.0";
const NEUTRON_REV: &str = "ef1d7992fbdd6a927a2c7c4b4eebe2dfe2cdd27a";

/// 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 45007a5

Please sign in to comment.