logo
pub enum ExecutionResult {
    Failure {
        error: Error,
        transfers: Vec<TransferAddr>,
        cost: Gas,
        execution_journal: ExecutionJournal,
    },
    Success {
        transfers: Vec<TransferAddr>,
        cost: Gas,
        execution_journal: ExecutionJournal,
    },
}
Expand description

Represents the result of an execution specified by crate::core::engine_state::ExecuteRequest.

Variants

Failure

Fields

error: Error

Error causing this Failure variant.

transfers: Vec<TransferAddr>

List of transfers that happened during execution up to the point of the failure.

cost: Gas

Gas consumed up to the point of the failure.

execution_journal: ExecutionJournal

Journal of execution.

An error condition that happened during execution

Success

Fields

transfers: Vec<TransferAddr>

List of transfers.

cost: Gas

Gas cost.

execution_journal: ExecutionJournal

Journal of execution.

Execution was finished successfully

Implementations

Constructs ExecutionResult::Failure that has 0 cost and no effects. This is the case for failures that we can’t (or don’t want to) charge for, like PreprocessingError or InvalidNonce.

Returns true if this is a successful variant.

Returns true if this is a failure variant.

Returns true if this is a precondition failure.

Precondition variant is further described as an execution failure which does not have any effects, and has a gas cost of 0.

Returns gas cost of execution regardless of variant.

Returns list of transfers regardless of variant.

The journal of transforms regardless of variant.

Returns a new execution result with updated gas cost.

This method preserves the ExecutionResult variant and updates the cost field only.

Returns a new execution result with updated transfers field.

This method preserves the ExecutionResult variant and updates the transfers field only.

Returns a new execution result with an updated execution journal.

This method preserves the ExecutionResult variant and updates the execution_journal field only.

Returns error value, if possible.

Returns a reference to a wrapped error::Error instance if the object is a failure variant.

Consumes ExecutionResult instance and optionally returns error::Error instance for ExecutionResult::Failure variant.

Checks the transfer status of a payment code.

This method converts the gas cost of the execution result into motes using supplied gas_price, and then a check is made to ensure that user deposited enough funds in the payment purse (in motes) to cover the execution of a payment code.

Returns None if user deposited enough funds in payment purse and the execution result was a success variant, otherwise a wrapped ForcedTransferResult that indicates an error condition.

Creates a new payment code error.

The method below creates an ExecutionResult with precomputed effects of a “finalize_payment”.

The effects that are produced as part of this process would subract max_payment_cost from account’s main purse, and add max_payment_cost to proposer account’s balance.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Converts to this type from the input type.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Converts self into a target type. Read more

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait. Read more

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s. Read more

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s. Read more

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait. Read more

Causes self to use its Binary implementation when Debug-formatted.

Causes self to use its Display implementation when Debug-formatted. Read more

Causes self to use its LowerExp implementation when Debug-formatted. Read more

Causes self to use its LowerHex implementation when Debug-formatted. Read more

Causes self to use its Octal implementation when Debug-formatted.

Causes self to use its Pointer implementation when Debug-formatted. Read more

Causes self to use its UpperExp implementation when Debug-formatted. Read more

Causes self to use its UpperHex implementation when Debug-formatted. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Pipes a value into a function that cannot ordinarily be called in suffix position. Read more

Pipes a trait borrow into a function that cannot normally be called in suffix position. Read more

Pipes a trait mutable borrow into a function that cannot normally be called in suffix position. Read more

Pipes a trait borrow into a function that cannot normally be called in suffix position. Read more

Pipes a trait mutable borrow into a function that cannot normally be called in suffix position. Read more

Pipes a dereference into a function that cannot normally be called in suffix position. Read more

Pipes a mutable dereference into a function that cannot normally be called in suffix position. Read more

Pipes a reference into a function that cannot ordinarily be called in suffix position. Read more

Pipes a mutable reference into a function that cannot ordinarily be called in suffix position. Read more

Should always be Self

Provides immutable access for inspection. Read more

Calls tap in debug builds, and does nothing in release builds.

Provides mutable access for modification. Read more

Calls tap_mut in debug builds, and does nothing in release builds.

Provides immutable access to the reference for inspection.

Calls tap_ref in debug builds, and does nothing in release builds.

Provides mutable access to the reference for modification.

Calls tap_ref_mut in debug builds, and does nothing in release builds.

Provides immutable access to the borrow for inspection. Read more

Calls tap_borrow in debug builds, and does nothing in release builds.

Provides mutable access to the borrow for modification.

Calls tap_borrow_mut in debug builds, and does nothing in release builds. Read more

Immutably dereferences self for inspection.

Calls tap_deref in debug builds, and does nothing in release builds.

Mutably dereferences self for modification.

Calls tap_deref_mut in debug builds, and does nothing in release builds. Read more

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

Attempts to convert self into a target type. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more