provwasm_std/types/tendermint/
privval.rs

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