removed redundant ethcore/basic_types.rs (#7584)

This commit is contained in:
Marek Kotewicz 2018-01-17 10:35:43 +01:00 committed by GitHub
parent 534692cdae
commit 36ba004c29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 17 additions and 45 deletions

View File

@ -1,31 +0,0 @@
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity 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 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. If not, see <http://www.gnu.org/licenses/>.
//! Ethcore basic typenames.
/// Type for a 2048-bit log-bloom, as used by our blocks.
use ethereum_types::Bloom;
/// Constant 2048-bit datum for 0. Often used as a default.
pub static ZERO_LOGBLOOM: Bloom = Bloom([0x00; 256]);
/// Semantic boolean for when a seal/signature is included.
pub enum Seal {
/// The seal/signature is included.
With,
/// The seal/signature is not included.
Without,
}

View File

@ -27,12 +27,11 @@ use ethereum_types::{H256, U256, Address, Bloom};
use bytes::Bytes;
use unexpected::{Mismatch, OutOfBounds};
use basic_types::Seal;
use vm::{EnvInfo, LastHashes};
use engines::EthEngine;
use error::{Error, BlockError};
use factory::Factories;
use header::Header;
use header::{Header, Seal};
use receipt::{Receipt, TransactionOutcome};
use state::State;
use state_db::StateDB;

View File

@ -33,7 +33,6 @@ use kvdb::{DBValue, KeyValueDB, DBTransaction};
// other
use ethereum_types::{H256, Address, U256};
use basic_types::Seal;
use block::*;
use blockchain::{BlockChain, BlockProvider, TreeRoute, ImportRoute};
use blockchain::extras::TransactionAddress;
@ -52,7 +51,7 @@ use evm::{Factory as EvmFactory, Schedule};
use executive::{Executive, Executed, TransactOptions, contract_address};
use factory::Factories;
use futures::{future, Future};
use header::{BlockNumber, Header};
use header::{BlockNumber, Header, Seal};
use io::*;
use log_entry::LocalizedLogEntry;
use miner::{Miner, MinerService};

View File

@ -22,14 +22,19 @@ use hash::{KECCAK_NULL_RLP, KECCAK_EMPTY_LIST_RLP, keccak};
use heapsize::HeapSizeOf;
use ethereum_types::{H256, U256, Address, Bloom};
use bytes::Bytes;
use basic_types::{ZERO_LOGBLOOM};
use time::get_time;
use rlp::*;
pub use basic_types::Seal;
pub use types::BlockNumber;
/// Semantic boolean for when a seal/signature is included.
pub enum Seal {
/// The seal/signature is included.
With,
/// The seal/signature is not included.
Without,
}
/// A block header.
///
/// Reflects the specific RLP fields of a block in the chain with additional room for the seal
@ -109,7 +114,7 @@ impl Default for Header {
state_root: KECCAK_NULL_RLP,
receipts_root: KECCAK_NULL_RLP,
log_bloom: ZERO_LOGBLOOM.clone(),
log_bloom: Bloom::default(),
gas_used: U256::default(),
gas_limit: U256::default(),

View File

@ -152,7 +152,6 @@ pub mod views;
mod cache_manager;
mod blooms;
mod basic_types;
mod pod_account;
mod state_db;
mod account_db;

View File

@ -135,6 +135,7 @@ impl AbridgedBlock {
mod tests {
use views::BlockView;
use block::Block;
use header::Seal;
use super::AbridgedBlock;
use transaction::{Action, Transaction};
@ -142,7 +143,7 @@ mod tests {
use bytes::Bytes;
fn encode_block(b: &Block) -> Bytes {
b.rlp_bytes(::basic_types::Seal::With)
b.rlp_bytes(Seal::With)
}
#[test]

View File

@ -28,7 +28,7 @@ use blockchain::{BlockChain, BlockProvider};
use engines::{EthEngine, EpochVerifier, EpochTransition};
use machine::EthereumMachine;
use ids::BlockId;
use header::Header;
use header::{Header, Seal};
use receipt::Receipt;
use snapshot::{Error, ManifestData};
@ -324,7 +324,7 @@ impl Rebuilder for ChunkRebuilder {
transactions: last_rlp.list_at(1)?,
uncles: last_rlp.list_at(2)?,
};
let block_data = block.rlp_bytes(::basic_types::Seal::With);
let block_data = block.rlp_bytes(Seal::With);
let receipts: Vec<Receipt> = last_rlp.list_at(3)?;
{

View File

@ -220,7 +220,7 @@ impl Rebuilder for PowRebuilder {
/// Feed the rebuilder an uncompressed block chunk.
/// Returns the number of blocks fed or any errors.
fn feed(&mut self, chunk: &[u8], engine: &EthEngine, abort_flag: &AtomicBool) -> Result<(), ::error::Error> {
use basic_types::Seal::With;
use header::Seal;
use views::BlockView;
use snapshot::verify_old_block;
use ethereum_types::U256;
@ -253,7 +253,7 @@ impl Rebuilder for PowRebuilder {
);
let block = abridged_block.to_block(parent_hash, cur_number, receipts_root)?;
let block_bytes = block.rlp_bytes(With);
let block_bytes = block.rlp_bytes(Seal::With);
let is_best = cur_number == self.best_number;
if is_best {