ethcore/res: remove morden testnet (#11392)
* ethcore/res: remove morden testnet * ethcore: replace morden by ropsten and null_morden * json/spec: rename morden test to null morden * parity/{cli,params}: remove morden testnet * ethcore/engines: fix tests * ethcore/engines: fix test * ethcore/tests: remove `0x` prefix from registrar Co-Authored-By: Andronik Ordian <write@reusable.software> * ethcore/chain: fix tests for ropsten Co-authored-by: Andronik Ordian <write@reusable.software>
This commit is contained in:
parent
1113682555
commit
c7c18d067d
@ -505,14 +505,14 @@ mod tests {
|
|||||||
test_helpers::get_temp_state_db,
|
test_helpers::get_temp_state_db,
|
||||||
};
|
};
|
||||||
use rlp;
|
use rlp;
|
||||||
use spec::{new_morden, new_mcip3_test, new_homestead_test_machine, Spec};
|
use spec::{new_ropsten, new_mcip3_test, new_homestead_test_machine, Spec};
|
||||||
use tempdir::TempDir;
|
use tempdir::TempDir;
|
||||||
|
|
||||||
use super::{Ethash, EthashParams, ecip1017_eras_block_reward};
|
use super::{Ethash, EthashParams, ecip1017_eras_block_reward};
|
||||||
|
|
||||||
fn test_spec() -> Spec {
|
fn test_spec() -> Spec {
|
||||||
let tempdir = TempDir::new("").unwrap();
|
let tempdir = TempDir::new("").unwrap();
|
||||||
new_morden(&tempdir.path())
|
new_ropsten(&tempdir.path())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_default_ethash_params() -> EthashParams {
|
fn get_default_ethash_params() -> EthashParams {
|
||||||
@ -553,7 +553,7 @@ mod tests {
|
|||||||
let last_hashes = Arc::new(vec![genesis_header.hash()]);
|
let last_hashes = Arc::new(vec![genesis_header.hash()]);
|
||||||
let b = OpenBlock::new(engine, Default::default(), false, db, &genesis_header, last_hashes, Address::zero(), (3141562.into(), 31415620.into()), vec![], false).unwrap();
|
let b = OpenBlock::new(engine, Default::default(), false, db, &genesis_header, last_hashes, Address::zero(), (3141562.into(), 31415620.into()), vec![], false).unwrap();
|
||||||
let b = b.close().unwrap();
|
let b = b.close().unwrap();
|
||||||
assert_eq!(b.state.balance(&Address::zero()).unwrap(), U256::from_str("4563918244f40000").unwrap());
|
assert_eq!(b.state.balance(&Address::zero()).unwrap(), U256::from_str("4563918244f40001").unwrap());
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@ -607,7 +607,7 @@ mod tests {
|
|||||||
b.push_uncle(uncle).unwrap();
|
b.push_uncle(uncle).unwrap();
|
||||||
|
|
||||||
let b = b.close().unwrap();
|
let b = b.close().unwrap();
|
||||||
assert_eq!(b.state.balance(&Address::zero()).unwrap(), "478eae0e571ba000".into());
|
assert_eq!(b.state.balance(&Address::zero()).unwrap(), "478eae0e571ba001".into());
|
||||||
assert_eq!(b.state.balance(&uncle_author).unwrap(), "3cb71f51fc558000".into());
|
assert_eq!(b.state.balance(&uncle_author).unwrap(), "3cb71f51fc558000".into());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -641,7 +641,7 @@ mod tests {
|
|||||||
assert!(schedule.stack_limit > 0);
|
assert!(schedule.stack_limit > 0);
|
||||||
|
|
||||||
let schedule = engine.schedule(100);
|
let schedule = engine.schedule(100);
|
||||||
assert!(!schedule.have_delegate_call);
|
assert!(schedule.have_delegate_call);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "Morden",
|
"name": "Null Morden",
|
||||||
|
"dataDir": "null_morden",
|
||||||
"engine": {
|
"engine": {
|
||||||
"null": {
|
"null": {
|
||||||
"params": {}
|
"params": {}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "Morden",
|
"name": "Null Morden with Finality",
|
||||||
|
"dataDir": "null_finality",
|
||||||
"engine": {
|
"engine": {
|
||||||
"null": {
|
"null": {
|
||||||
"params": {
|
"params": {
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "Morden",
|
"name": "Null Morden with Reward",
|
||||||
|
"dataDir": "null_reward",
|
||||||
"engine": {
|
"engine": {
|
||||||
"null": {
|
"null": {
|
||||||
"params": {
|
"params": {
|
||||||
|
@ -70,7 +70,6 @@ bundle_release_spec! {
|
|||||||
"ethereum/kotti" => new_kotti,
|
"ethereum/kotti" => new_kotti,
|
||||||
"ethereum/kovan" => new_kovan,
|
"ethereum/kovan" => new_kovan,
|
||||||
"ethereum/mix" => new_mix,
|
"ethereum/mix" => new_mix,
|
||||||
"ethereum/morden" => new_morden,
|
|
||||||
"ethereum/mordor" => new_mordor,
|
"ethereum/mordor" => new_mordor,
|
||||||
"ethereum/musicoin" => new_musicoin,
|
"ethereum/musicoin" => new_musicoin,
|
||||||
"ethereum/poacore" => new_poanet,
|
"ethereum/poacore" => new_poanet,
|
||||||
@ -100,7 +99,6 @@ bundle_test_spec! {
|
|||||||
"ethereum/homestead_test" => new_homestead_test,
|
"ethereum/homestead_test" => new_homestead_test,
|
||||||
"ethereum/kovan_wasm_test" => new_kovan_wasm_test,
|
"ethereum/kovan_wasm_test" => new_kovan_wasm_test,
|
||||||
"ethereum/mcip3_test" => new_mcip3_test,
|
"ethereum/mcip3_test" => new_mcip3_test,
|
||||||
"ethereum/morden" => new_morden_test,
|
|
||||||
"ethereum/mordor" => new_mordor_test,
|
"ethereum/mordor" => new_mordor_test,
|
||||||
"ethereum/ropsten" => new_ropsten_test,
|
"ethereum/ropsten" => new_ropsten_test,
|
||||||
"ethereum/st_peters_test" => new_constantinople_fix_test,
|
"ethereum/st_peters_test" => new_constantinople_fix_test,
|
||||||
@ -134,12 +132,12 @@ mod tests {
|
|||||||
use tempdir::TempDir;
|
use tempdir::TempDir;
|
||||||
use ethcore::test_helpers::get_temp_state_db;
|
use ethcore::test_helpers::get_temp_state_db;
|
||||||
|
|
||||||
use super::{new_morden, new_foundation};
|
use super::{new_ropsten, new_foundation};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn ensure_db_good() {
|
fn ensure_db_good() {
|
||||||
let tempdir = TempDir::new("").unwrap();
|
let tempdir = TempDir::new("").unwrap();
|
||||||
let spec = new_morden(&tempdir.path());
|
let spec = new_ropsten(&tempdir.path());
|
||||||
let engine = &spec.engine;
|
let engine = &spec.engine;
|
||||||
let genesis_header = spec.genesis_header();
|
let genesis_header = spec.genesis_header();
|
||||||
let db = spec.ensure_db_good(get_temp_state_db(), &Default::default()).unwrap();
|
let db = spec.ensure_db_good(get_temp_state_db(), &Default::default()).unwrap();
|
||||||
@ -148,18 +146,18 @@ mod tests {
|
|||||||
assert_eq!(s.balance(&"0000000000000000000000000000000000000002".parse().unwrap()).unwrap(), 1u64.into());
|
assert_eq!(s.balance(&"0000000000000000000000000000000000000002".parse().unwrap()).unwrap(), 1u64.into());
|
||||||
assert_eq!(s.balance(&"0000000000000000000000000000000000000003".parse().unwrap()).unwrap(), 1u64.into());
|
assert_eq!(s.balance(&"0000000000000000000000000000000000000003".parse().unwrap()).unwrap(), 1u64.into());
|
||||||
assert_eq!(s.balance(&"0000000000000000000000000000000000000004".parse().unwrap()).unwrap(), 1u64.into());
|
assert_eq!(s.balance(&"0000000000000000000000000000000000000004".parse().unwrap()).unwrap(), 1u64.into());
|
||||||
assert_eq!(s.balance(&"102e61f5d8f9bc71d0ad4a084df4e65e05ce0e1c".parse().unwrap()).unwrap(), U256::from(1u64) << 200);
|
assert_eq!(s.balance(&"874b54a8bd152966d63f706bae1ffeb0411921e5".parse().unwrap()).unwrap(), U256::from(1000000000000000000000000000000u128));
|
||||||
assert_eq!(s.balance(&"0000000000000000000000000000000000000000".parse().unwrap()).unwrap(), 0u64.into());
|
assert_eq!(s.balance(&"0000000000000000000000000000000000000000".parse().unwrap()).unwrap(), 1u64.into());
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn morden() {
|
fn ropsten() {
|
||||||
let tempdir = TempDir::new("").unwrap();
|
let tempdir = TempDir::new("").unwrap();
|
||||||
let morden = new_morden(&tempdir.path());
|
let ropsten = new_ropsten(&tempdir.path());
|
||||||
|
|
||||||
assert_eq!(morden.state_root, "f3f4696bbf3b3b07775128eb7a3763279a394e382130f27c21e70233e04946a9".parse().unwrap());
|
assert_eq!(ropsten.state_root, "217b0bbcfb72e2d57e28f33cb361b9983513177755dc3f33ce3e7022ed62b77b".parse().unwrap());
|
||||||
let genesis = morden.genesis_block();
|
let genesis = ropsten.genesis_block();
|
||||||
assert_eq!(view!(BlockView, &genesis).header_view().hash(), "0cd786a2425d16f152c658316c423e6ce1181e15c3295826d7c9904cba9ce303".parse().unwrap());
|
assert_eq!(view!(BlockView, &genesis).header_view().hash(), "41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d".parse().unwrap());
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
@ -70,7 +70,7 @@ fn imports_from_empty() {
|
|||||||
fn should_return_registrar() {
|
fn should_return_registrar() {
|
||||||
let db = test_helpers::new_db();
|
let db = test_helpers::new_db();
|
||||||
let tempdir = TempDir::new("").unwrap();
|
let tempdir = TempDir::new("").unwrap();
|
||||||
let spec = spec::new_morden(&tempdir.path().to_owned());
|
let spec = spec::new_ropsten(&tempdir.path().to_owned());
|
||||||
|
|
||||||
let client = Client::new(
|
let client = Client::new(
|
||||||
ClientConfig::default(),
|
ClientConfig::default(),
|
||||||
@ -80,7 +80,7 @@ fn should_return_registrar() {
|
|||||||
IoChannel::disconnected(),
|
IoChannel::disconnected(),
|
||||||
).unwrap();
|
).unwrap();
|
||||||
let address = client.registrar_address();
|
let address = client.registrar_address();
|
||||||
assert_eq!(address, Some("52dff57a8a1532e6afb3dc07e2af58bb9eb05b3d".parse().unwrap()));
|
assert_eq!(address, Some("81a4b044831c4f12ba601adb9274516939e9b8a2".parse().unwrap()));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
@ -546,7 +546,7 @@ mod tests {
|
|||||||
fn test_verify_block() {
|
fn test_verify_block() {
|
||||||
use rlp::RlpStream;
|
use rlp::RlpStream;
|
||||||
|
|
||||||
// Test against morden
|
// Test against null_morden
|
||||||
let mut good = Header::new();
|
let mut good = Header::new();
|
||||||
let spec = spec::new_test();
|
let spec = spec::new_test();
|
||||||
let engine = &*spec.engine;
|
let engine = &*spec.engine;
|
||||||
|
@ -87,7 +87,7 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn should_error_on_unknown_fields() {
|
fn should_error_on_unknown_fields() {
|
||||||
let s = r#"{
|
let s = r#"{
|
||||||
"name": "Morden",
|
"name": "Null Morden",
|
||||||
"dataDir": "morden",
|
"dataDir": "morden",
|
||||||
"engine": {
|
"engine": {
|
||||||
"Ethash": {
|
"Ethash": {
|
||||||
@ -152,7 +152,7 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn spec_deserialization() {
|
fn spec_deserialization() {
|
||||||
let s = r#"{
|
let s = r#"{
|
||||||
"name": "Morden",
|
"name": "Null Morden",
|
||||||
"dataDir": "morden",
|
"dataDir": "morden",
|
||||||
"engine": {
|
"engine": {
|
||||||
"Ethash": {
|
"Ethash": {
|
||||||
|
@ -81,7 +81,7 @@ mod accounts {
|
|||||||
let account_settings = AccountProviderSettings {
|
let account_settings = AccountProviderSettings {
|
||||||
unlock_keep_secret: cfg.enable_fast_unlock,
|
unlock_keep_secret: cfg.enable_fast_unlock,
|
||||||
blacklisted_accounts: match *spec {
|
blacklisted_accounts: match *spec {
|
||||||
SpecType::Morden | SpecType::Mordor | SpecType::Ropsten | SpecType::Kovan | SpecType::Goerli | SpecType::Kotti | SpecType::Sokol | SpecType::Dev => vec![],
|
SpecType::Mordor | SpecType::Ropsten | SpecType::Kovan | SpecType::Goerli | SpecType::Kotti | SpecType::Sokol | SpecType::Dev => vec![],
|
||||||
_ => vec![
|
_ => vec![
|
||||||
H160::from_str("00a329c0648769a73afac7f9381e08fb43dbea72").expect("the string is valid hex; qed"),
|
H160::from_str("00a329c0648769a73afac7f9381e08fb43dbea72").expect("the string is valid hex; qed"),
|
||||||
],
|
],
|
||||||
|
@ -300,7 +300,7 @@ usage! {
|
|||||||
|
|
||||||
ARG arg_chain: (String) = "foundation", or |c: &Config| c.parity.as_ref()?.chain.clone(),
|
ARG arg_chain: (String) = "foundation", or |c: &Config| c.parity.as_ref()?.chain.clone(),
|
||||||
"--chain=[CHAIN]",
|
"--chain=[CHAIN]",
|
||||||
"Specify the blockchain type. CHAIN may be either a JSON chain specification file or ethereum, classic, poacore, xdai, volta, ewc, musicoin, ellaism, mix, callisto, ethercore, morden, mordor, ropsten, kovan, rinkeby, goerli, kotti, poasokol, testnet, evantestcore, evancore or dev.",
|
"Specify the blockchain type. CHAIN may be either a JSON chain specification file or ethereum, classic, poacore, xdai, volta, ewc, musicoin, ellaism, mix, callisto, ethercore, mordor, ropsten, kovan, rinkeby, goerli, kotti, poasokol, testnet, evantestcore, evancore or dev.",
|
||||||
|
|
||||||
ARG arg_keys_path: (String) = "$BASE/keys", or |c: &Config| c.parity.as_ref()?.keys_path.clone(),
|
ARG arg_keys_path: (String) = "$BASE/keys", or |c: &Config| c.parity.as_ref()?.keys_path.clone(),
|
||||||
"--keys-path=[PATH]",
|
"--keys-path=[PATH]",
|
||||||
|
@ -44,7 +44,6 @@ pub enum SpecType {
|
|||||||
Mix,
|
Mix,
|
||||||
Callisto,
|
Callisto,
|
||||||
EtherCore,
|
EtherCore,
|
||||||
Morden,
|
|
||||||
Mordor,
|
Mordor,
|
||||||
Ropsten,
|
Ropsten,
|
||||||
Kovan,
|
Kovan,
|
||||||
@ -80,7 +79,6 @@ impl str::FromStr for SpecType {
|
|||||||
"mix" => SpecType::Mix,
|
"mix" => SpecType::Mix,
|
||||||
"callisto" => SpecType::Callisto,
|
"callisto" => SpecType::Callisto,
|
||||||
"ethercore" => SpecType::EtherCore,
|
"ethercore" => SpecType::EtherCore,
|
||||||
"morden" => SpecType::Morden,
|
|
||||||
"mordor" | "classic-testnet" => SpecType::Mordor,
|
"mordor" | "classic-testnet" => SpecType::Mordor,
|
||||||
"ropsten" => SpecType::Ropsten,
|
"ropsten" => SpecType::Ropsten,
|
||||||
"kovan" => SpecType::Kovan,
|
"kovan" => SpecType::Kovan,
|
||||||
@ -111,7 +109,6 @@ impl fmt::Display for SpecType {
|
|||||||
SpecType::Mix => "mix",
|
SpecType::Mix => "mix",
|
||||||
SpecType::Callisto => "callisto",
|
SpecType::Callisto => "callisto",
|
||||||
SpecType::EtherCore => "ethercore",
|
SpecType::EtherCore => "ethercore",
|
||||||
SpecType::Morden => "morden",
|
|
||||||
SpecType::Mordor => "mordor",
|
SpecType::Mordor => "mordor",
|
||||||
SpecType::Ropsten => "ropsten",
|
SpecType::Ropsten => "ropsten",
|
||||||
SpecType::Kovan => "kovan",
|
SpecType::Kovan => "kovan",
|
||||||
@ -142,7 +139,6 @@ impl SpecType {
|
|||||||
SpecType::Mix => Ok(spec::new_mix(params)),
|
SpecType::Mix => Ok(spec::new_mix(params)),
|
||||||
SpecType::Callisto => Ok(spec::new_callisto(params)),
|
SpecType::Callisto => Ok(spec::new_callisto(params)),
|
||||||
SpecType::EtherCore => Ok(spec::new_ethercore(params)),
|
SpecType::EtherCore => Ok(spec::new_ethercore(params)),
|
||||||
SpecType::Morden => Ok(spec::new_morden(params)),
|
|
||||||
SpecType::Mordor => Ok(spec::new_mordor(params)),
|
SpecType::Mordor => Ok(spec::new_mordor(params)),
|
||||||
SpecType::Ropsten => Ok(spec::new_ropsten(params)),
|
SpecType::Ropsten => Ok(spec::new_ropsten(params)),
|
||||||
SpecType::Kovan => Ok(spec::new_kovan(params)),
|
SpecType::Kovan => Ok(spec::new_kovan(params)),
|
||||||
@ -402,7 +398,6 @@ mod tests {
|
|||||||
assert_eq!(SpecType::Mix, "mix".parse().unwrap());
|
assert_eq!(SpecType::Mix, "mix".parse().unwrap());
|
||||||
assert_eq!(SpecType::Callisto, "callisto".parse().unwrap());
|
assert_eq!(SpecType::Callisto, "callisto".parse().unwrap());
|
||||||
assert_eq!(SpecType::EtherCore, "ethercore".parse().unwrap());
|
assert_eq!(SpecType::EtherCore, "ethercore".parse().unwrap());
|
||||||
assert_eq!(SpecType::Morden, "morden".parse().unwrap());
|
|
||||||
assert_eq!(SpecType::Mordor, "mordor".parse().unwrap());
|
assert_eq!(SpecType::Mordor, "mordor".parse().unwrap());
|
||||||
assert_eq!(SpecType::Mordor, "classic-testnet".parse().unwrap());
|
assert_eq!(SpecType::Mordor, "classic-testnet".parse().unwrap());
|
||||||
assert_eq!(SpecType::Ropsten, "ropsten".parse().unwrap());
|
assert_eq!(SpecType::Ropsten, "ropsten".parse().unwrap());
|
||||||
@ -436,7 +431,6 @@ mod tests {
|
|||||||
assert_eq!(format!("{}", SpecType::Mix), "mix");
|
assert_eq!(format!("{}", SpecType::Mix), "mix");
|
||||||
assert_eq!(format!("{}", SpecType::Callisto), "callisto");
|
assert_eq!(format!("{}", SpecType::Callisto), "callisto");
|
||||||
assert_eq!(format!("{}", SpecType::EtherCore), "ethercore");
|
assert_eq!(format!("{}", SpecType::EtherCore), "ethercore");
|
||||||
assert_eq!(format!("{}", SpecType::Morden), "morden");
|
|
||||||
assert_eq!(format!("{}", SpecType::Mordor), "mordor");
|
assert_eq!(format!("{}", SpecType::Mordor), "mordor");
|
||||||
assert_eq!(format!("{}", SpecType::Ropsten), "ropsten");
|
assert_eq!(format!("{}", SpecType::Ropsten), "ropsten");
|
||||||
assert_eq!(format!("{}", SpecType::Kovan), "kovan");
|
assert_eq!(format!("{}", SpecType::Kovan), "kovan");
|
||||||
|
Loading…
Reference in New Issue
Block a user