Struct cosmos_sdk_proto::ics23::LeafOp
source · pub struct LeafOp {
pub hash: i32,
pub prehash_key: i32,
pub prehash_value: i32,
pub length: i32,
pub prefix: Vec<u8>,
}
Expand description
LeafOp represents the raw key-value data we wish to prove, and must be flexible to represent the internal transformation from the original key-value pairs into the basis hash, for many existing merkle trees.
key and value are passed in. So that the signature of this operation is: leafOp(key, value) -> output
To process this, first prehash the keys and values if needed (ANY means no hash in this case): hkey = prehashKey(key) hvalue = prehashValue(value)
Then combine the bytes, and hash it output = hash(prefix || length(hkey) || hkey || length(hvalue) || hvalue)
Fields§
§hash: i32
§prehash_key: i32
§prehash_value: i32
§length: i32
§prefix: Vec<u8>
prefix is a fixed bytes that may optionally be included at the beginning to differentiate a leaf node from an inner node.
Implementations§
source§impl LeafOp
impl LeafOp
sourcepub fn hash(&self) -> HashOp
pub fn hash(&self) -> HashOp
Returns the enum value of hash
, or the default if the field is set to an invalid enum value.
sourcepub fn prehash_key(&self) -> HashOp
pub fn prehash_key(&self) -> HashOp
Returns the enum value of prehash_key
, or the default if the field is set to an invalid enum value.
sourcepub fn set_prehash_key(&mut self, value: HashOp)
pub fn set_prehash_key(&mut self, value: HashOp)
Sets prehash_key
to the provided enum value.
sourcepub fn prehash_value(&self) -> HashOp
pub fn prehash_value(&self) -> HashOp
Returns the enum value of prehash_value
, or the default if the field is set to an invalid enum value.
sourcepub fn set_prehash_value(&mut self, value: HashOp)
pub fn set_prehash_value(&mut self, value: HashOp)
Sets prehash_value
to the provided enum value.
sourcepub fn length(&self) -> LengthOp
pub fn length(&self) -> LengthOp
Returns the enum value of length
, or the default if the field is set to an invalid enum value.
sourcepub fn set_length(&mut self, value: LengthOp)
pub fn set_length(&mut self, value: LengthOp)
Sets length
to the provided enum value.
Trait Implementations§
source§impl Message for LeafOp
impl Message for LeafOp
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 LeafOp
impl Name for LeafOp
source§const NAME: &'static str = "LeafOp"
const NAME: &'static str = "LeafOp"
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 LeafOp
impl PartialEq for LeafOp
impl StructuralPartialEq for LeafOp
Auto Trait Implementations§
impl Freeze for LeafOp
impl RefUnwindSafe for LeafOp
impl Send for LeafOp
impl Sync for LeafOp
impl Unpin for LeafOp
impl UnwindSafe for LeafOp
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