Struct cosmos_sdk_proto::ics23::ProofSpec
source · pub struct ProofSpec {
pub leaf_spec: Option<LeafOp>,
pub inner_spec: Option<InnerSpec>,
pub max_depth: i32,
pub min_depth: i32,
}
Expand description
ProofSpec defines what the expected parameters are for a given proof type. This can be stored in the client and used to validate any incoming proofs.
verify(ProofSpec, Proof) -> Proof | Error
As demonstrated in tests, if we don’t fix the algorithm used to calculate the LeafHash for a given tree, there are many possible key-value pairs that can generate a given hash (by interpretting the preimage differently). We need this for proper security, requires client knows a priori what tree format server uses. But not in code, rather a configuration object.
Fields§
§leaf_spec: Option<LeafOp>
any field in the ExistenceProof must be the same as in this spec. except Prefix, which is just the first bytes of prefix (spec can be longer)
inner_spec: Option<InnerSpec>
§max_depth: i32
max_depth (if > 0) is the maximum number of InnerOps allowed (mainly for fixed-depth tries)
min_depth: i32
min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries)
Trait Implementations§
source§impl Message for ProofSpec
impl Message for ProofSpec
source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
source§fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn decode<B>(buf: B) -> Result<Self, DecodeError>
fn decode<B>(buf: B) -> Result<Self, DecodeError>
source§fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
source§fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
self
. Read moresource§fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
self
.source§impl Name for ProofSpec
impl Name for ProofSpec
source§const NAME: &'static str = "ProofSpec"
const NAME: &'static str = "ProofSpec"
Message
.
This name is the same as it appears in the source .proto file, e.g. FooBar
.source§const PACKAGE: &'static str = "ics23"
const PACKAGE: &'static str = "ics23"
.
, e.g. google.protobuf
.source§fn full_name() -> String
fn full_name() -> String
Message
.
It’s prefixed with the package name and names of any parent messages,
e.g. google.rpc.BadRequest.FieldViolation
.
By default, this is the package name followed by the message name.
Fully-qualified names must be unique within a domain of Type URLs.source§impl PartialEq for ProofSpec
impl PartialEq for ProofSpec
impl StructuralPartialEq for ProofSpec
Auto Trait Implementations§
impl Freeze for ProofSpec
impl RefUnwindSafe for ProofSpec
impl Send for ProofSpec
impl Sync for ProofSpec
impl Unpin for ProofSpec
impl UnwindSafe for ProofSpec
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request