penumbra_sdk_proto/gen/cosmos.tx.signing.v1beta1.rs
1// This file is @generated by prost-build.
2/// SignatureDescriptors wraps multiple SignatureDescriptor's.
3#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct SignatureDescriptors {
5 /// signatures are the signature descriptors
6 #[prost(message, repeated, tag = "1")]
7 pub signatures: ::prost::alloc::vec::Vec<SignatureDescriptor>,
8}
9impl ::prost::Name for SignatureDescriptors {
10 const NAME: &'static str = "SignatureDescriptors";
11 const PACKAGE: &'static str = "cosmos.tx.signing.v1beta1";
12 fn full_name() -> ::prost::alloc::string::String {
13 "cosmos.tx.signing.v1beta1.SignatureDescriptors".into()
14 }
15 fn type_url() -> ::prost::alloc::string::String {
16 "/cosmos.tx.signing.v1beta1.SignatureDescriptors".into()
17 }
18}
19/// SignatureDescriptor is a convenience type which represents the full data for
20/// a signature including the public key of the signer, signing modes and the
21/// signature itself. It is primarily used for coordinating signatures between
22/// clients.
23#[derive(Clone, PartialEq, ::prost::Message)]
24pub struct SignatureDescriptor {
25 /// public_key is the public key of the signer
26 #[prost(message, optional, tag = "1")]
27 pub public_key: ::core::option::Option<::pbjson_types::Any>,
28 #[prost(message, optional, tag = "2")]
29 pub data: ::core::option::Option<signature_descriptor::Data>,
30 /// sequence is the sequence of the account, which describes the
31 /// number of committed transactions signed by a given address. It is used to prevent
32 /// replay attacks.
33 #[prost(uint64, tag = "3")]
34 pub sequence: u64,
35}
36/// Nested message and enum types in `SignatureDescriptor`.
37pub mod signature_descriptor {
38 /// Data represents signature data
39 #[derive(Clone, PartialEq, ::prost::Message)]
40 pub struct Data {
41 /// sum is the oneof that specifies whether this represents single or multi-signature data
42 #[prost(oneof = "data::Sum", tags = "1, 2")]
43 pub sum: ::core::option::Option<data::Sum>,
44 }
45 /// Nested message and enum types in `Data`.
46 pub mod data {
47 /// Single is the signature data for a single signer
48 #[derive(Clone, PartialEq, ::prost::Message)]
49 pub struct Single {
50 /// mode is the signing mode of the single signer
51 #[prost(enumeration = "super::super::SignMode", tag = "1")]
52 pub mode: i32,
53 /// signature is the raw signature bytes
54 #[prost(bytes = "vec", tag = "2")]
55 pub signature: ::prost::alloc::vec::Vec<u8>,
56 }
57 impl ::prost::Name for Single {
58 const NAME: &'static str = "Single";
59 const PACKAGE: &'static str = "cosmos.tx.signing.v1beta1";
60 fn full_name() -> ::prost::alloc::string::String {
61 "cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single".into()
62 }
63 fn type_url() -> ::prost::alloc::string::String {
64 "/cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single".into()
65 }
66 }
67 /// Multi is the signature data for a multisig public key
68 #[derive(Clone, PartialEq, ::prost::Message)]
69 pub struct Multi {
70 /// bitarray specifies which keys within the multisig are signing
71 #[prost(message, optional, tag = "1")]
72 pub bitarray: ::core::option::Option<
73 super::super::super::super::super::crypto::multisig::v1beta1::CompactBitArray,
74 >,
75 /// signatures is the signatures of the multi-signature
76 #[prost(message, repeated, tag = "2")]
77 pub signatures: ::prost::alloc::vec::Vec<super::Data>,
78 }
79 impl ::prost::Name for Multi {
80 const NAME: &'static str = "Multi";
81 const PACKAGE: &'static str = "cosmos.tx.signing.v1beta1";
82 fn full_name() -> ::prost::alloc::string::String {
83 "cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi".into()
84 }
85 fn type_url() -> ::prost::alloc::string::String {
86 "/cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi".into()
87 }
88 }
89 /// sum is the oneof that specifies whether this represents single or multi-signature data
90 #[derive(Clone, PartialEq, ::prost::Oneof)]
91 pub enum Sum {
92 /// single represents a single signer
93 #[prost(message, tag = "1")]
94 Single(Single),
95 /// multi represents a multisig signer
96 #[prost(message, tag = "2")]
97 Multi(Multi),
98 }
99 }
100 impl ::prost::Name for Data {
101 const NAME: &'static str = "Data";
102 const PACKAGE: &'static str = "cosmos.tx.signing.v1beta1";
103 fn full_name() -> ::prost::alloc::string::String {
104 "cosmos.tx.signing.v1beta1.SignatureDescriptor.Data".into()
105 }
106 fn type_url() -> ::prost::alloc::string::String {
107 "/cosmos.tx.signing.v1beta1.SignatureDescriptor.Data".into()
108 }
109 }
110}
111impl ::prost::Name for SignatureDescriptor {
112 const NAME: &'static str = "SignatureDescriptor";
113 const PACKAGE: &'static str = "cosmos.tx.signing.v1beta1";
114 fn full_name() -> ::prost::alloc::string::String {
115 "cosmos.tx.signing.v1beta1.SignatureDescriptor".into()
116 }
117 fn type_url() -> ::prost::alloc::string::String {
118 "/cosmos.tx.signing.v1beta1.SignatureDescriptor".into()
119 }
120}
121/// SignMode represents a signing mode with its own security guarantees.
122///
123/// This enum should be considered a registry of all known sign modes
124/// in the Cosmos ecosystem. Apps are not expected to support all known
125/// sign modes. Apps that would like to support custom sign modes are
126/// encouraged to open a small PR against this file to add a new case
127/// to this SignMode enum describing their sign mode so that different
128/// apps have a consistent version of this enum.
129#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
130#[repr(i32)]
131pub enum SignMode {
132 /// SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be
133 /// rejected.
134 Unspecified = 0,
135 /// SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is
136 /// verified with raw bytes from Tx.
137 Direct = 1,
138 /// SIGN_MODE_TEXTUAL is a future signing mode that will verify some
139 /// human-readable textual representation on top of the binary representation
140 /// from SIGN_MODE_DIRECT. It is currently experimental, and should be used
141 /// for testing purposes only, until Textual is fully released. Please follow
142 /// the tracking issue <https://github.com/cosmos/cosmos-sdk/issues/11970.>
143 Textual = 2,
144 /// SIGN_MODE_DIRECT_AUX specifies a signing mode which uses
145 /// SignDocDirectAux. As opposed to SIGN_MODE_DIRECT, this sign mode does not
146 /// require signers signing over other signers' `signer_info`. It also allows
147 /// for adding Tips in transactions.
148 ///
149 /// Since: cosmos-sdk 0.46
150 DirectAux = 3,
151 /// SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses
152 /// Amino JSON and will be removed in the future.
153 LegacyAminoJson = 127,
154 /// SIGN_MODE_EIP_191 specifies the sign mode for EIP 191 signing on the Cosmos
155 /// SDK. Ref: <https://eips.ethereum.org/EIPS/eip-191>
156 ///
157 /// Currently, SIGN_MODE_EIP_191 is registered as a SignMode enum variant,
158 /// but is not implemented on the SDK by default. To enable EIP-191, you need
159 /// to pass a custom `TxConfig` that has an implementation of
160 /// `SignModeHandler` for EIP-191. The SDK may decide to fully support
161 /// EIP-191 in the future.
162 ///
163 /// Since: cosmos-sdk 0.45.2
164 Eip191 = 191,
165}
166impl SignMode {
167 /// String value of the enum field names used in the ProtoBuf definition.
168 ///
169 /// The values are not transformed in any way and thus are considered stable
170 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
171 pub fn as_str_name(&self) -> &'static str {
172 match self {
173 Self::Unspecified => "SIGN_MODE_UNSPECIFIED",
174 Self::Direct => "SIGN_MODE_DIRECT",
175 Self::Textual => "SIGN_MODE_TEXTUAL",
176 Self::DirectAux => "SIGN_MODE_DIRECT_AUX",
177 Self::LegacyAminoJson => "SIGN_MODE_LEGACY_AMINO_JSON",
178 Self::Eip191 => "SIGN_MODE_EIP_191",
179 }
180 }
181 /// Creates an enum from field names used in the ProtoBuf definition.
182 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
183 match value {
184 "SIGN_MODE_UNSPECIFIED" => Some(Self::Unspecified),
185 "SIGN_MODE_DIRECT" => Some(Self::Direct),
186 "SIGN_MODE_TEXTUAL" => Some(Self::Textual),
187 "SIGN_MODE_DIRECT_AUX" => Some(Self::DirectAux),
188 "SIGN_MODE_LEGACY_AMINO_JSON" => Some(Self::LegacyAminoJson),
189 "SIGN_MODE_EIP_191" => Some(Self::Eip191),
190 _ => None,
191 }
192 }
193}