terra_proto_build/models/
cosmos.tx.signing.v1beta1.rs

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