1#[allow(clippy::derive_partial_eq_without_eq)]
22#[derive(Clone, PartialEq, ::prost::Message)]
23pub struct ExistenceProof {
24 #[prost(bytes = "vec", tag = "1")]
25 pub key: ::prost::alloc::vec::Vec<u8>,
26 #[prost(bytes = "vec", tag = "2")]
27 pub value: ::prost::alloc::vec::Vec<u8>,
28 #[prost(message, optional, tag = "3")]
29 pub leaf: ::core::option::Option<LeafOp>,
30 #[prost(message, repeated, tag = "4")]
31 pub path: ::prost::alloc::vec::Vec<InnerOp>,
32}
33#[allow(clippy::derive_partial_eq_without_eq)]
38#[derive(Clone, PartialEq, ::prost::Message)]
39pub struct NonExistenceProof {
40 #[prost(bytes = "vec", tag = "1")]
42 pub key: ::prost::alloc::vec::Vec<u8>,
43 #[prost(message, optional, tag = "2")]
44 pub left: ::core::option::Option<ExistenceProof>,
45 #[prost(message, optional, tag = "3")]
46 pub right: ::core::option::Option<ExistenceProof>,
47}
48#[allow(clippy::derive_partial_eq_without_eq)]
51#[derive(Clone, PartialEq, ::prost::Message)]
52pub struct CommitmentProof {
53 #[prost(oneof = "commitment_proof::Proof", tags = "1, 2, 3, 4")]
54 pub proof: ::core::option::Option<commitment_proof::Proof>,
55}
56pub mod commitment_proof {
58 #[allow(clippy::derive_partial_eq_without_eq)]
59 #[derive(Clone, PartialEq, ::prost::Oneof)]
60 pub enum Proof {
61 #[prost(message, tag = "1")]
62 Exist(super::ExistenceProof),
63 #[prost(message, tag = "2")]
64 Nonexist(super::NonExistenceProof),
65 #[prost(message, tag = "3")]
66 Batch(super::BatchProof),
67 #[prost(message, tag = "4")]
68 Compressed(super::CompressedBatchProof),
69 }
70}
71#[allow(clippy::derive_partial_eq_without_eq)]
87#[derive(Clone, PartialEq, ::prost::Message)]
88pub struct LeafOp {
89 #[prost(enumeration = "HashOp", tag = "1")]
90 pub hash: i32,
91 #[prost(enumeration = "HashOp", tag = "2")]
92 pub prehash_key: i32,
93 #[prost(enumeration = "HashOp", tag = "3")]
94 pub prehash_value: i32,
95 #[prost(enumeration = "LengthOp", tag = "4")]
96 pub length: i32,
97 #[prost(bytes = "vec", tag = "5")]
100 pub prefix: ::prost::alloc::vec::Vec<u8>,
101}
102#[allow(clippy::derive_partial_eq_without_eq)]
119#[derive(Clone, PartialEq, ::prost::Message)]
120pub struct InnerOp {
121 #[prost(enumeration = "HashOp", tag = "1")]
122 pub hash: i32,
123 #[prost(bytes = "vec", tag = "2")]
124 pub prefix: ::prost::alloc::vec::Vec<u8>,
125 #[prost(bytes = "vec", tag = "3")]
126 pub suffix: ::prost::alloc::vec::Vec<u8>,
127}
128#[allow(clippy::derive_partial_eq_without_eq)]
140#[derive(Clone, PartialEq, ::prost::Message)]
141pub struct ProofSpec {
142 #[prost(message, optional, tag = "1")]
145 pub leaf_spec: ::core::option::Option<LeafOp>,
146 #[prost(message, optional, tag = "2")]
147 pub inner_spec: ::core::option::Option<InnerSpec>,
148 #[prost(int32, tag = "3")]
150 pub max_depth: i32,
151 #[prost(int32, tag = "4")]
153 pub min_depth: i32,
154}
155#[allow(clippy::derive_partial_eq_without_eq)]
165#[derive(Clone, PartialEq, ::prost::Message)]
166pub struct InnerSpec {
167 #[prost(int32, repeated, tag = "1")]
171 pub child_order: ::prost::alloc::vec::Vec<i32>,
172 #[prost(int32, tag = "2")]
173 pub child_size: i32,
174 #[prost(int32, tag = "3")]
175 pub min_prefix_length: i32,
176 #[prost(int32, tag = "4")]
177 pub max_prefix_length: i32,
178 #[prost(bytes = "vec", tag = "5")]
180 pub empty_child: ::prost::alloc::vec::Vec<u8>,
181 #[prost(enumeration = "HashOp", tag = "6")]
183 pub hash: i32,
184}
185#[allow(clippy::derive_partial_eq_without_eq)]
188#[derive(Clone, PartialEq, ::prost::Message)]
189pub struct BatchProof {
190 #[prost(message, repeated, tag = "1")]
191 pub entries: ::prost::alloc::vec::Vec<BatchEntry>,
192}
193#[allow(clippy::derive_partial_eq_without_eq)]
195#[derive(Clone, PartialEq, ::prost::Message)]
196pub struct BatchEntry {
197 #[prost(oneof = "batch_entry::Proof", tags = "1, 2")]
198 pub proof: ::core::option::Option<batch_entry::Proof>,
199}
200pub mod batch_entry {
202 #[allow(clippy::derive_partial_eq_without_eq)]
203 #[derive(Clone, PartialEq, ::prost::Oneof)]
204 pub enum Proof {
205 #[prost(message, tag = "1")]
206 Exist(super::ExistenceProof),
207 #[prost(message, tag = "2")]
208 Nonexist(super::NonExistenceProof),
209 }
210}
211#[allow(clippy::derive_partial_eq_without_eq)]
212#[derive(Clone, PartialEq, ::prost::Message)]
213pub struct CompressedBatchProof {
214 #[prost(message, repeated, tag = "1")]
215 pub entries: ::prost::alloc::vec::Vec<CompressedBatchEntry>,
216 #[prost(message, repeated, tag = "2")]
217 pub lookup_inners: ::prost::alloc::vec::Vec<InnerOp>,
218}
219#[allow(clippy::derive_partial_eq_without_eq)]
221#[derive(Clone, PartialEq, ::prost::Message)]
222pub struct CompressedBatchEntry {
223 #[prost(oneof = "compressed_batch_entry::Proof", tags = "1, 2")]
224 pub proof: ::core::option::Option<compressed_batch_entry::Proof>,
225}
226pub mod compressed_batch_entry {
228 #[allow(clippy::derive_partial_eq_without_eq)]
229 #[derive(Clone, PartialEq, ::prost::Oneof)]
230 pub enum Proof {
231 #[prost(message, tag = "1")]
232 Exist(super::CompressedExistenceProof),
233 #[prost(message, tag = "2")]
234 Nonexist(super::CompressedNonExistenceProof),
235 }
236}
237#[allow(clippy::derive_partial_eq_without_eq)]
238#[derive(Clone, PartialEq, ::prost::Message)]
239pub struct CompressedExistenceProof {
240 #[prost(bytes = "vec", tag = "1")]
241 pub key: ::prost::alloc::vec::Vec<u8>,
242 #[prost(bytes = "vec", tag = "2")]
243 pub value: ::prost::alloc::vec::Vec<u8>,
244 #[prost(message, optional, tag = "3")]
245 pub leaf: ::core::option::Option<LeafOp>,
246 #[prost(int32, repeated, tag = "4")]
248 pub path: ::prost::alloc::vec::Vec<i32>,
249}
250#[allow(clippy::derive_partial_eq_without_eq)]
251#[derive(Clone, PartialEq, ::prost::Message)]
252pub struct CompressedNonExistenceProof {
253 #[prost(bytes = "vec", tag = "1")]
255 pub key: ::prost::alloc::vec::Vec<u8>,
256 #[prost(message, optional, tag = "2")]
257 pub left: ::core::option::Option<CompressedExistenceProof>,
258 #[prost(message, optional, tag = "3")]
259 pub right: ::core::option::Option<CompressedExistenceProof>,
260}
261#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
262#[repr(i32)]
263pub enum HashOp {
264 NoHash = 0,
266 Sha256 = 1,
267 Sha512 = 2,
268 Keccak = 3,
269 Ripemd160 = 4,
270 Bitcoin = 5,
272}
273impl HashOp {
274 pub fn as_str_name(&self) -> &'static str {
279 match self {
280 HashOp::NoHash => "NO_HASH",
281 HashOp::Sha256 => "SHA256",
282 HashOp::Sha512 => "SHA512",
283 HashOp::Keccak => "KECCAK",
284 HashOp::Ripemd160 => "RIPEMD160",
285 HashOp::Bitcoin => "BITCOIN",
286 }
287 }
288 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
290 match value {
291 "NO_HASH" => Some(Self::NoHash),
292 "SHA256" => Some(Self::Sha256),
293 "SHA512" => Some(Self::Sha512),
294 "KECCAK" => Some(Self::Keccak),
295 "RIPEMD160" => Some(Self::Ripemd160),
296 "BITCOIN" => Some(Self::Bitcoin),
297 _ => None,
298 }
299 }
300}
301#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
307#[repr(i32)]
308pub enum LengthOp {
309 NoPrefix = 0,
311 VarProto = 1,
313 VarRlp = 2,
315 Fixed32Big = 3,
317 Fixed32Little = 4,
319 Fixed64Big = 5,
321 Fixed64Little = 6,
323 Require32Bytes = 7,
325 Require64Bytes = 8,
327}
328impl LengthOp {
329 pub fn as_str_name(&self) -> &'static str {
334 match self {
335 LengthOp::NoPrefix => "NO_PREFIX",
336 LengthOp::VarProto => "VAR_PROTO",
337 LengthOp::VarRlp => "VAR_RLP",
338 LengthOp::Fixed32Big => "FIXED32_BIG",
339 LengthOp::Fixed32Little => "FIXED32_LITTLE",
340 LengthOp::Fixed64Big => "FIXED64_BIG",
341 LengthOp::Fixed64Little => "FIXED64_LITTLE",
342 LengthOp::Require32Bytes => "REQUIRE_32_BYTES",
343 LengthOp::Require64Bytes => "REQUIRE_64_BYTES",
344 }
345 }
346 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
348 match value {
349 "NO_PREFIX" => Some(Self::NoPrefix),
350 "VAR_PROTO" => Some(Self::VarProto),
351 "VAR_RLP" => Some(Self::VarRlp),
352 "FIXED32_BIG" => Some(Self::Fixed32Big),
353 "FIXED32_LITTLE" => Some(Self::Fixed32Little),
354 "FIXED64_BIG" => Some(Self::Fixed64Big),
355 "FIXED64_LITTLE" => Some(Self::Fixed64Little),
356 "REQUIRE_32_BYTES" => Some(Self::Require32Bytes),
357 "REQUIRE_64_BYTES" => Some(Self::Require64Bytes),
358 _ => None,
359 }
360 }
361}