Enum diem_sdk::types::transaction::Transaction
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§
§impl Transaction
impl Transaction
pub fn as_signed_user_txn(&self) -> Result<&SignedTransaction, Error>
pub fn format_for_client( &self, get_transaction_name: impl Fn(&[u8]) -> String ) -> String
Trait Implementations§
§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
.§fn arbitrary_with(
_top: <Transaction as Arbitrary>::Parameters
) -> <Transaction as Arbitrary>::Strategy
fn arbitrary_with( _top: <Transaction as Arbitrary>::Parameters ) -> <Transaction as Arbitrary>::Strategy
§impl Clone for Transaction
impl Clone for Transaction
§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 more§impl CryptoHash for Transaction
impl CryptoHash for Transaction
§impl Debug for Transaction
impl Debug for Transaction
§impl<'de> Deserialize<'de> for Transaction
impl<'de> Deserialize<'de> for Transaction
§fn deserialize<__D>(
__deserializer: __D
) -> Result<Transaction, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<Transaction, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl From<Transaction> for TransactionDataView
impl From<Transaction> for TransactionDataView
§fn from(tx: Transaction) -> TransactionDataView
fn from(tx: Transaction) -> TransactionDataView
Converts to this type from the input type.
§impl PartialEq<Transaction> for Transaction
impl PartialEq<Transaction> for Transaction
§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 ==
.§impl Serialize for Transaction
impl Serialize for Transaction
§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where __S: Serializer,
Serialize this value into the given Serde serializer. Read more
§impl TryFrom<Transaction> for SignedTransaction
impl TryFrom<Transaction> for SignedTransaction
§fn try_from(txn: Transaction) -> Result<SignedTransaction, Error>
fn try_from(txn: Transaction) -> Result<SignedTransaction, Error>
Performs the conversion.
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> 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>
§impl<T> TestOnlyHash for Twhere
T: Serialize + ?Sized,
impl<T> TestOnlyHash for Twhere T: Serialize + ?Sized,
§fn test_only_hash(&self) -> HashValue
fn test_only_hash(&self) -> HashValue
Generates a hash used only for tests.