removed redundant ethcore/basic_types.rs (#7584)
This commit is contained in:
parent
534692cdae
commit
36ba004c29
@ -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,
|
|
||||||
}
|
|
@ -27,12 +27,11 @@ use ethereum_types::{H256, U256, Address, Bloom};
|
|||||||
use bytes::Bytes;
|
use bytes::Bytes;
|
||||||
use unexpected::{Mismatch, OutOfBounds};
|
use unexpected::{Mismatch, OutOfBounds};
|
||||||
|
|
||||||
use basic_types::Seal;
|
|
||||||
use vm::{EnvInfo, LastHashes};
|
use vm::{EnvInfo, LastHashes};
|
||||||
use engines::EthEngine;
|
use engines::EthEngine;
|
||||||
use error::{Error, BlockError};
|
use error::{Error, BlockError};
|
||||||
use factory::Factories;
|
use factory::Factories;
|
||||||
use header::Header;
|
use header::{Header, Seal};
|
||||||
use receipt::{Receipt, TransactionOutcome};
|
use receipt::{Receipt, TransactionOutcome};
|
||||||
use state::State;
|
use state::State;
|
||||||
use state_db::StateDB;
|
use state_db::StateDB;
|
||||||
|
@ -33,7 +33,6 @@ use kvdb::{DBValue, KeyValueDB, DBTransaction};
|
|||||||
|
|
||||||
// other
|
// other
|
||||||
use ethereum_types::{H256, Address, U256};
|
use ethereum_types::{H256, Address, U256};
|
||||||
use basic_types::Seal;
|
|
||||||
use block::*;
|
use block::*;
|
||||||
use blockchain::{BlockChain, BlockProvider, TreeRoute, ImportRoute};
|
use blockchain::{BlockChain, BlockProvider, TreeRoute, ImportRoute};
|
||||||
use blockchain::extras::TransactionAddress;
|
use blockchain::extras::TransactionAddress;
|
||||||
@ -52,7 +51,7 @@ use evm::{Factory as EvmFactory, Schedule};
|
|||||||
use executive::{Executive, Executed, TransactOptions, contract_address};
|
use executive::{Executive, Executed, TransactOptions, contract_address};
|
||||||
use factory::Factories;
|
use factory::Factories;
|
||||||
use futures::{future, Future};
|
use futures::{future, Future};
|
||||||
use header::{BlockNumber, Header};
|
use header::{BlockNumber, Header, Seal};
|
||||||
use io::*;
|
use io::*;
|
||||||
use log_entry::LocalizedLogEntry;
|
use log_entry::LocalizedLogEntry;
|
||||||
use miner::{Miner, MinerService};
|
use miner::{Miner, MinerService};
|
||||||
|
@ -22,14 +22,19 @@ use hash::{KECCAK_NULL_RLP, KECCAK_EMPTY_LIST_RLP, keccak};
|
|||||||
use heapsize::HeapSizeOf;
|
use heapsize::HeapSizeOf;
|
||||||
use ethereum_types::{H256, U256, Address, Bloom};
|
use ethereum_types::{H256, U256, Address, Bloom};
|
||||||
use bytes::Bytes;
|
use bytes::Bytes;
|
||||||
use basic_types::{ZERO_LOGBLOOM};
|
|
||||||
use time::get_time;
|
use time::get_time;
|
||||||
use rlp::*;
|
use rlp::*;
|
||||||
|
|
||||||
pub use basic_types::Seal;
|
|
||||||
|
|
||||||
pub use types::BlockNumber;
|
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.
|
/// A block header.
|
||||||
///
|
///
|
||||||
/// Reflects the specific RLP fields of a block in the chain with additional room for the seal
|
/// 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,
|
state_root: KECCAK_NULL_RLP,
|
||||||
receipts_root: KECCAK_NULL_RLP,
|
receipts_root: KECCAK_NULL_RLP,
|
||||||
log_bloom: ZERO_LOGBLOOM.clone(),
|
log_bloom: Bloom::default(),
|
||||||
gas_used: U256::default(),
|
gas_used: U256::default(),
|
||||||
gas_limit: U256::default(),
|
gas_limit: U256::default(),
|
||||||
|
|
||||||
|
@ -152,7 +152,6 @@ pub mod views;
|
|||||||
|
|
||||||
mod cache_manager;
|
mod cache_manager;
|
||||||
mod blooms;
|
mod blooms;
|
||||||
mod basic_types;
|
|
||||||
mod pod_account;
|
mod pod_account;
|
||||||
mod state_db;
|
mod state_db;
|
||||||
mod account_db;
|
mod account_db;
|
||||||
|
@ -135,6 +135,7 @@ impl AbridgedBlock {
|
|||||||
mod tests {
|
mod tests {
|
||||||
use views::BlockView;
|
use views::BlockView;
|
||||||
use block::Block;
|
use block::Block;
|
||||||
|
use header::Seal;
|
||||||
use super::AbridgedBlock;
|
use super::AbridgedBlock;
|
||||||
use transaction::{Action, Transaction};
|
use transaction::{Action, Transaction};
|
||||||
|
|
||||||
@ -142,7 +143,7 @@ mod tests {
|
|||||||
use bytes::Bytes;
|
use bytes::Bytes;
|
||||||
|
|
||||||
fn encode_block(b: &Block) -> Bytes {
|
fn encode_block(b: &Block) -> Bytes {
|
||||||
b.rlp_bytes(::basic_types::Seal::With)
|
b.rlp_bytes(Seal::With)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
@ -28,7 +28,7 @@ use blockchain::{BlockChain, BlockProvider};
|
|||||||
use engines::{EthEngine, EpochVerifier, EpochTransition};
|
use engines::{EthEngine, EpochVerifier, EpochTransition};
|
||||||
use machine::EthereumMachine;
|
use machine::EthereumMachine;
|
||||||
use ids::BlockId;
|
use ids::BlockId;
|
||||||
use header::Header;
|
use header::{Header, Seal};
|
||||||
use receipt::Receipt;
|
use receipt::Receipt;
|
||||||
use snapshot::{Error, ManifestData};
|
use snapshot::{Error, ManifestData};
|
||||||
|
|
||||||
@ -324,7 +324,7 @@ impl Rebuilder for ChunkRebuilder {
|
|||||||
transactions: last_rlp.list_at(1)?,
|
transactions: last_rlp.list_at(1)?,
|
||||||
uncles: last_rlp.list_at(2)?,
|
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)?;
|
let receipts: Vec<Receipt> = last_rlp.list_at(3)?;
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -220,7 +220,7 @@ impl Rebuilder for PowRebuilder {
|
|||||||
/// Feed the rebuilder an uncompressed block chunk.
|
/// Feed the rebuilder an uncompressed block chunk.
|
||||||
/// Returns the number of blocks fed or any errors.
|
/// Returns the number of blocks fed or any errors.
|
||||||
fn feed(&mut self, chunk: &[u8], engine: &EthEngine, abort_flag: &AtomicBool) -> Result<(), ::error::Error> {
|
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 views::BlockView;
|
||||||
use snapshot::verify_old_block;
|
use snapshot::verify_old_block;
|
||||||
use ethereum_types::U256;
|
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 = 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;
|
let is_best = cur_number == self.best_number;
|
||||||
|
|
||||||
if is_best {
|
if is_best {
|
||||||
|
Loading…
Reference in New Issue
Block a user