Merge pull request #4004 from ethcore/testnet-flag-ropsten
parse testnet chain as ropsten
This commit is contained in:
commit
9db3f383e3
@ -27,7 +27,7 @@ use user_defaults::UserDefaults;
|
|||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum SpecType {
|
pub enum SpecType {
|
||||||
Mainnet,
|
Mainnet,
|
||||||
Testnet,
|
Morden,
|
||||||
Ropsten,
|
Ropsten,
|
||||||
Olympic,
|
Olympic,
|
||||||
Classic,
|
Classic,
|
||||||
@ -49,8 +49,8 @@ impl str::FromStr for SpecType {
|
|||||||
let spec = match s {
|
let spec = match s {
|
||||||
"frontier" | "homestead" | "mainnet" => SpecType::Mainnet,
|
"frontier" | "homestead" | "mainnet" => SpecType::Mainnet,
|
||||||
"frontier-dogmatic" | "homestead-dogmatic" | "classic" => SpecType::Classic,
|
"frontier-dogmatic" | "homestead-dogmatic" | "classic" => SpecType::Classic,
|
||||||
"morden" | "testnet" | "classic-testnet" => SpecType::Testnet,
|
"morden" | "classic-testnet" => SpecType::Morden,
|
||||||
"ropsten" => SpecType::Ropsten,
|
"ropsten" | "testnet" => SpecType::Ropsten,
|
||||||
"olympic" => SpecType::Olympic,
|
"olympic" => SpecType::Olympic,
|
||||||
"expanse" => SpecType::Expanse,
|
"expanse" => SpecType::Expanse,
|
||||||
"dev" => SpecType::Dev,
|
"dev" => SpecType::Dev,
|
||||||
@ -64,7 +64,7 @@ impl SpecType {
|
|||||||
pub fn spec(&self) -> Result<Spec, String> {
|
pub fn spec(&self) -> Result<Spec, String> {
|
||||||
match *self {
|
match *self {
|
||||||
SpecType::Mainnet => Ok(ethereum::new_frontier()),
|
SpecType::Mainnet => Ok(ethereum::new_frontier()),
|
||||||
SpecType::Testnet => Ok(ethereum::new_morden()),
|
SpecType::Morden => Ok(ethereum::new_morden()),
|
||||||
SpecType::Ropsten => Ok(ethereum::new_ropsten()),
|
SpecType::Ropsten => Ok(ethereum::new_ropsten()),
|
||||||
SpecType::Olympic => Ok(ethereum::new_olympic()),
|
SpecType::Olympic => Ok(ethereum::new_olympic()),
|
||||||
SpecType::Classic => Ok(ethereum::new_classic()),
|
SpecType::Classic => Ok(ethereum::new_classic()),
|
||||||
@ -292,12 +292,12 @@ mod tests {
|
|||||||
assert_eq!(SpecType::Mainnet, "frontier".parse().unwrap());
|
assert_eq!(SpecType::Mainnet, "frontier".parse().unwrap());
|
||||||
assert_eq!(SpecType::Mainnet, "homestead".parse().unwrap());
|
assert_eq!(SpecType::Mainnet, "homestead".parse().unwrap());
|
||||||
assert_eq!(SpecType::Mainnet, "mainnet".parse().unwrap());
|
assert_eq!(SpecType::Mainnet, "mainnet".parse().unwrap());
|
||||||
assert_eq!(SpecType::Testnet, "testnet".parse().unwrap());
|
assert_eq!(SpecType::Ropsten, "testnet".parse().unwrap());
|
||||||
assert_eq!(SpecType::Testnet, "morden".parse().unwrap());
|
assert_eq!(SpecType::Morden, "morden".parse().unwrap());
|
||||||
assert_eq!(SpecType::Ropsten, "ropsten".parse().unwrap());
|
assert_eq!(SpecType::Ropsten, "ropsten".parse().unwrap());
|
||||||
assert_eq!(SpecType::Olympic, "olympic".parse().unwrap());
|
assert_eq!(SpecType::Olympic, "olympic".parse().unwrap());
|
||||||
assert_eq!(SpecType::Classic, "classic".parse().unwrap());
|
assert_eq!(SpecType::Classic, "classic".parse().unwrap());
|
||||||
assert_eq!(SpecType::Testnet, "classic-testnet".parse().unwrap());
|
assert_eq!(SpecType::Morden, "classic-testnet".parse().unwrap());
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
Loading…
Reference in New Issue
Block a user