-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Protobuf definitions from
cosmos.crypto.*
(#149)
* add crypto proto * Add changelog entry --------- Co-authored-by: Davirain <davirain.yin@gmail.com>
- Loading branch information
1 parent
cd8d423
commit 049639a
Showing
10 changed files
with
172 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
- Add Protobuf definitions from `cosmos.crypto.*` | ||
([\#149](https://github.com/cosmos/ibc-proto-rs/pull/149)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/// PubKey is an ed25519 public key for handling Tendermint keys in SDK. | ||
/// It's needed for Any serialization and SDK compatibility. | ||
/// It must not be used in a non Tendermint key context because it doesn't implement | ||
/// ADR-28. Nevertheless, you will like to use ed25519 in app user level | ||
/// then you must create a new proto message and follow ADR-28 for Address construction. | ||
#[allow(clippy::derive_partial_eq_without_eq)] | ||
#[derive(Clone, PartialEq, ::prost::Message)] | ||
pub struct PubKey { | ||
#[prost(bytes = "vec", tag = "1")] | ||
pub key: ::prost::alloc::vec::Vec<u8>, | ||
} | ||
/// Deprecated: PrivKey defines a ed25519 private key. | ||
/// NOTE: ed25519 keys must not be used in SDK apps except in a tendermint validator context. | ||
#[allow(clippy::derive_partial_eq_without_eq)] | ||
#[derive(Clone, PartialEq, ::prost::Message)] | ||
pub struct PrivKey { | ||
#[prost(bytes = "vec", tag = "1")] | ||
pub key: ::prost::alloc::vec::Vec<u8>, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/// BIP44Params is used as path field in ledger item in Record. | ||
#[allow(clippy::derive_partial_eq_without_eq)] | ||
#[derive(Clone, PartialEq, ::prost::Message)] | ||
pub struct Bip44Params { | ||
/// purpose is a constant set to 44' (or 0x8000002C) following the BIP43 recommendation | ||
#[prost(uint32, tag = "1")] | ||
pub purpose: u32, | ||
/// coin_type is a constant that improves privacy | ||
#[prost(uint32, tag = "2")] | ||
pub coin_type: u32, | ||
/// account splits the key space into independent user identities | ||
#[prost(uint32, tag = "3")] | ||
pub account: u32, | ||
/// change is a constant used for public derivation. Constant 0 is used for external chain and constant 1 for internal | ||
/// chain. | ||
#[prost(bool, tag = "4")] | ||
pub change: bool, | ||
/// address_index is used as child index in BIP32 derivation | ||
#[prost(uint32, tag = "5")] | ||
pub address_index: u32, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/// Record is used for representing a key in the keyring. | ||
#[allow(clippy::derive_partial_eq_without_eq)] | ||
#[derive(Clone, PartialEq, ::prost::Message)] | ||
pub struct Record { | ||
/// name represents a name of Record | ||
#[prost(string, tag = "1")] | ||
pub name: ::prost::alloc::string::String, | ||
/// pub_key represents a public key in any format | ||
#[prost(message, optional, tag = "2")] | ||
pub pub_key: ::core::option::Option< | ||
super::super::super::super::google::protobuf::Any, | ||
>, | ||
/// Record contains one of the following items | ||
#[prost(oneof = "record::Item", tags = "3, 4, 5, 6")] | ||
pub item: ::core::option::Option<record::Item>, | ||
} | ||
/// Nested message and enum types in `Record`. | ||
pub mod record { | ||
/// Item is a keyring item stored in a keyring backend. | ||
/// Local item | ||
#[allow(clippy::derive_partial_eq_without_eq)] | ||
#[derive(Clone, PartialEq, ::prost::Message)] | ||
pub struct Local { | ||
#[prost(message, optional, tag = "1")] | ||
pub priv_key: ::core::option::Option< | ||
super::super::super::super::super::google::protobuf::Any, | ||
>, | ||
} | ||
/// Ledger item | ||
#[allow(clippy::derive_partial_eq_without_eq)] | ||
#[derive(Clone, PartialEq, ::prost::Message)] | ||
pub struct Ledger { | ||
#[prost(message, optional, tag = "1")] | ||
pub path: ::core::option::Option<super::super::super::hd::v1::Bip44Params>, | ||
} | ||
/// Multi item | ||
#[allow(clippy::derive_partial_eq_without_eq)] | ||
#[derive(Clone, PartialEq, ::prost::Message)] | ||
pub struct Multi {} | ||
/// Offline item | ||
#[allow(clippy::derive_partial_eq_without_eq)] | ||
#[derive(Clone, PartialEq, ::prost::Message)] | ||
pub struct Offline {} | ||
/// Record contains one of the following items | ||
#[allow(clippy::derive_partial_eq_without_eq)] | ||
#[derive(Clone, PartialEq, ::prost::Oneof)] | ||
pub enum Item { | ||
/// local stores the private key locally. | ||
#[prost(message, tag = "3")] | ||
Local(Local), | ||
/// ledger stores the information about a Ledger key. | ||
#[prost(message, tag = "4")] | ||
Ledger(Ledger), | ||
/// Multi does not store any other information. | ||
#[prost(message, tag = "5")] | ||
Multi(Multi), | ||
/// Offline does not store any other information. | ||
#[prost(message, tag = "6")] | ||
Offline(Offline), | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/// LegacyAminoPubKey specifies a public key type | ||
/// which nests multiple public keys and a threshold, | ||
/// it uses legacy amino address rules. | ||
#[allow(clippy::derive_partial_eq_without_eq)] | ||
#[derive(Clone, PartialEq, ::prost::Message)] | ||
pub struct LegacyAminoPubKey { | ||
#[prost(uint32, tag = "1")] | ||
pub threshold: u32, | ||
#[prost(message, repeated, tag = "2")] | ||
pub public_keys: ::prost::alloc::vec::Vec< | ||
super::super::super::google::protobuf::Any, | ||
>, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/// PubKey defines a secp256k1 public key | ||
/// Key is the compressed form of the pubkey. The first byte depends is a 0x02 byte | ||
/// if the y-coordinate is the lexicographically largest of the two associated with | ||
/// the x-coordinate. Otherwise the first byte is a 0x03. | ||
/// This prefix is followed with the x-coordinate. | ||
#[allow(clippy::derive_partial_eq_without_eq)] | ||
#[derive(Clone, PartialEq, ::prost::Message)] | ||
pub struct PubKey { | ||
#[prost(bytes = "vec", tag = "1")] | ||
pub key: ::prost::alloc::vec::Vec<u8>, | ||
} | ||
/// PrivKey defines a secp256k1 private key. | ||
#[allow(clippy::derive_partial_eq_without_eq)] | ||
#[derive(Clone, PartialEq, ::prost::Message)] | ||
pub struct PrivKey { | ||
#[prost(bytes = "vec", tag = "1")] | ||
pub key: ::prost::alloc::vec::Vec<u8>, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/// PubKey defines a secp256r1 ECDSA public key. | ||
#[allow(clippy::derive_partial_eq_without_eq)] | ||
#[derive(Clone, PartialEq, ::prost::Message)] | ||
pub struct PubKey { | ||
/// Point on secp256r1 curve in a compressed representation as specified in section | ||
/// 4.3.6 of ANSI X9.62: <https://webstore.ansi.org/standards/ascx9/ansix9621998> | ||
#[prost(bytes = "vec", tag = "1")] | ||
pub key: ::prost::alloc::vec::Vec<u8>, | ||
} | ||
/// PrivKey defines a secp256r1 ECDSA private key. | ||
#[allow(clippy::derive_partial_eq_without_eq)] | ||
#[derive(Clone, PartialEq, ::prost::Message)] | ||
pub struct PrivKey { | ||
/// secret number serialized using big-endian encoding | ||
#[prost(bytes = "vec", tag = "1")] | ||
pub secret: ::prost::alloc::vec::Vec<u8>, | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters