pub struct TxEnv {Show 14 fields
pub tx_type: TransactionType,
pub caller: Address,
pub gas_limit: u64,
pub gas_price: U256,
pub transact_to: TxKind,
pub value: U256,
pub data: Bytes,
pub nonce: u64,
pub chain_id: Option<u64>,
pub access_list: AccessList,
pub gas_priority_fee: Option<U256>,
pub blob_hashes: Vec<B256>,
pub max_fee_per_blob_gas: Option<U256>,
pub authorization_list: AuthorizationList,
}
Expand description
The transaction environment.
Fields§
§tx_type: TransactionType
§caller: Address
Caller aka Author aka transaction signer.
gas_limit: u64
The gas limit of the transaction.
gas_price: U256
The gas price of the transaction.
transact_to: TxKind
The destination of the transaction.
value: U256
The value sent to transact_to
.
data: Bytes
The data of the transaction.
nonce: u64
The nonce of the transaction.
chain_id: Option<u64>
The chain ID of the transaction. If set to None
, no checks are performed.
Incorporated as part of the Spurious Dragon upgrade via EIP-155.
access_list: AccessList
A list of addresses and storage keys that the transaction plans to access.
Added in EIP-2930.
gas_priority_fee: Option<U256>
The priority fee per gas.
Incorporated as part of the London upgrade via EIP-1559.
blob_hashes: Vec<B256>
The list of blob versioned hashes. Per EIP there should be at least
one blob present if Self::max_fee_per_blob_gas
is Some
.
Incorporated as part of the Cancun upgrade via EIP-4844.
max_fee_per_blob_gas: Option<U256>
The max fee per blob gas.
Incorporated as part of the Cancun upgrade via EIP-4844.
List of authorizations, that contains the signature that authorizes this caller to place the code to signer account.
Set EOA account code for one transaction
Trait Implementations§
Source§impl CommonTxFields for TxEnv
impl CommonTxFields for TxEnv
Source§impl Eip1559CommonTxFields for TxEnv
impl Eip1559CommonTxFields for TxEnv
Source§type AccessList = AccessList
type AccessList = AccessList
Source§fn max_fee_per_gas(&self) -> u128
fn max_fee_per_gas(&self) -> u128
Source§fn max_priority_fee_per_gas(&self) -> u128
fn max_priority_fee_per_gas(&self) -> u128
Source§fn access_list(&self) -> &Self::AccessList
fn access_list(&self) -> &Self::AccessList
Source§impl Eip2930Tx for TxEnv
impl Eip2930Tx for TxEnv
type AccessList = AccessList
Source§fn access_list(&self) -> &Self::AccessList
fn access_list(&self) -> &Self::AccessList
Source§impl Eip4844Tx for TxEnv
impl Eip4844Tx for TxEnv
Source§fn destination(&self) -> Address
fn destination(&self) -> Address
Source§fn blob_versioned_hashes(&self) -> &[B256]
fn blob_versioned_hashes(&self) -> &[B256]
Source§fn max_fee_per_blob_gas(&self) -> u128
fn max_fee_per_blob_gas(&self) -> u128
Source§fn total_blob_gas(&self) -> u64
fn total_blob_gas(&self) -> u64
Source§fn calc_max_data_fee(&self) -> Uint<256, 4>
fn calc_max_data_fee(&self) -> Uint<256, 4>
data_fee
of the transaction. Read moreSource§impl Eip7702Tx for TxEnv
impl Eip7702Tx for TxEnv
Source§fn destination(&self) -> Address
fn destination(&self) -> Address
Source§impl Transaction for TxEnv
impl Transaction for TxEnv
Source§type TransactionError = InvalidTransaction
type TransactionError = InvalidTransaction
Source§type TransactionType = TransactionType
type TransactionType = TransactionType
Source§type AccessList = <<TxEnv as Transaction>::Eip2930 as Eip2930Tx>::AccessList
type AccessList = <<TxEnv as Transaction>::Eip2930 as Eip2930Tx>::AccessList
type Legacy = TxEnv
type Eip1559 = TxEnv
type Eip2930 = TxEnv
type Eip4844 = TxEnv
type Eip7702 = TxEnv
Source§fn tx_type(&self) -> Self::TransactionType
fn tx_type(&self) -> Self::TransactionType
legacy()
should be called.Source§fn common_fields(&self) -> &dyn CommonTxFields
fn common_fields(&self) -> &dyn CommonTxFields
Source§fn effective_gas_price(&self, base_fee: Uint<256, 4>) -> Uint<256, 4>
fn effective_gas_price(&self, base_fee: Uint<256, 4>) -> Uint<256, 4>
Source§fn access_list(&self) -> Option<&Self::AccessList>
fn access_list(&self) -> Option<&Self::AccessList>
impl Eq for TxEnv
impl StructuralPartialEq for TxEnv
Auto Trait Implementations§
impl !Freeze for TxEnv
impl RefUnwindSafe for TxEnv
impl Send for TxEnv
impl Sync for TxEnv
impl Unpin for TxEnv
impl UnwindSafe for TxEnv
Blanket Implementations§
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> Conv for T
impl<T> Conv for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self
to use its Binary
implementation when Debug
-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self
to use its Display
implementation when
Debug
-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self
to use its LowerExp
implementation when
Debug
-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self
to use its LowerHex
implementation when
Debug
-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self
to use its Octal
implementation when Debug
-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self
to use its Pointer
implementation when
Debug
-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self
to use its UpperExp
implementation when
Debug
-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self
to use its UpperHex
implementation when
Debug
-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self
, then passes self.as_ref()
into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self
, then passes self.as_mut()
into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self
, then passes self.deref()
into the pipe function.§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B>
of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B>
of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R>
view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R>
view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target
of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target
of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap()
only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut()
only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow()
only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref()
only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut()
only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref()
only in debug builds, and is erased in release
builds.