[−][src]Struct evm::ValidTransaction
Represents an Ethereum transaction.
About SYSTEM transaction
SYSTEM transaction in Ethereum is something that cannot be executed by the user, and is enforced by the blockchain rules. The SYSTEM transaction does not have a caller. When executed in EVM, however, the CALLER opcode would return 0xffffffffffffffffffffffffffffffffffffffff. As a result, when executing a message call or a contract creation, nonce are not changed. A SYSTEM transaction must have gas_price set to zero. Because the transaction reward is always zero, a SYSTEM transaction will also not invoke creation of the beneficiary address if it does not exist before.
Fields
caller: Option<Address>
Caller of this transaction. If caller is None, then this is a SYSTEM transaction.
gas_price: Gas
Gas price of this transaction.
gas_limit: Gas
Gas limit of this transaction.
action: TransactionAction
Transaction action.
value: U256
Value of this transaction.
input: Rc<Vec<u8>>
Data or init associated with this transaction.
nonce: U256
Nonce of the transaction.
Methods
impl ValidTransaction
[src]
pub fn from_transaction<P: Patch>(
patch: &P,
transaction: &Transaction,
account_state: &AccountState<P::Account>
) -> Result<Result<ValidTransaction, PreExecutionError>, RequireError>
[src]
patch: &P,
transaction: &Transaction,
account_state: &AccountState<P::Account>
) -> Result<Result<ValidTransaction, PreExecutionError>, RequireError>
Create a valid transaction from a block transaction. Caller is always Some.
impl ValidTransaction
[src]
pub fn address(&self) -> Address
[src]
To address of the transaction.
pub fn intrinsic_gas(&self, gas_transaction_create: Gas) -> Gas
[src]
Intrinsic gas to be paid in prior to this transaction execution.
pub fn into_context<P: Patch>(
self,
upfront: Gas,
origin: Option<Address>,
account_state: &mut AccountState<P::Account>,
is_code: bool,
is_static: bool
) -> Result<Context, RequireError>
[src]
self,
upfront: Gas,
origin: Option<Address>,
account_state: &mut AccountState<P::Account>,
is_code: bool,
is_static: bool
) -> Result<Context, RequireError>
Convert this transaction into a context. Note that this will change the account state.
pub fn preclaimed_value(&self) -> U256
[src]
When the execution of a transaction begins, this preclaimed value is deducted from the account.
Trait Implementations
impl Clone for ValidTransaction
[src]
fn clone(&self) -> ValidTransaction
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for ValidTransaction
[src]
Auto Trait Implementations
impl !Send for ValidTransaction
impl !Sync for ValidTransaction
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same for T
type Output = T
Should always be Self