Enum common_types::transaction::TypedTransaction
source · [−]pub enum TypedTransaction {
Legacy(Transaction),
AccessList(AccessListTx),
EIP1559Transaction(EIP1559TransactionTx),
}
Variants
Legacy(Transaction)
AccessList(AccessListTx)
EIP1559Transaction(EIP1559TransactionTx)
Implementations
sourceimpl TypedTransaction
impl TypedTransaction
pub fn tx_type(&self) -> TypedTxId
sourcepub fn signature_hash(&self, chain_id: Option<u64>) -> H256
pub fn signature_hash(&self, chain_id: Option<u64>) -> H256
The message hash of the transaction.
sourcepub fn sign(self, secret: &Secret, chain_id: Option<u64>) -> SignedTransaction
pub fn sign(self, secret: &Secret, chain_id: Option<u64>) -> SignedTransaction
Signs the transaction as coming from sender
.
sourcepub fn with_signature(
self,
sig: Signature,
chain_id: Option<u64>
) -> UnverifiedTransaction
pub fn with_signature(
self,
sig: Signature,
chain_id: Option<u64>
) -> UnverifiedTransaction
Signs the transaction with signature.
sourcepub fn fake_sign(self, from: Address) -> SignedTransaction
pub fn fake_sign(self, from: Address) -> SignedTransaction
Specify the sender; this won’t survive the serialize/deserialize process, but can be cloned.
sourcepub fn null_sign(self, chain_id: u64) -> SignedTransaction
pub fn null_sign(self, chain_id: u64) -> SignedTransaction
Legacy EIP-86 compatible empty signature. This method is used in json tests as well as signature verification tests.
pub fn tx(&self) -> &Transaction
pub fn tx_mut(&mut self) -> &mut Transaction
pub fn access_list(&self) -> Option<&AccessList>
pub fn effective_gas_price(&self, block_base_fee: Option<U256>) -> U256
pub fn max_priority_fee_per_gas(&self) -> U256
pub fn effective_priority_fee(&self, block_base_fee: Option<U256>) -> U256
pub fn has_zero_gas_price(&self) -> bool
pub fn decode(tx: &[u8]) -> Result<UnverifiedTransaction, DecoderError>
pub fn decode_rlp_list(
rlp: &Rlp<'_>
) -> Result<Vec<UnverifiedTransaction>, DecoderError>
pub fn decode_rlp(tx: &Rlp<'_>) -> Result<UnverifiedTransaction, DecoderError>
pub fn rlp_append_list(s: &mut RlpStream, tx_list: &[UnverifiedTransaction])
Trait Implementations
sourceimpl Clone for TypedTransaction
impl Clone for TypedTransaction
sourcefn clone(&self) -> TypedTransaction
fn clone(&self) -> TypedTransaction
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for TypedTransaction
impl Debug for TypedTransaction
sourceimpl MallocSizeOf for TypedTransaction
impl MallocSizeOf for TypedTransaction
sourcefn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Measure the heap usage of all descendant heap-allocated structures, but
not the space taken up by the value itself.
If T::size_of
is a constant, consider implementing constant_size
as well. Read more
sourcefn constant_size() -> Option<usize>
fn constant_size() -> Option<usize>
Used to optimize MallocSizeOf
implementation for collections
like Vec
and HashMap
to avoid iterating over them unnecessarily.
The Self: Sized
bound is for object safety. Read more
sourceimpl PartialEq<TypedTransaction> for TypedTransaction
impl PartialEq<TypedTransaction> for TypedTransaction
sourcefn eq(&self, other: &TypedTransaction) -> bool
fn eq(&self, other: &TypedTransaction) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &TypedTransaction) -> bool
fn ne(&self, other: &TypedTransaction) -> bool
This method tests for !=
.
impl Eq for TypedTransaction
impl StructuralEq for TypedTransaction
impl StructuralPartialEq for TypedTransaction
Auto Trait Implementations
impl RefUnwindSafe for TypedTransaction
impl Send for TypedTransaction
impl Sync for TypedTransaction
impl Unpin for TypedTransaction
impl UnwindSafe for TypedTransaction
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> MallocSizeOfExt for T where
T: MallocSizeOf,
impl<T> MallocSizeOfExt for T where
T: MallocSizeOf,
sourcefn malloc_size_of(&self) -> usize
fn malloc_size_of(&self) -> usize
Method to launch a heapsize measurement with a fresh state. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more