#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExistenceProof {
#[prost(bytes = "vec", tag = "1")]
pub key: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes = "vec", tag = "2")]
pub value: ::prost::alloc::vec::Vec<u8>,
#[prost(message, optional, tag = "3")]
pub leaf: ::core::option::Option<LeafOp>,
#[prost(message, repeated, tag = "4")]
pub path: ::prost::alloc::vec::Vec<InnerOp>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NonExistenceProof {
#[prost(bytes = "vec", tag = "1")]
pub key: ::prost::alloc::vec::Vec<u8>,
#[prost(message, optional, tag = "2")]
pub left: ::core::option::Option<ExistenceProof>,
#[prost(message, optional, tag = "3")]
pub right: ::core::option::Option<ExistenceProof>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CommitmentProof {
#[prost(oneof = "commitment_proof::Proof", tags = "1, 2, 3, 4")]
pub proof: ::core::option::Option<commitment_proof::Proof>,
}
pub mod commitment_proof {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Proof {
#[prost(message, tag = "1")]
Exist(super::ExistenceProof),
#[prost(message, tag = "2")]
Nonexist(super::NonExistenceProof),
#[prost(message, tag = "3")]
Batch(super::BatchProof),
#[prost(message, tag = "4")]
Compressed(super::CompressedBatchProof),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LeafOp {
#[prost(enumeration = "HashOp", tag = "1")]
pub hash: i32,
#[prost(enumeration = "HashOp", tag = "2")]
pub prehash_key: i32,
#[prost(enumeration = "HashOp", tag = "3")]
pub prehash_value: i32,
#[prost(enumeration = "LengthOp", tag = "4")]
pub length: i32,
#[prost(bytes = "vec", tag = "5")]
pub prefix: ::prost::alloc::vec::Vec<u8>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InnerOp {
#[prost(enumeration = "HashOp", tag = "1")]
pub hash: i32,
#[prost(bytes = "vec", tag = "2")]
pub prefix: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes = "vec", tag = "3")]
pub suffix: ::prost::alloc::vec::Vec<u8>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProofSpec {
#[prost(message, optional, tag = "1")]
pub leaf_spec: ::core::option::Option<LeafOp>,
#[prost(message, optional, tag = "2")]
pub inner_spec: ::core::option::Option<InnerSpec>,
#[prost(int32, tag = "3")]
pub max_depth: i32,
#[prost(int32, tag = "4")]
pub min_depth: i32,
#[prost(bool, tag = "5")]
pub prehash_key_before_comparison: bool,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InnerSpec {
#[prost(int32, repeated, tag = "1")]
pub child_order: ::prost::alloc::vec::Vec<i32>,
#[prost(int32, tag = "2")]
pub child_size: i32,
#[prost(int32, tag = "3")]
pub min_prefix_length: i32,
#[prost(int32, tag = "4")]
pub max_prefix_length: i32,
#[prost(bytes = "vec", tag = "5")]
pub empty_child: ::prost::alloc::vec::Vec<u8>,
#[prost(enumeration = "HashOp", tag = "6")]
pub hash: i32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchProof {
#[prost(message, repeated, tag = "1")]
pub entries: ::prost::alloc::vec::Vec<BatchEntry>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchEntry {
#[prost(oneof = "batch_entry::Proof", tags = "1, 2")]
pub proof: ::core::option::Option<batch_entry::Proof>,
}
pub mod batch_entry {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Proof {
#[prost(message, tag = "1")]
Exist(super::ExistenceProof),
#[prost(message, tag = "2")]
Nonexist(super::NonExistenceProof),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CompressedBatchProof {
#[prost(message, repeated, tag = "1")]
pub entries: ::prost::alloc::vec::Vec<CompressedBatchEntry>,
#[prost(message, repeated, tag = "2")]
pub lookup_inners: ::prost::alloc::vec::Vec<InnerOp>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CompressedBatchEntry {
#[prost(oneof = "compressed_batch_entry::Proof", tags = "1, 2")]
pub proof: ::core::option::Option<compressed_batch_entry::Proof>,
}
pub mod compressed_batch_entry {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Proof {
#[prost(message, tag = "1")]
Exist(super::CompressedExistenceProof),
#[prost(message, tag = "2")]
Nonexist(super::CompressedNonExistenceProof),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CompressedExistenceProof {
#[prost(bytes = "vec", tag = "1")]
pub key: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes = "vec", tag = "2")]
pub value: ::prost::alloc::vec::Vec<u8>,
#[prost(message, optional, tag = "3")]
pub leaf: ::core::option::Option<LeafOp>,
#[prost(int32, repeated, tag = "4")]
pub path: ::prost::alloc::vec::Vec<i32>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CompressedNonExistenceProof {
#[prost(bytes = "vec", tag = "1")]
pub key: ::prost::alloc::vec::Vec<u8>,
#[prost(message, optional, tag = "2")]
pub left: ::core::option::Option<CompressedExistenceProof>,
#[prost(message, optional, tag = "3")]
pub right: ::core::option::Option<CompressedExistenceProof>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum HashOp {
NoHash = 0,
Sha256 = 1,
Sha512 = 2,
Keccak256 = 3,
Ripemd160 = 4,
Bitcoin = 5,
Sha512256 = 6,
Blake2b512 = 7,
Blake2s256 = 8,
Blake3 = 9,
}
impl HashOp {
pub fn as_str_name(&self) -> &'static str {
match self {
HashOp::NoHash => "NO_HASH",
HashOp::Sha256 => "SHA256",
HashOp::Sha512 => "SHA512",
HashOp::Keccak256 => "KECCAK256",
HashOp::Ripemd160 => "RIPEMD160",
HashOp::Bitcoin => "BITCOIN",
HashOp::Sha512256 => "SHA512_256",
HashOp::Blake2b512 => "BLAKE2B_512",
HashOp::Blake2s256 => "BLAKE2S_256",
HashOp::Blake3 => "BLAKE3",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"NO_HASH" => Some(Self::NoHash),
"SHA256" => Some(Self::Sha256),
"SHA512" => Some(Self::Sha512),
"KECCAK256" => Some(Self::Keccak256),
"RIPEMD160" => Some(Self::Ripemd160),
"BITCOIN" => Some(Self::Bitcoin),
"SHA512_256" => Some(Self::Sha512256),
"BLAKE2B_512" => Some(Self::Blake2b512),
"BLAKE2S_256" => Some(Self::Blake2s256),
"BLAKE3" => Some(Self::Blake3),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum LengthOp {
NoPrefix = 0,
VarProto = 1,
VarRlp = 2,
Fixed32Big = 3,
Fixed32Little = 4,
Fixed64Big = 5,
Fixed64Little = 6,
Require32Bytes = 7,
Require64Bytes = 8,
}
impl LengthOp {
pub fn as_str_name(&self) -> &'static str {
match self {
LengthOp::NoPrefix => "NO_PREFIX",
LengthOp::VarProto => "VAR_PROTO",
LengthOp::VarRlp => "VAR_RLP",
LengthOp::Fixed32Big => "FIXED32_BIG",
LengthOp::Fixed32Little => "FIXED32_LITTLE",
LengthOp::Fixed64Big => "FIXED64_BIG",
LengthOp::Fixed64Little => "FIXED64_LITTLE",
LengthOp::Require32Bytes => "REQUIRE_32_BYTES",
LengthOp::Require64Bytes => "REQUIRE_64_BYTES",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"NO_PREFIX" => Some(Self::NoPrefix),
"VAR_PROTO" => Some(Self::VarProto),
"VAR_RLP" => Some(Self::VarRlp),
"FIXED32_BIG" => Some(Self::Fixed32Big),
"FIXED32_LITTLE" => Some(Self::Fixed32Little),
"FIXED64_BIG" => Some(Self::Fixed64Big),
"FIXED64_LITTLE" => Some(Self::Fixed64Little),
"REQUIRE_32_BYTES" => Some(Self::Require32Bytes),
"REQUIRE_64_BYTES" => Some(Self::Require64Bytes),
_ => None,
}
}
}