Skip to content

Commit 369b296

Browse files
committed
update proto
1 parent fbc4272 commit 369b296

15 files changed

Lines changed: 5531 additions & 304 deletions

proto-build/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use walkdir::WalkDir;
2020
static QUIET: AtomicBool = AtomicBool::new(false);
2121

2222
/// The Cosmos SDK commit or tag to be cloned and used to build the proto files
23-
const COSMOS_SDK_REV: &str = "lending";
23+
const COSMOS_SDK_REV: &str = "release/v2.0.x";
2424

2525
// All paths must end with a / and either be absolute or include a ./ to reference the current
2626
// working directory.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
lending
1+
release/v2.0.x
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// @generated
2+
/// PubKey defines a secp256k1 public key for SegWit.
3+
/// Key is the compressed form of the pubkey. The first byte depends is a 0x02 byte
4+
/// if the y-coordinate is the lexicographically largest of the two associated with
5+
/// the x-coordinate. Otherwise the first byte is a 0x03.
6+
/// This prefix is followed with the x-coordinate.
7+
#[allow(clippy::derive_partial_eq_without_eq)]
8+
#[derive(Clone, PartialEq, ::prost::Message)]
9+
pub struct PubKey {
10+
#[prost(bytes = "vec", tag = "1")]
11+
pub key: ::prost::alloc::vec::Vec<u8>,
12+
}
13+
impl ::prost::Name for PubKey {
14+
const NAME: &'static str = "PubKey";
15+
const PACKAGE: &'static str = "cosmos.crypto.segwit";
16+
fn full_name() -> ::prost::alloc::string::String {
17+
::prost::alloc::format!("cosmos.crypto.segwit.{}", Self::NAME)
18+
}
19+
}
20+
/// PrivKey defines a SegWit private key.
21+
#[allow(clippy::derive_partial_eq_without_eq)]
22+
#[derive(Clone, PartialEq, ::prost::Message)]
23+
pub struct PrivKey {
24+
#[prost(bytes = "vec", tag = "1")]
25+
pub key: ::prost::alloc::vec::Vec<u8>,
26+
}
27+
impl ::prost::Name for PrivKey {
28+
const NAME: &'static str = "PrivKey";
29+
const PACKAGE: &'static str = "cosmos.crypto.segwit";
30+
fn full_name() -> ::prost::alloc::string::String {
31+
::prost::alloc::format!("cosmos.crypto.segwit.{}", Self::NAME)
32+
}
33+
}
34+
include!("cosmos.crypto.segwit.serde.rs");
35+
// @@protoc_insertion_point(module)
Lines changed: 201 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
// @generated
2+
#[cfg(feature = "serde")]
3+
impl serde::Serialize for PrivKey {
4+
#[allow(deprecated)]
5+
fn serialize<S>(&self, serializer: S) -> core::result::Result<S::Ok, S::Error>
6+
where
7+
S: serde::Serializer,
8+
{
9+
use serde::ser::SerializeStruct;
10+
let mut len = 0;
11+
if !self.key.is_empty() {
12+
len += 1;
13+
}
14+
let mut struct_ser = serializer.serialize_struct("cosmos.crypto.segwit.PrivKey", len)?;
15+
if !self.key.is_empty() {
16+
#[allow(clippy::needless_borrow)]
17+
struct_ser
18+
.serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?;
19+
}
20+
struct_ser.end()
21+
}
22+
}
23+
#[cfg(feature = "serde")]
24+
impl<'de> serde::Deserialize<'de> for PrivKey {
25+
#[allow(deprecated)]
26+
fn deserialize<D>(deserializer: D) -> core::result::Result<Self, D::Error>
27+
where
28+
D: serde::Deserializer<'de>,
29+
{
30+
const FIELDS: &[&str] = &["key"];
31+
32+
#[allow(clippy::enum_variant_names)]
33+
enum GeneratedField {
34+
Key,
35+
}
36+
#[cfg(feature = "serde")]
37+
impl<'de> serde::Deserialize<'de> for GeneratedField {
38+
fn deserialize<D>(deserializer: D) -> core::result::Result<GeneratedField, D::Error>
39+
where
40+
D: serde::Deserializer<'de>,
41+
{
42+
struct GeneratedVisitor;
43+
44+
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
45+
type Value = GeneratedField;
46+
47+
fn expecting(
48+
&self,
49+
formatter: &mut core::fmt::Formatter<'_>,
50+
) -> core::fmt::Result {
51+
write!(formatter, "expected one of: {:?}", &FIELDS)
52+
}
53+
54+
#[allow(unused_variables)]
55+
fn visit_str<E>(self, value: &str) -> core::result::Result<GeneratedField, E>
56+
where
57+
E: serde::de::Error,
58+
{
59+
match value {
60+
"key" => Ok(GeneratedField::Key),
61+
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
62+
}
63+
}
64+
}
65+
deserializer.deserialize_identifier(GeneratedVisitor)
66+
}
67+
}
68+
struct GeneratedVisitor;
69+
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
70+
type Value = PrivKey;
71+
72+
fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
73+
formatter.write_str("struct cosmos.crypto.segwit.PrivKey")
74+
}
75+
76+
fn visit_map<V>(self, mut map_: V) -> core::result::Result<PrivKey, V::Error>
77+
where
78+
V: serde::de::MapAccess<'de>,
79+
{
80+
let mut key__ = None;
81+
while let Some(k) = map_.next_key()? {
82+
match k {
83+
GeneratedField::Key => {
84+
if key__.is_some() {
85+
return Err(serde::de::Error::duplicate_field("key"));
86+
}
87+
key__ = Some(
88+
map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?
89+
.0,
90+
);
91+
}
92+
}
93+
}
94+
Ok(PrivKey {
95+
key: key__.unwrap_or_default(),
96+
})
97+
}
98+
}
99+
deserializer.deserialize_struct("cosmos.crypto.segwit.PrivKey", FIELDS, GeneratedVisitor)
100+
}
101+
}
102+
#[cfg(feature = "serde")]
103+
impl serde::Serialize for PubKey {
104+
#[allow(deprecated)]
105+
fn serialize<S>(&self, serializer: S) -> core::result::Result<S::Ok, S::Error>
106+
where
107+
S: serde::Serializer,
108+
{
109+
use serde::ser::SerializeStruct;
110+
let mut len = 0;
111+
if !self.key.is_empty() {
112+
len += 1;
113+
}
114+
let mut struct_ser = serializer.serialize_struct("cosmos.crypto.segwit.PubKey", len)?;
115+
if !self.key.is_empty() {
116+
#[allow(clippy::needless_borrow)]
117+
struct_ser
118+
.serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?;
119+
}
120+
struct_ser.end()
121+
}
122+
}
123+
#[cfg(feature = "serde")]
124+
impl<'de> serde::Deserialize<'de> for PubKey {
125+
#[allow(deprecated)]
126+
fn deserialize<D>(deserializer: D) -> core::result::Result<Self, D::Error>
127+
where
128+
D: serde::Deserializer<'de>,
129+
{
130+
const FIELDS: &[&str] = &["key"];
131+
132+
#[allow(clippy::enum_variant_names)]
133+
enum GeneratedField {
134+
Key,
135+
}
136+
#[cfg(feature = "serde")]
137+
impl<'de> serde::Deserialize<'de> for GeneratedField {
138+
fn deserialize<D>(deserializer: D) -> core::result::Result<GeneratedField, D::Error>
139+
where
140+
D: serde::Deserializer<'de>,
141+
{
142+
struct GeneratedVisitor;
143+
144+
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
145+
type Value = GeneratedField;
146+
147+
fn expecting(
148+
&self,
149+
formatter: &mut core::fmt::Formatter<'_>,
150+
) -> core::fmt::Result {
151+
write!(formatter, "expected one of: {:?}", &FIELDS)
152+
}
153+
154+
#[allow(unused_variables)]
155+
fn visit_str<E>(self, value: &str) -> core::result::Result<GeneratedField, E>
156+
where
157+
E: serde::de::Error,
158+
{
159+
match value {
160+
"key" => Ok(GeneratedField::Key),
161+
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
162+
}
163+
}
164+
}
165+
deserializer.deserialize_identifier(GeneratedVisitor)
166+
}
167+
}
168+
struct GeneratedVisitor;
169+
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
170+
type Value = PubKey;
171+
172+
fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
173+
formatter.write_str("struct cosmos.crypto.segwit.PubKey")
174+
}
175+
176+
fn visit_map<V>(self, mut map_: V) -> core::result::Result<PubKey, V::Error>
177+
where
178+
V: serde::de::MapAccess<'de>,
179+
{
180+
let mut key__ = None;
181+
while let Some(k) = map_.next_key()? {
182+
match k {
183+
GeneratedField::Key => {
184+
if key__.is_some() {
185+
return Err(serde::de::Error::duplicate_field("key"));
186+
}
187+
key__ = Some(
188+
map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?
189+
.0,
190+
);
191+
}
192+
}
193+
}
194+
Ok(PubKey {
195+
key: key__.unwrap_or_default(),
196+
})
197+
}
198+
}
199+
deserializer.deserialize_struct("cosmos.crypto.segwit.PubKey", FIELDS, GeneratedVisitor)
200+
}
201+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// @generated
2+
/// PubKey defines a secp256k1 public key for Taproot.
3+
/// Key is the compressed form of the pubkey. The first byte depends is a 0x02 byte
4+
/// if the y-coordinate is the lexicographically largest of the two associated with
5+
/// the x-coordinate. Otherwise the first byte is a 0x03.
6+
/// This prefix is followed with the x-coordinate.
7+
#[allow(clippy::derive_partial_eq_without_eq)]
8+
#[derive(Clone, PartialEq, ::prost::Message)]
9+
pub struct PubKey {
10+
#[prost(bytes = "vec", tag = "1")]
11+
pub key: ::prost::alloc::vec::Vec<u8>,
12+
}
13+
impl ::prost::Name for PubKey {
14+
const NAME: &'static str = "PubKey";
15+
const PACKAGE: &'static str = "cosmos.crypto.taproot";
16+
fn full_name() -> ::prost::alloc::string::String {
17+
::prost::alloc::format!("cosmos.crypto.taproot.{}", Self::NAME)
18+
}
19+
}
20+
/// PrivKey defines a SegWit private key.
21+
#[allow(clippy::derive_partial_eq_without_eq)]
22+
#[derive(Clone, PartialEq, ::prost::Message)]
23+
pub struct PrivKey {
24+
#[prost(bytes = "vec", tag = "1")]
25+
pub key: ::prost::alloc::vec::Vec<u8>,
26+
}
27+
impl ::prost::Name for PrivKey {
28+
const NAME: &'static str = "PrivKey";
29+
const PACKAGE: &'static str = "cosmos.crypto.taproot";
30+
fn full_name() -> ::prost::alloc::string::String {
31+
::prost::alloc::format!("cosmos.crypto.taproot.{}", Self::NAME)
32+
}
33+
}
34+
include!("cosmos.crypto.taproot.serde.rs");
35+
// @@protoc_insertion_point(module)

0 commit comments

Comments
 (0)