2019-01-07 11:33:07 +01:00
|
|
|
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
|
|
|
// This file is part of Parity Ethereum.
|
2018-06-04 10:19:50 +02:00
|
|
|
|
2019-01-07 11:33:07 +01:00
|
|
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
2018-06-04 10:19:50 +02:00
|
|
|
// 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.
|
|
|
|
|
2019-01-07 11:33:07 +01:00
|
|
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
2018-06-04 10:19:50 +02:00
|
|
|
// 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
|
2019-01-07 11:33:07 +01:00
|
|
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
2018-06-04 10:19:50 +02:00
|
|
|
|
2016-02-27 10:19:33 +01:00
|
|
|
use std::collections::HashMap;
|
2019-01-04 14:05:46 +01:00
|
|
|
|
2019-09-03 11:29:25 +02:00
|
|
|
use common_types::{
|
|
|
|
BlockNumber,
|
|
|
|
encoded::Block,
|
|
|
|
engines::ForkChoice,
|
|
|
|
block::BlockInfo,
|
|
|
|
};
|
2019-01-04 14:05:46 +01:00
|
|
|
use ethcore_db::keys::{BlockDetails, BlockReceipts, TransactionAddress};
|
2018-06-20 15:13:07 +02:00
|
|
|
use ethereum_types::{H256, Bloom};
|
2019-01-04 14:05:46 +01:00
|
|
|
|
2016-02-27 02:16:39 +01:00
|
|
|
/// Block extras update info.
|
2018-07-30 11:45:10 +02:00
|
|
|
pub struct ExtrasUpdate {
|
2016-02-27 02:16:39 +01:00
|
|
|
/// Block info.
|
|
|
|
pub info: BlockInfo,
|
2016-07-28 23:46:24 +02:00
|
|
|
/// Current block uncompressed rlp bytes
|
2018-07-30 11:45:10 +02:00
|
|
|
pub block: Block,
|
2016-02-27 10:21:44 +01:00
|
|
|
/// Modified block hashes.
|
2016-02-27 10:19:33 +01:00
|
|
|
pub block_hashes: HashMap<BlockNumber, H256>,
|
2016-02-27 10:21:44 +01:00
|
|
|
/// Modified block details.
|
2016-02-27 10:19:33 +01:00
|
|
|
pub block_details: HashMap<H256, BlockDetails>,
|
2016-02-27 10:21:44 +01:00
|
|
|
/// Modified block receipts.
|
2016-02-27 10:19:33 +01:00
|
|
|
pub block_receipts: HashMap<H256, BlockReceipts>,
|
2018-03-12 21:15:55 +01:00
|
|
|
/// Modified blocks blooms.
|
2018-06-20 15:13:07 +02:00
|
|
|
pub blocks_blooms: Option<(u64, Vec<Bloom>)>,
|
2016-09-28 15:49:42 +02:00
|
|
|
/// Modified transaction addresses (None signifies removed transactions).
|
|
|
|
pub transactions_addresses: HashMap<H256, Option<TransactionAddress>>,
|
2016-02-27 02:16:39 +01:00
|
|
|
}
|
2018-05-16 08:58:01 +02:00
|
|
|
|
|
|
|
/// Extra information in block insertion.
|
|
|
|
pub struct ExtrasInsert {
|
|
|
|
/// The primitive fork choice before applying finalization rules.
|
2019-01-04 14:05:46 +01:00
|
|
|
pub fork_choice: ForkChoice,
|
2018-05-16 08:58:01 +02:00
|
|
|
/// Is the inserted block considered finalized.
|
|
|
|
pub is_finalized: bool,
|
|
|
|
}
|