Enum diem_types::transaction::Transaction
source · pub enum Transaction {
UserTransaction(SignedTransaction),
GenesisTransaction(WriteSetPayload),
BlockMetadata(BlockMetadata),
}
Expand description
Transaction
will be the transaction type used internally in the diem node to represent the
transaction to be processed and persisted.
We suppress the clippy warning here as we would expect most of the transaction to be user transaction.
Variants§
UserTransaction(SignedTransaction)
Transaction submitted by the user. e.g: P2P payment transaction, publishing module transaction, etc. TODO: We need to rename SignedTransaction to SignedUserTransaction, as well as all the other transaction types we had in our codebase.
GenesisTransaction(WriteSetPayload)
Transaction that applies a WriteSet to the current storage, it’s applied manually via db-bootstrapper.
BlockMetadata(BlockMetadata)
Transaction to update the block metadata resource at the beginning of a block.
Implementations§
source§impl Transaction
impl Transaction
pub fn as_signed_user_txn(&self) -> Result<&SignedTransaction>
pub fn format_for_client( &self, get_transaction_name: impl Fn(&[u8]) -> String ) -> String
Trait Implementations§
source§impl Arbitrary for Transaction
impl Arbitrary for Transaction
§type Parameters = (<SignedTransaction as Arbitrary>::Parameters, <WriteSetPayload as Arbitrary>::Parameters, <BlockMetadata as Arbitrary>::Parameters)
type Parameters = (<SignedTransaction as Arbitrary>::Parameters, <WriteSetPayload as Arbitrary>::Parameters, <BlockMetadata as Arbitrary>::Parameters)
The type of parameters that
arbitrary_with
accepts for configuration
of the generated Strategy
. Parameters must implement Default
.§type Strategy = TupleUnion<((u32, Arc<Map<<SignedTransaction as Arbitrary>::Strategy, fn(_: SignedTransaction) -> Transaction>>), (u32, Arc<Map<<WriteSetPayload as Arbitrary>::Strategy, fn(_: WriteSetPayload) -> Transaction>>), (u32, Arc<Map<<BlockMetadata as Arbitrary>::Strategy, fn(_: BlockMetadata) -> Transaction>>))>
type Strategy = TupleUnion<((u32, Arc<Map<<SignedTransaction as Arbitrary>::Strategy, fn(_: SignedTransaction) -> Transaction>>), (u32, Arc<Map<<WriteSetPayload as Arbitrary>::Strategy, fn(_: WriteSetPayload) -> Transaction>>), (u32, Arc<Map<<BlockMetadata as Arbitrary>::Strategy, fn(_: BlockMetadata) -> Transaction>>))>
The type of
Strategy
used to generate values of type Self
.source§fn arbitrary_with(_top: Self::Parameters) -> Self::Strategy
fn arbitrary_with(_top: Self::Parameters) -> Self::Strategy
source§impl Clone for Transaction
impl Clone for Transaction
source§fn clone(&self) -> Transaction
fn clone(&self) -> Transaction
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 CryptoHash for Transaction
impl CryptoHash for Transaction
source§impl Debug for Transaction
impl Debug for Transaction
source§impl<'de> Deserialize<'de> for Transaction
impl<'de> Deserialize<'de> for Transaction
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 PartialEq<Transaction> for Transaction
impl PartialEq<Transaction> for Transaction
source§fn eq(&self, other: &Transaction) -> bool
fn eq(&self, other: &Transaction) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for Transaction
impl Serialize for Transaction
source§impl TryFrom<Transaction> for SignedTransaction
impl TryFrom<Transaction> for SignedTransaction
impl Eq for Transaction
impl StructuralEq for Transaction
impl StructuralPartialEq for Transaction
Auto Trait Implementations§
impl RefUnwindSafe for Transaction
impl Send for Transaction
impl Sync for Transaction
impl Unpin for Transaction
impl UnwindSafe for Transaction
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
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<T> TestOnlyHash for Twhere
T: Serialize + ?Sized,
impl<T> TestOnlyHash for Twhere T: Serialize + ?Sized,
source§fn test_only_hash(&self) -> HashValue
fn test_only_hash(&self) -> HashValue
Generates a hash used only for tests.