pub enum Transaction {
LegacyTransaction(LegacyTransaction),
EIP2930Transaction(EIP2930Transaction),
EIP1559Transaction(EIP1559Transaction),
EIP4844Transaction(EIP4844Transaction),
EIP7702Transaction(EIP7702Transaction),
PrivilegedL2Transaction(PrivilegedL2Transaction),
FeeTokenTransaction(FeeTokenTransaction),
}Variants§
LegacyTransaction(LegacyTransaction)
EIP2930Transaction(EIP2930Transaction)
EIP1559Transaction(EIP1559Transaction)
EIP4844Transaction(EIP4844Transaction)
EIP7702Transaction(EIP7702Transaction)
PrivilegedL2Transaction(PrivilegedL2Transaction)
FeeTokenTransaction(FeeTokenTransaction)
Implementations§
Source§impl Transaction
impl Transaction
Sourcepub fn decode_canonical(bytes: &[u8]) -> Result<Self, RLPDecodeError>
pub fn decode_canonical(bytes: &[u8]) -> Result<Self, RLPDecodeError>
Decodes a single transaction in canonical format
Based on [EIP-2718]
Transactions can be encoded in the following formats:
A) TransactionType || Transaction (Where Transaction type is an 8-bit number between 0 and 0x7f, and Transaction is an rlp encoded transaction of type TransactionType)
B) LegacyTransaction (An rlp encoded LegacyTransaction)
Sourcepub fn encode_canonical(&self, buf: &mut dyn BufMut)
pub fn encode_canonical(&self, buf: &mut dyn BufMut)
Encodes a transaction in canonical format
Based on [EIP-2718]
Transactions can be encoded in the following formats:
A) TransactionType || Transaction (Where Transaction type is an 8-bit number between 0 and 0x7f, and Transaction is an rlp encoded transaction of type TransactionType)
B) LegacyTransaction (An rlp encoded LegacyTransaction)
Sourcepub fn encode_canonical_to_vec(&self) -> Vec<u8> ⓘ
pub fn encode_canonical_to_vec(&self) -> Vec<u8> ⓘ
Encodes a transaction in canonical format into a newly created buffer
Based on [EIP-2718]
Transactions can be encoded in the following formats:
A) TransactionType || Transaction (Where Transaction type is an 8-bit number between 0 and 0x7f, and Transaction is an rlp encoded transaction of type TransactionType)
B) LegacyTransaction (An rlp encoded LegacyTransaction)
Sourcepub fn encode_canonical_len(&self) -> usize
pub fn encode_canonical_len(&self) -> usize
Canonical-encoded length without allocating a buffer. Counts the
1-byte type prefix for typed txs (EIP-2718) plus the inner RLP
payload length. Use this when only the size is needed (e.g.
admission-time size caps) to avoid encode_canonical_to_vec().len().
Source§impl Transaction
impl Transaction
Source§impl Transaction
impl Transaction
pub fn sender(&self, crypto: &dyn Crypto) -> Result<Address, CryptoError>
pub fn gas_limit(&self) -> u64
pub fn gas_price(&self) -> U256
pub fn to(&self) -> TxKind
pub fn value(&self) -> U256
pub fn max_priority_fee(&self) -> Option<u64>
pub fn chain_id(&self) -> Option<u64>
pub fn access_list(&self) -> &AccessList
pub fn nonce(&self) -> u64
pub fn data(&self) -> &Bytes
pub fn blob_versioned_hashes(&self) -> Vec<H256>
pub fn max_fee_per_blob_gas(&self) -> Option<U256>
pub fn is_contract_creation(&self) -> bool
pub fn is_privileged(&self) -> bool
pub fn max_fee_per_gas(&self) -> Option<u64>
pub fn hash(&self) -> H256
pub fn gas_tip_cap(&self) -> U256
pub fn gas_fee_cap(&self) -> U256
Trait Implementations§
Source§impl Archive for Transaction
impl Archive for Transaction
Source§type Archived = ArchivedTransaction
type Archived = ArchivedTransaction
Source§type Resolver = TransactionResolver
type Resolver = TransactionResolver
Source§fn resolve(
&self,
resolver: <Self as Archive>::Resolver,
out: Place<<Self as Archive>::Archived>,
)
fn resolve( &self, resolver: <Self as Archive>::Resolver, out: Place<<Self as Archive>::Archived>, )
Source§const COPY_OPTIMIZATION: CopyOptimization<Self> = _
const COPY_OPTIMIZATION: CopyOptimization<Self> = _
serialize. Read moreSource§impl Clone for Transaction
impl Clone for Transaction
Source§fn clone(&self) -> Transaction
fn clone(&self) -> Transaction
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§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>,
Source§impl<__D: Fallible + ?Sized> Deserialize<Transaction, __D> for Archived<Transaction>where
LegacyTransaction: Archive,
<LegacyTransaction as Archive>::Archived: Deserialize<LegacyTransaction, __D>,
EIP2930Transaction: Archive,
<EIP2930Transaction as Archive>::Archived: Deserialize<EIP2930Transaction, __D>,
EIP1559Transaction: Archive,
<EIP1559Transaction as Archive>::Archived: Deserialize<EIP1559Transaction, __D>,
EIP4844Transaction: Archive,
<EIP4844Transaction as Archive>::Archived: Deserialize<EIP4844Transaction, __D>,
EIP7702Transaction: Archive,
<EIP7702Transaction as Archive>::Archived: Deserialize<EIP7702Transaction, __D>,
PrivilegedL2Transaction: Archive,
<PrivilegedL2Transaction as Archive>::Archived: Deserialize<PrivilegedL2Transaction, __D>,
FeeTokenTransaction: Archive,
<FeeTokenTransaction as Archive>::Archived: Deserialize<FeeTokenTransaction, __D>,
impl<__D: Fallible + ?Sized> Deserialize<Transaction, __D> for Archived<Transaction>where
LegacyTransaction: Archive,
<LegacyTransaction as Archive>::Archived: Deserialize<LegacyTransaction, __D>,
EIP2930Transaction: Archive,
<EIP2930Transaction as Archive>::Archived: Deserialize<EIP2930Transaction, __D>,
EIP1559Transaction: Archive,
<EIP1559Transaction as Archive>::Archived: Deserialize<EIP1559Transaction, __D>,
EIP4844Transaction: Archive,
<EIP4844Transaction as Archive>::Archived: Deserialize<EIP4844Transaction, __D>,
EIP7702Transaction: Archive,
<EIP7702Transaction as Archive>::Archived: Deserialize<EIP7702Transaction, __D>,
PrivilegedL2Transaction: Archive,
<PrivilegedL2Transaction as Archive>::Archived: Deserialize<PrivilegedL2Transaction, __D>,
FeeTokenTransaction: Archive,
<FeeTokenTransaction as Archive>::Archived: Deserialize<FeeTokenTransaction, __D>,
Source§fn deserialize(
&self,
deserializer: &mut __D,
) -> Result<Transaction, <__D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut __D, ) -> Result<Transaction, <__D as Fallible>::Error>
impl Eq for Transaction
Source§impl From<Transaction> for GenericTransaction
impl From<Transaction> for GenericTransaction
Source§fn from(value: Transaction) -> Self
fn from(value: Transaction) -> Self
Source§impl PartialEq for Transaction
impl PartialEq for Transaction
Source§fn eq(&self, other: &Transaction) -> bool
fn eq(&self, other: &Transaction) -> bool
self and other values to be equal, and is used by ==.Source§impl PayloadRLPEncode for Transaction
impl PayloadRLPEncode for Transaction
fn encode_payload(&self, buf: &mut dyn BufMut)
fn encode_payload_to_vec(&self) -> Vec<u8> ⓘ
Source§impl RLPDecode for Transaction
impl RLPDecode for Transaction
Source§fn decode_unfinished(rlp: &[u8]) -> Result<(Self, &[u8]), RLPDecodeError>
fn decode_unfinished(rlp: &[u8]) -> Result<(Self, &[u8]), RLPDecodeError>
Transactions can be encoded in the following formats: A) Legacy transactions: rlp(LegacyTransaction) B) Non legacy transactions: rlp(Bytes) where Bytes represents the canonical encoding for the transaction as a bytes object. Checkout Transaction::decode_canonical for more information
fn decode(rlp: &[u8]) -> Result<Self, RLPDecodeError>
Source§impl RLPEncode for Transaction
impl RLPEncode for Transaction
Source§fn encode(&self, buf: &mut dyn BufMut)
fn encode(&self, buf: &mut dyn BufMut)
Transactions can be encoded in the following formats: A) Legacy transactions: rlp(LegacyTransaction) B) Non legacy transactions: rlp(Bytes) where Bytes represents the canonical encoding for the transaction as a bytes object. Checkout Transaction::encode_canonical for more information
fn length(&self) -> usize
fn encode_to_vec(&self) -> Vec<u8> ⓘ
Source§impl Serialize for Transaction
impl Serialize for Transaction
Source§impl<__S: Fallible + ?Sized> Serialize<__S> for Transactionwhere
LegacyTransaction: Serialize<__S>,
EIP2930Transaction: Serialize<__S>,
EIP1559Transaction: Serialize<__S>,
EIP4844Transaction: Serialize<__S>,
EIP7702Transaction: Serialize<__S>,
PrivilegedL2Transaction: Serialize<__S>,
FeeTokenTransaction: Serialize<__S>,
impl<__S: Fallible + ?Sized> Serialize<__S> for Transactionwhere
LegacyTransaction: Serialize<__S>,
EIP2930Transaction: Serialize<__S>,
EIP1559Transaction: Serialize<__S>,
EIP4844Transaction: Serialize<__S>,
EIP7702Transaction: Serialize<__S>,
PrivilegedL2Transaction: Serialize<__S>,
FeeTokenTransaction: Serialize<__S>,
impl StructuralPartialEq for Transaction
Source§impl TryInto<Transaction> for P2PTransaction
impl TryInto<Transaction> for P2PTransaction
Auto Trait Implementations§
impl !Freeze for Transaction
impl RefUnwindSafe for Transaction
impl Send for Transaction
impl Sync for Transaction
impl Unpin for Transaction
impl UnsafeUnpin for Transaction
impl UnwindSafe for Transaction
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> ArchiveUnsized for Twhere
T: Archive,
impl<T> ArchiveUnsized for Twhere
T: Archive,
Source§type Archived = <T as Archive>::Archived
type Archived = <T as Archive>::Archived
Archive, it may be
unsized. Read moreSource§fn archived_metadata(
&self,
) -> <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
fn archived_metadata( &self, ) -> <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.