Skip to content

Commit

Permalink
update protos
Browse files Browse the repository at this point in the history
  • Loading branch information
jcompagni10 committed Sep 19, 2024
1 parent 8bf4807 commit 6d9b56e
Show file tree
Hide file tree
Showing 5 changed files with 269 additions and 24 deletions.
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 @@
d557574271951b6e0fd3c7467e0a2981e068b826
6bef62c6d9182b51fd5facc41088689c809b96d5
55 changes: 44 additions & 11 deletions packages/neutron-sdk/src/proto_types/neutron/contractmanager/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,34 @@ pub struct QueryParamsResponse {
)]
#[proto_message(type_url = "/neutron.contractmanager.QueryFailuresRequest")]
#[proto_query(
path = "/neutron.contractmanager.Query/AddressFailure",
path = "/neutron.contractmanager.Query/AddressFailures",
response_type = QueryFailuresResponse
)]
pub struct QueryFailuresRequest {
/// address of the contract which Sudo call failed.
#[prost(string, tag = "1")]
pub address: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub pagination: ::core::option::Option<super::super::cosmos::base::query::v1beta1::PageRequest>,
}
/// QueryFailureRequest is request type for the Query/Failures RPC method.
#[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.QueryFailureRequest")]
#[proto_query(
path = "/neutron.contractmanager.Query/AddressFailure",
response_type = QueryFailureResponse
)]
pub struct QueryFailureRequest {
/// address of the contract which Sudo call failed.
#[prost(string, tag = "1")]
pub address: ::prost::alloc::string::String,
Expand All @@ -147,8 +171,23 @@ pub struct QueryFailuresRequest {
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub failure_id: u64,
#[prost(message, optional, tag = "3")]
pub pagination: ::core::option::Option<super::super::cosmos::base::query::v1beta1::PageRequest>,
}
/// QueryFailureResponse is response type for the Query/Failure RPC method.
#[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.QueryFailureResponse")]
pub struct QueryFailureResponse {
#[prost(message, optional, tag = "1")]
pub failure: ::core::option::Option<Failure>,
}
/// QueryFailuresResponse is response type for the Query/Failures RPC method.
#[allow(clippy::derive_partial_eq_without_eq)]
Expand Down Expand Up @@ -226,37 +265,31 @@ impl<'a, Q: cosmwasm_std::CustomQuery> ContractmanagerQuerier<'a, Q> {
&self,
address: ::prost::alloc::string::String,
failure_id: u64,
pagination: ::core::option::Option<super::super::cosmos::base::query::v1beta1::PageRequest>,
) -> Result<QueryFailuresResponse, cosmwasm_std::StdError> {
QueryFailuresRequest {
) -> Result<QueryFailureResponse, cosmwasm_std::StdError> {
QueryFailureRequest {
address,
failure_id,
pagination,
}
.query(self.querier)
}
pub fn address_failures(
&self,
address: ::prost::alloc::string::String,
failure_id: u64,
pagination: ::core::option::Option<super::super::cosmos::base::query::v1beta1::PageRequest>,
) -> Result<QueryFailuresResponse, cosmwasm_std::StdError> {
QueryFailuresRequest {
address,
failure_id,
pagination,
}
.query(self.querier)
}
pub fn failures(
&self,
address: ::prost::alloc::string::String,
failure_id: u64,
pagination: ::core::option::Option<super::super::cosmos::base::query::v1beta1::PageRequest>,
) -> Result<QueryFailuresResponse, cosmwasm_std::StdError> {
QueryFailuresRequest {
address,
failure_id,
pagination,
}
.query(self.querier)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
pub mod v1;
use neutron_std_derive::CosmwasmExt;
/// Params defines the parameters for the module.
/// Defines the parameters for the module.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
Expand All @@ -24,6 +25,7 @@ pub struct Params {
)]
pub limit: u64,
}
/// Defines the schedule for execution
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
Expand All @@ -47,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 @@ -57,7 +59,15 @@ pub struct Schedule {
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub last_execute_height: u64,
/// Stage when messages will be executed
#[prost(enumeration = "ExecutionStage", tag = "5")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub execution_stage: i32,
}
/// Defines the contract and the message to pass
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
Expand All @@ -71,13 +81,14 @@ pub struct Schedule {
)]
#[proto_message(type_url = "/neutron.cron.MsgExecuteContract")]
pub struct MsgExecuteContract {
/// Contract is the address of the smart contract
/// The address of the smart contract
#[prost(string, tag = "1")]
pub contract: ::prost::alloc::string::String,
/// Msg is json encoded message to be passed to the contract
/// JSON encoded message to be passed to the contract
#[prost(string, tag = "2")]
pub msg: ::prost::alloc::string::String,
}
/// Defines the number of current schedules
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
Expand All @@ -91,15 +102,45 @@ pub struct MsgExecuteContract {
)]
#[proto_message(type_url = "/neutron.cron.ScheduleCount")]
pub struct ScheduleCount {
/// Count is the number of current schedules
/// The number of current schedules
#[prost(int32, tag = "1")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub count: i32,
}
/// GenesisState defines the cron module's genesis state.
/// 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 ExecutionStage {
/// 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.
///
/// 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 {
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 {
"EXECUTION_STAGE_END_BLOCKER" => Some(Self::EndBlocker),
"EXECUTION_STAGE_BEGIN_BLOCKER" => Some(Self::BeginBlocker),
_ => None,
}
}
}
/// Defines the cron module's genesis state.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
Expand All @@ -119,6 +160,7 @@ pub struct GenesisState {
#[prost(message, optional, tag = "1")]
pub params: ::core::option::Option<Params>,
}
/// The request type for the Query/Params RPC method.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
Expand All @@ -133,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 {}
/// The response type for the Query/Params RPC method.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
Expand All @@ -150,6 +193,7 @@ pub struct QueryParamsResponse {
#[prost(message, optional, tag = "1")]
pub params: ::core::option::Option<Params>,
}
/// The request type for the Query/Schedule RPC method.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
Expand All @@ -170,6 +214,7 @@ pub struct QueryGetScheduleRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
/// The response type for the Query/Params RPC method.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
Expand All @@ -186,6 +231,7 @@ pub struct QueryGetScheduleResponse {
#[prost(message, optional, tag = "1")]
pub schedule: ::core::option::Option<Schedule>,
}
/// The request type for the Query/Schedules RPC method.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
Expand All @@ -206,6 +252,7 @@ pub struct QuerySchedulesRequest {
#[prost(message, optional, tag = "1")]
pub pagination: ::core::option::Option<super::super::cosmos::base::query::v1beta1::PageRequest>,
}
/// The response type for the Query/Params RPC method.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
Expand All @@ -225,7 +272,94 @@ pub struct QuerySchedulesResponse {
pub pagination:
::core::option::Option<super::super::cosmos::base::query::v1beta1::PageResponse>,
}
/// MsgUpdateParams is the MsgUpdateParams request type.
/// The MsgAddSchedule request type.
#[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.cron.MsgAddSchedule")]
pub struct MsgAddSchedule {
/// 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>,
/// Stage when messages will be executed
#[prost(enumeration = "ExecutionStage", tag = "5")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub execution_stage: i32,
}
/// Defines the response structure for executing a MsgAddSchedule message.
#[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.cron.MsgAddScheduleResponse")]
pub struct MsgAddScheduleResponse {}
/// The MsgRemoveSchedule request type.
#[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.cron.MsgRemoveSchedule")]
pub struct MsgRemoveSchedule {
/// 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,
}
/// Defines the response structure for executing a MsgRemoveSchedule message.
#[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.cron.MsgRemoveScheduleResponse")]
pub struct MsgRemoveScheduleResponse {}
/// The MsgUpdateParams request type.
///
/// Since: 0.47
#[allow(clippy::derive_partial_eq_without_eq)]
Expand All @@ -241,17 +375,16 @@ pub struct QuerySchedulesResponse {
)]
#[proto_message(type_url = "/neutron.cron.MsgUpdateParams")]
pub struct MsgUpdateParams {
/// Authority is the address of the governance account.
/// The address of the governance account.
#[prost(string, tag = "1")]
pub authority: ::prost::alloc::string::String,
/// params defines the x/cron parameters to update.
/// Defines the x/cron parameters to update.
///
/// NOTE: All parameters must be supplied.
#[prost(message, optional, tag = "2")]
pub params: ::core::option::Option<Params>,
}
/// MsgUpdateParamsResponse defines the response structure for executing a
/// MsgUpdateParams message.
/// Defines the response structure for executing a MsgUpdateParams message.
///
/// Since: 0.47
#[allow(clippy::derive_partial_eq_without_eq)]
Expand Down
Loading

0 comments on commit 6d9b56e

Please sign in to comment.