Struct grin_core::core::transaction::CommitWrapper
source · pub struct CommitWrapper { /* private fields */ }
Expand description
We need to wrap commitments so they can be sorted with hashable_ord.
Implementations§
source§impl CommitWrapper
impl CommitWrapper
sourcepub fn commitment(&self) -> Commitment
pub fn commitment(&self) -> Commitment
Wrapped commitment.
Trait Implementations§
source§impl AsRef<Commitment> for CommitWrapper
impl AsRef<Commitment> for CommitWrapper
source§fn as_ref(&self) -> &Commitment
fn as_ref(&self) -> &Commitment
Converts this type into a shared reference of the (usually inferred) input type.
source§impl Clone for CommitWrapper
impl Clone for CommitWrapper
source§fn clone(&self) -> CommitWrapper
fn clone(&self) -> CommitWrapper
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for CommitWrapper
impl Debug for CommitWrapper
source§impl<'de> Deserialize<'de> for CommitWrapper
impl<'de> Deserialize<'de> for CommitWrapper
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl From<&Input> for CommitWrapper
impl From<&Input> for CommitWrapper
source§impl From<Commitment> for CommitWrapper
impl From<Commitment> for CommitWrapper
source§fn from(commit: Commitment) -> Self
fn from(commit: Commitment) -> Self
Converts to this type from the input type.
source§impl From<Input> for CommitWrapper
impl From<Input> for CommitWrapper
source§impl Ord for CommitWrapper
impl Ord for CommitWrapper
source§fn cmp(&self, other: &CommitWrapper) -> Ordering
fn cmp(&self, other: &CommitWrapper) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for CommitWrapper
impl PartialEq for CommitWrapper
source§fn eq(&self, other: &CommitWrapper) -> bool
fn eq(&self, other: &CommitWrapper) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for CommitWrapper
impl PartialOrd for CommitWrapper
source§fn partial_cmp(&self, other: &CommitWrapper) -> Option<Ordering>
fn partial_cmp(&self, other: &CommitWrapper) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl Readable for CommitWrapper
impl Readable for CommitWrapper
source§impl Serialize for CommitWrapper
impl Serialize for CommitWrapper
source§impl Writeable for CommitWrapper
impl Writeable for CommitWrapper
impl Copy for CommitWrapper
impl DefaultHashable for CommitWrapper
impl Eq for CommitWrapper
Auto Trait Implementations§
impl Freeze for CommitWrapper
impl RefUnwindSafe for CommitWrapper
impl Send for CommitWrapper
impl Sync for CommitWrapper
impl Unpin for CommitWrapper
impl UnwindSafe for CommitWrapper
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
Mutably borrows from an owned value. Read more
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<D> Hashed for Dwhere
D: DefaultHashable,
impl<D> Hashed for Dwhere
D: DefaultHashable,
source§impl<T> PMMRIndexHashable for Twhere
T: DefaultHashable,
impl<T> PMMRIndexHashable for Twhere
T: DefaultHashable,
source§fn hash_with_index(&self, index: u64) -> Hash
fn hash_with_index(&self, index: u64) -> Hash
Hash with a given index
source§impl<H> ShortIdentifiable for Hwhere
H: Hashed,
impl<H> ShortIdentifiable for Hwhere
H: Hashed,
source§fn short_id(&self, hash: &Hash, nonce: u64) -> ShortId
fn short_id(&self, hash: &Hash, nonce: u64) -> ShortId
Generate a short_id via the following -
- extract k0/k1 from block_hash hashed with the nonce (first two u64
values) * initialize a siphasher24 with k0/k1
- self.hash() passing in the siphasher24 instance
- drop the 2 most significant bytes (to return a 6 byte short_id)