provwasm_std/types/tendermint/
privval.rs

1use provwasm_proc_macro::CosmwasmExt;
2#[allow(clippy::derive_partial_eq_without_eq)]
3#[derive(Clone, PartialEq, Eq, ::prost::Message, ::schemars::JsonSchema, CosmwasmExt)]
4#[proto_message(type_url = "/tendermint.privval.RemoteSignerError")]
5pub struct RemoteSignerError {
6    #[prost(int32, tag = "1")]
7    pub code: i32,
8    #[prost(string, tag = "2")]
9    pub description: ::prost::alloc::string::String,
10}
11/// PubKeyRequest requests the consensus public key from the remote signer.
12#[allow(clippy::derive_partial_eq_without_eq)]
13#[derive(Clone, PartialEq, Eq, ::prost::Message, ::schemars::JsonSchema, CosmwasmExt)]
14#[proto_message(type_url = "/tendermint.privval.PubKeyRequest")]
15pub struct PubKeyRequest {
16    #[prost(string, tag = "1")]
17    pub chain_id: ::prost::alloc::string::String,
18}
19/// PubKeyResponse is a response message containing the public key.
20#[allow(clippy::derive_partial_eq_without_eq)]
21#[derive(Clone, PartialEq, Eq, ::prost::Message, ::schemars::JsonSchema, CosmwasmExt)]
22#[proto_message(type_url = "/tendermint.privval.PubKeyResponse")]
23pub struct PubKeyResponse {
24    #[prost(message, optional, tag = "1")]
25    pub pub_key: ::core::option::Option<super::crypto::PublicKey>,
26    #[prost(message, optional, tag = "2")]
27    pub error: ::core::option::Option<RemoteSignerError>,
28}
29/// SignVoteRequest is a request to sign a vote
30#[allow(clippy::derive_partial_eq_without_eq)]
31#[derive(Clone, PartialEq, Eq, ::prost::Message, ::schemars::JsonSchema, CosmwasmExt)]
32#[proto_message(type_url = "/tendermint.privval.SignVoteRequest")]
33pub struct SignVoteRequest {
34    #[prost(message, optional, tag = "1")]
35    pub vote: ::core::option::Option<super::types::Vote>,
36    #[prost(string, tag = "2")]
37    pub chain_id: ::prost::alloc::string::String,
38}
39/// SignedVoteResponse is a response containing a signed vote or an error
40#[allow(clippy::derive_partial_eq_without_eq)]
41#[derive(Clone, PartialEq, Eq, ::prost::Message, ::schemars::JsonSchema, CosmwasmExt)]
42#[proto_message(type_url = "/tendermint.privval.SignedVoteResponse")]
43pub struct SignedVoteResponse {
44    #[prost(message, optional, tag = "1")]
45    pub vote: ::core::option::Option<super::types::Vote>,
46    #[prost(message, optional, tag = "2")]
47    pub error: ::core::option::Option<RemoteSignerError>,
48}
49/// SignProposalRequest is a request to sign a proposal
50#[allow(clippy::derive_partial_eq_without_eq)]
51#[derive(Clone, PartialEq, Eq, ::prost::Message, ::schemars::JsonSchema, CosmwasmExt)]
52#[proto_message(type_url = "/tendermint.privval.SignProposalRequest")]
53pub struct SignProposalRequest {
54    #[prost(message, optional, tag = "1")]
55    pub proposal: ::core::option::Option<super::types::Proposal>,
56    #[prost(string, tag = "2")]
57    pub chain_id: ::prost::alloc::string::String,
58}
59/// SignedProposalResponse is response containing a signed proposal or an error
60#[allow(clippy::derive_partial_eq_without_eq)]
61#[derive(Clone, PartialEq, Eq, ::prost::Message, ::schemars::JsonSchema, CosmwasmExt)]
62#[proto_message(type_url = "/tendermint.privval.SignedProposalResponse")]
63pub struct SignedProposalResponse {
64    #[prost(message, optional, tag = "1")]
65    pub proposal: ::core::option::Option<super::types::Proposal>,
66    #[prost(message, optional, tag = "2")]
67    pub error: ::core::option::Option<RemoteSignerError>,
68}
69/// PingRequest is a request to confirm that the connection is alive.
70#[allow(clippy::derive_partial_eq_without_eq)]
71#[derive(Clone, Copy, PartialEq, Eq, ::prost::Message, ::schemars::JsonSchema, CosmwasmExt)]
72#[proto_message(type_url = "/tendermint.privval.PingRequest")]
73pub struct PingRequest {}
74/// PingResponse is a response to confirm that the connection is alive.
75#[allow(clippy::derive_partial_eq_without_eq)]
76#[derive(Clone, Copy, PartialEq, Eq, ::prost::Message, ::schemars::JsonSchema, CosmwasmExt)]
77#[proto_message(type_url = "/tendermint.privval.PingResponse")]
78pub struct PingResponse {}
79#[allow(clippy::derive_partial_eq_without_eq)]
80#[derive(Clone, PartialEq, Eq, ::prost::Message, ::schemars::JsonSchema, CosmwasmExt)]
81#[proto_message(type_url = "/tendermint.privval.Message")]
82pub struct Message {
83    #[prost(oneof = "message::Sum", tags = "1, 2, 3, 4, 5, 6, 7, 8")]
84    pub sum: ::core::option::Option<message::Sum>,
85}
86/// Nested message and enum types in `Message`.
87pub mod message {
88    use provwasm_proc_macro::CosmwasmExt;
89    #[allow(clippy::derive_partial_eq_without_eq)]
90    #[derive(Clone, PartialEq, Eq, ::prost::Oneof, ::schemars::JsonSchema)]
91    pub enum Sum {
92        #[prost(message, tag = "1")]
93        PubKeyRequest(super::PubKeyRequest),
94        #[prost(message, tag = "2")]
95        PubKeyResponse(super::PubKeyResponse),
96        #[prost(message, tag = "3")]
97        SignVoteRequest(super::SignVoteRequest),
98        #[prost(message, tag = "4")]
99        SignedVoteResponse(super::SignedVoteResponse),
100        #[prost(message, tag = "5")]
101        SignProposalRequest(super::SignProposalRequest),
102        #[prost(message, tag = "6")]
103        SignedProposalResponse(super::SignedProposalResponse),
104        #[prost(message, tag = "7")]
105        PingRequest(super::PingRequest),
106        #[prost(message, tag = "8")]
107        PingResponse(super::PingResponse),
108    }
109}
110#[derive(
111    Clone,
112    Copy,
113    Debug,
114    PartialEq,
115    Eq,
116    Hash,
117    PartialOrd,
118    Ord,
119    ::prost::Enumeration,
120    ::schemars::JsonSchema,
121)]
122#[repr(i32)]
123pub enum Errors {
124    Unknown = 0,
125    UnexpectedResponse = 1,
126    NoConnection = 2,
127    ConnectionTimeout = 3,
128    ReadTimeout = 4,
129    WriteTimeout = 5,
130}
131impl Errors {
132    /// String value of the enum field names used in the ProtoBuf definition.
133    ///
134    /// The values are not transformed in any way and thus are considered stable
135    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
136    pub fn as_str_name(&self) -> &'static str {
137        match self {
138            Errors::Unknown => "ERRORS_UNKNOWN",
139            Errors::UnexpectedResponse => "ERRORS_UNEXPECTED_RESPONSE",
140            Errors::NoConnection => "ERRORS_NO_CONNECTION",
141            Errors::ConnectionTimeout => "ERRORS_CONNECTION_TIMEOUT",
142            Errors::ReadTimeout => "ERRORS_READ_TIMEOUT",
143            Errors::WriteTimeout => "ERRORS_WRITE_TIMEOUT",
144        }
145    }
146    /// Creates an enum from field names used in the ProtoBuf definition.
147    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
148        match value {
149            "ERRORS_UNKNOWN" => Some(Self::Unknown),
150            "ERRORS_UNEXPECTED_RESPONSE" => Some(Self::UnexpectedResponse),
151            "ERRORS_NO_CONNECTION" => Some(Self::NoConnection),
152            "ERRORS_CONNECTION_TIMEOUT" => Some(Self::ConnectionTimeout),
153            "ERRORS_READ_TIMEOUT" => Some(Self::ReadTimeout),
154            "ERRORS_WRITE_TIMEOUT" => Some(Self::WriteTimeout),
155            _ => None,
156        }
157    }
158}