// Copyright 2015-2019 Parity Technologies (UK) Ltd.
// This file is part of Parity Ethereum.
// Parity Ethereum is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity Ethereum is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity Ethereum. If not, see .
//! Transaction execution format module.
use ethereum_types::{U256, Address};
use bytes::Bytes;
use vm;
use trace::{VMTrace, FlatTrace};
use types::{
state_diff::StateDiff,
log_entry::LogEntry,
errors::ExecutionError,
};
/// Transaction execution receipt.
#[derive(Debug, PartialEq, Clone)]
pub struct Executed {
/// True if the outer call/create resulted in an exceptional exit.
pub exception: Option,
/// Gas paid up front for execution of transaction.
pub gas: U256,
/// Gas used during execution of transaction.
pub gas_used: U256,
/// Gas refunded after the execution of transaction.
/// To get gas that was required up front, add `refunded` and `gas_used`.
pub refunded: U256,
/// Cumulative gas used in current block so far.
///
/// `cumulative_gas_used = gas_used(t0) + gas_used(t1) + ... gas_used(tn)`
///
/// where `tn` is current transaction.
pub cumulative_gas_used: U256,
/// Vector of logs generated by transaction.
pub logs: Vec,
/// Addresses of contracts created during execution of transaction.
/// Ordered from earliest creation.
///
/// eg. sender creates contract A and A in constructor creates contract B
///
/// B creation ends first, and it will be the first element of the vector.
pub contracts_created: Vec,
/// Transaction output.
pub output: Bytes,
/// The trace of this transaction.
pub trace: Vec,
/// The VM trace of this transaction.
pub vm_trace: Option,
/// The state diff, if we traced it.
pub state_diff: Option,
}
/// Transaction execution result.
pub type ExecutionResult = Result, ExecutionError>;