cfx_rpc_eth_types/
receipt.rs

1// Copyright 2019-2021 Conflux Foundation. All rights reserved.
2// Conflux is free software and distributed under GNU General Public License.
3// See http://www.gnu.org/licenses/
4
5// Copyright 2015-2020 Parity Technologies (UK) Ltd.
6// This file is part of OpenEthereum.
7
8// OpenEthereum is free software: you can redistribute it and/or modify
9// it under the terms of the GNU General Public License as published by
10// the Free Software Foundation, either version 3 of the License, or
11// (at your option) any later version.
12
13// OpenEthereum is distributed in the hope that it will be useful,
14// but WITHOUT ANY WARRANTY; without even the implied warranty of
15// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16// GNU General Public License for more details.
17
18// You should have received a copy of the GNU General Public License
19// along with OpenEthereum.  If not, see <http://www.gnu.org/licenses/>.
20
21use crate::Log;
22use cfx_types::{Bloom as H2048, H160, H256, U256, U64};
23use serde::Serialize;
24
25/// Receipt
26#[derive(Debug, Serialize, Clone)]
27#[serde(rename_all = "camelCase")]
28pub struct Receipt {
29    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
30    pub transaction_type: Option<U64>,
31    /// Transaction Hash
32    pub transaction_hash: H256,
33    /// Transaction index
34    pub transaction_index: U256,
35    /// Block hash
36    pub block_hash: H256,
37    /// Sender
38    pub from: H160,
39    /// Recipient
40    pub to: Option<H160>,
41    /// Block number
42    pub block_number: U256,
43    /// Cumulative gas used
44    pub cumulative_gas_used: U256,
45    /// Gas used
46    pub gas_used: U256,
47    /// The gas fee charged in the execution of the transaction.
48    pub gas_fee: U256,
49    /// Contract address
50    pub contract_address: Option<H160>,
51    /// Logs
52    pub logs: Vec<Log>,
53    /// Logs bloom
54    pub logs_bloom: H2048,
55    /// Status code
56    #[serde(rename = "status")]
57    pub status_code: U64,
58    /// Effective gas price
59    pub effective_gas_price: U256,
60    /// Detailed error message if tx execution is unsuccessful. Error message
61    /// is None if tx execution is successful or it can not be offered.
62    /// Error message can not be offered by light client.
63    pub tx_exec_error_msg: Option<String>,
64    #[serde(skip_serializing_if = "Option::is_none")]
65    pub burnt_gas_fee: Option<U256>,
66}