pub struct HeadTransaction {
pub tx: MempoolTransaction,
pub tip: U256,
}Fields§
§tx: MempoolTransaction§tip: U256Methods from Deref<Target = Transaction>§
pub fn tx_type(&self) -> TxType
pub fn effective_gas_price(&self, base_fee_per_gas: Option<u64>) -> Option<U256>
pub fn cost_without_base_fee(&self) -> Option<U256>
pub fn fee_token(&self) -> Option<H160>
pub fn sender(&self, crypto: &dyn Crypto) -> Result<H160, 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) -> &Vec<(H160, Vec<H256>)>
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
Sourcepub fn effective_gas_tip(&self, base_fee: Option<u64>) -> Option<U256>
pub fn effective_gas_tip(&self, base_fee: Option<u64>) -> Option<U256>
Returns the effective tip per gas for this transaction.
Returns None if the transaction’s fee cap is below the base fee (i.e. the
transaction cannot pay for its inclusion).
Sourcepub fn protected(&self) -> bool
pub fn protected(&self) -> bool
Returns whether the transaction is replay-protected. For more information check out EIP-155
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().
Trait Implementations§
Source§impl Clone for HeadTransaction
impl Clone for HeadTransaction
Source§fn clone(&self) -> HeadTransaction
fn clone(&self) -> HeadTransaction
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 HeadTransaction
impl Debug for HeadTransaction
Source§impl Deref for HeadTransaction
impl Deref for HeadTransaction
impl Eq for HeadTransaction
Source§impl From<HeadTransaction> for Transaction
impl From<HeadTransaction> for Transaction
Source§fn from(val: HeadTransaction) -> Self
fn from(val: HeadTransaction) -> Self
Source§impl Ord for HeadTransaction
impl Ord for HeadTransaction
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for HeadTransaction
impl PartialEq for HeadTransaction
Source§fn eq(&self, other: &HeadTransaction) -> bool
fn eq(&self, other: &HeadTransaction) -> bool
self and other values to be equal, and is used by ==.Source§impl PartialOrd for HeadTransaction
impl PartialOrd for HeadTransaction
impl StructuralPartialEq for HeadTransaction
Auto Trait Implementations§
impl Freeze for HeadTransaction
impl RefUnwindSafe for HeadTransaction
impl Send for HeadTransaction
impl Sync for HeadTransaction
impl Unpin for HeadTransaction
impl UnsafeUnpin for HeadTransaction
impl UnwindSafe for HeadTransaction
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> 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,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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.