removed redundant VMType enum with one variant (#11266)

This commit is contained in:
Marek Kotewicz
2019-11-20 11:11:36 +08:00
committed by GitHub
parent 82c3265858
commit e0091c672a
18 changed files with 29 additions and 117 deletions

View File

@@ -28,7 +28,7 @@ use bytes::ToPretty;
use rlp::PayloadInfo;
use client_traits::{BlockChainReset, Nonce, Balance, BlockChainClient, ImportExportBlocks};
use ethcore::{
client::{DatabaseCompactionProfile, VMType},
client::{DatabaseCompactionProfile},
miner::Miner,
};
use ethcore_service::ClientService;
@@ -92,7 +92,6 @@ pub struct ImportBlockchain {
pub compaction: DatabaseCompactionProfile,
pub tracing: Switch,
pub fat_db: Switch,
pub vm_type: VMType,
pub check_seal: bool,
pub with_color: bool,
pub verifier_settings: VerifierSettings,
@@ -351,7 +350,6 @@ fn execute_import(cmd: ImportBlockchain) -> Result<(), String> {
tracing,
fat_db,
cmd.compaction,
cmd.vm_type,
"".into(),
algorithm,
cmd.pruning_history,
@@ -488,7 +486,6 @@ fn start_client(
tracing,
fat_db,
compaction,
VMType::default(),
"".into(),
algorithm,
pruning_history,

View File

@@ -29,7 +29,6 @@ use bytes::Bytes;
use ansi_term::Colour;
use sync::{NetworkConfiguration, validate_node_url, self};
use parity_crypto::publickey::{Secret, Public};
use ethcore::client::VMType;
use ethcore::miner::{stratum, MinerOptions};
use snapshot::SnapshotConfiguration;
use miner::pool;
@@ -120,7 +119,6 @@ impl Configuration {
let dirs = self.directories();
let pruning = self.args.arg_pruning.parse()?;
let pruning_history = self.args.arg_pruning_history;
let vm_type = self.vm_type()?;
let spec = self.chain()?;
let mode = match self.args.arg_mode.as_ref() {
"last" => None,
@@ -259,7 +257,6 @@ impl Configuration {
compaction: compaction,
tracing: tracing,
fat_db: fat_db,
vm_type: vm_type,
check_seal: !self.args.flag_no_seal_check,
with_color: logger_config.color,
verifier_settings: self.verifier_settings(),
@@ -394,7 +391,6 @@ impl Configuration {
tracing,
fat_db,
compaction,
vm_type,
warp_sync,
warp_barrier: self.args.arg_warp_barrier,
geth_compatibility,
@@ -430,10 +426,6 @@ impl Configuration {
})
}
fn vm_type(&self) -> Result<VMType, String> {
Ok(VMType::Interpreter)
}
fn miner_extras(&self) -> Result<MinerExtras, String> {
let floor = to_u256(&self.args.arg_gas_floor_target)?;
let ceil = to_u256(&self.args.arg_gas_cap)?;
@@ -1200,7 +1192,6 @@ mod tests {
use std::str::FromStr;
use tempdir::TempDir;
use ethcore::client::VMType;
use ethcore::miner::MinerOptions;
use miner::pool::PrioritizationStrategy;
use parity_rpc::NetworkSettings;
@@ -1305,7 +1296,6 @@ mod tests {
compaction: Default::default(),
tracing: Default::default(),
fat_db: Default::default(),
vm_type: VMType::Interpreter,
check_seal: true,
with_color: !cfg!(windows),
verifier_settings: Default::default(),
@@ -1458,7 +1448,6 @@ mod tests {
mode: Default::default(),
tracing: Default::default(),
compaction: Default::default(),
vm_type: Default::default(),
geth_compatibility: false,
experimental_rpcs: false,
net_settings: Default::default(),

View File

@@ -21,7 +21,7 @@ use std::fs::File;
use std::collections::HashSet;
use ethereum_types::{U256, Address};
use journaldb::Algorithm;
use ethcore::client::{VMType, DatabaseCompactionProfile, ClientConfig};
use ethcore::client::{DatabaseCompactionProfile, ClientConfig};
use ethcore::miner::{PendingSet, Penalization};
use verification::VerifierType;
use miner::pool::PrioritizationStrategy;
@@ -232,7 +232,6 @@ pub fn to_client_config(
tracing: bool,
fat_db: bool,
compaction: DatabaseCompactionProfile,
vm_type: VMType,
name: String,
pruning: Algorithm,
pruning_history: u64,
@@ -268,7 +267,6 @@ pub fn to_client_config(
client_config.pruning = pruning;
client_config.history = pruning_history;
client_config.db_compaction = compaction;
client_config.vm_type = vm_type;
client_config.name = name;
client_config.verifier_type = if check_seal { VerifierType::Canon } else { VerifierType::CanonNoSeal };
client_config.spec_name = spec_name;

View File

@@ -21,7 +21,7 @@ use std::thread;
use ansi_term::Colour;
use client_traits::{BlockInfo, BlockChainClient};
use ethcore::client::{Client, DatabaseCompactionProfile, VMType};
use ethcore::client::{Client, DatabaseCompactionProfile};
use ethcore::miner::{self, stratum, Miner, MinerService, MinerOptions};
use snapshot::{self, SnapshotConfiguration};
use spec::SpecParams;
@@ -113,7 +113,6 @@ pub struct RunCmd {
pub tracing: Switch,
pub fat_db: Switch,
pub compaction: DatabaseCompactionProfile,
pub vm_type: VMType,
pub geth_compatibility: bool,
pub experimental_rpcs: bool,
pub net_settings: NetworkSettings,
@@ -531,7 +530,6 @@ fn execute_impl<Cr, Rr>(
tracing,
fat_db,
cmd.compaction,
cmd.vm_type,
cmd.name,
algorithm,
cmd.pruning_history,

View File

@@ -24,7 +24,7 @@ use hash::keccak;
use snapshot::{SnapshotConfiguration, SnapshotService as SS, SnapshotClient};
use snapshot::io::{SnapshotReader, PackedReader, PackedWriter};
use snapshot::service::Service as SnapshotService;
use ethcore::client::{Client, DatabaseCompactionProfile, VMType};
use ethcore::client::{Client, DatabaseCompactionProfile};
use ethcore::miner::Miner;
use ethcore_service::ClientService;
use parking_lot::RwLock;
@@ -180,7 +180,6 @@ impl SnapshotCommand {
tracing,
fat_db,
self.compaction,
VMType::default(),
"".into(),
algorithm,
self.pruning_history,