Struct miden_objects::transaction::TransactionId
source · pub struct TransactionId(/* private fields */);Expand description
A unique identifier of a transaction.
Transaction ID is computed as:
hash(init_account_hash, final_account_hash, input_notes_hash, output_notes_hash)
This achieves the following properties:
- Transactions are identical if and only if they have the same ID.
- Computing transaction ID can be done solely from public transaction data.
Implementations§
source§impl TransactionId
impl TransactionId
sourcepub fn new(
init_account_hash: Digest,
final_account_hash: Digest,
input_notes_hash: Digest,
output_notes_hash: Digest,
) -> Self
pub fn new( init_account_hash: Digest, final_account_hash: Digest, input_notes_hash: Digest, output_notes_hash: Digest, ) -> Self
Returns a new TransactionId instantiated from the provided transaction components.
sourcepub fn as_elements(&self) -> &[Felt]
pub fn as_elements(&self) -> &[Felt]
Returns the elements representation of this transaction ID.
Trait Implementations§
source§impl Clone for TransactionId
impl Clone for TransactionId
source§fn clone(&self) -> TransactionId
fn clone(&self) -> TransactionId
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 TransactionId
impl Debug for TransactionId
source§impl Deserializable for TransactionId
impl Deserializable for TransactionId
source§fn read_from<R: ByteReader>(
source: &mut R,
) -> Result<Self, DeserializationError>
fn read_from<R: ByteReader>( source: &mut R, ) -> Result<Self, DeserializationError>
Reads a sequence of bytes from the provided
source, attempts to deserialize these bytes
into Self, and returns the result. Read moresource§fn read_from_bytes(bytes: &[u8]) -> Result<Self, DeserializationError>
fn read_from_bytes(bytes: &[u8]) -> Result<Self, DeserializationError>
source§impl Display for TransactionId
impl Display for TransactionId
source§impl From<&ExecutedTransaction> for TransactionId
impl From<&ExecutedTransaction> for TransactionId
source§fn from(tx: &ExecutedTransaction) -> Self
fn from(tx: &ExecutedTransaction) -> Self
Converts to this type from the input type.
source§impl From<&ProvenTransaction> for TransactionId
impl From<&ProvenTransaction> for TransactionId
source§fn from(tx: &ProvenTransaction) -> Self
fn from(tx: &ProvenTransaction) -> Self
Converts to this type from the input type.
source§impl From<&TransactionId> for Word
impl From<&TransactionId> for Word
source§fn from(id: &TransactionId) -> Self
fn from(id: &TransactionId) -> Self
Converts to this type from the input type.
source§impl From<&TransactionId> for [u8; 32]
impl From<&TransactionId> for [u8; 32]
source§fn from(id: &TransactionId) -> Self
fn from(id: &TransactionId) -> Self
Converts to this type from the input type.
source§impl From<[BaseElement; 4]> for TransactionId
impl From<[BaseElement; 4]> for TransactionId
source§impl From<RpoDigest> for TransactionId
impl From<RpoDigest> for TransactionId
source§impl From<TransactionId> for Word
impl From<TransactionId> for Word
source§fn from(id: TransactionId) -> Self
fn from(id: TransactionId) -> Self
Converts to this type from the input type.
source§impl From<TransactionId> for [u8; 32]
impl From<TransactionId> for [u8; 32]
source§fn from(id: TransactionId) -> Self
fn from(id: TransactionId) -> Self
Converts to this type from the input type.
source§impl Ord for TransactionId
impl Ord for TransactionId
source§fn cmp(&self, other: &TransactionId) -> Ordering
fn cmp(&self, other: &TransactionId) -> 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 TransactionId
impl PartialEq for TransactionId
source§fn eq(&self, other: &TransactionId) -> bool
fn eq(&self, other: &TransactionId) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl PartialOrd for TransactionId
impl PartialOrd for TransactionId
source§fn partial_cmp(&self, other: &TransactionId) -> Option<Ordering>
fn partial_cmp(&self, other: &TransactionId) -> 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 Serializable for TransactionId
impl Serializable for TransactionId
source§fn write_into<W: ByteWriter>(&self, target: &mut W)
fn write_into<W: ByteWriter>(&self, target: &mut W)
Serializes
self into bytes and writes these bytes into the target.source§fn get_size_hint(&self) -> usize
fn get_size_hint(&self) -> usize
Returns an estimate of how many bytes are needed to represent self. Read more
impl Copy for TransactionId
impl Eq for TransactionId
impl StructuralPartialEq for TransactionId
Auto Trait Implementations§
impl Freeze for TransactionId
impl RefUnwindSafe for TransactionId
impl Send for TransactionId
impl Sync for TransactionId
impl Unpin for TransactionId
impl UnwindSafe for TransactionId
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)