Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit 3a7bbc6

Browse files
committed
Merge branch 'master' into v0.2
2 parents 029d553 + e36f1e5 commit 3a7bbc6

33 files changed

+1247
-760
lines changed

Cargo.lock

Lines changed: 57 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,17 @@ path = "polkadot/src/main.rs"
66
name = "polkadot"
77
version = "0.2.0"
88
authors = ["Parity Technologies <[email protected]>"]
9+
build = "build.rs"
910

1011
[dependencies]
1112
error-chain = "0.12"
1213
polkadot-cli = { path = "polkadot/cli" }
1314
futures = "0.1"
1415
ctrlc = { git = "https://github.com/paritytech/rust-ctrlc.git" }
1516

17+
[build-dependencies]
18+
vergen = "0.1"
19+
1620
[workspace]
1721
members = [
1822
"polkadot/api",
@@ -29,6 +33,7 @@ members = [
2933
"polkadot/service",
3034

3135
"substrate/bft",
36+
"substrate/cli",
3237
"substrate/client",
3338
"substrate/client/db",
3439
"substrate/codec",

build.rs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
2+
// This file is part of Polkadot.
3+
4+
// Polkadot is free software: you can redistribute it and/or modify
5+
// it under the terms of the GNU General Public License as published by
6+
// the Free Software Foundation, either version 3 of the License, or
7+
// (at your option) any later version.
8+
9+
// Polkadot is distributed in the hope that it will be useful,
10+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
// GNU General Public License for more details.
13+
14+
// You should have received a copy of the GNU General Public License
15+
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
16+
17+
extern crate vergen;
18+
19+
use vergen::{vergen, OutputFns};
20+
21+
const ERROR_MSG: &'static str = "Failed to generate metadata files";
22+
23+
fn main() {
24+
vergen(OutputFns::all()).expect(ERROR_MSG);
25+
}

polkadot/cli/Cargo.toml

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,18 @@ name = "polkadot-cli"
33
version = "0.2.0"
44
authors = ["Parity Technologies <[email protected]>"]
55
description = "Polkadot node implementation in Rust."
6-
build = "build.rs"
76

87
[dependencies]
98
clap = { version = "~2.32", features = ["yaml"] }
10-
backtrace = "0.3"
11-
env_logger = "0.4"
129
error-chain = "0.12"
1310
log = "0.3"
14-
atty = "0.2"
15-
regex = "1"
16-
time = "0.1"
1711
slog = "^2"
18-
ansi_term = "0.10"
1912
lazy_static = "1.0"
20-
triehash = "0.1"
21-
ed25519 = { path = "../../substrate/ed25519" }
22-
app_dirs = "1.2"
2313
tokio = "0.1.7"
2414
futures = "0.1.17"
25-
fdlimit = "0.1"
2615
parking_lot = "0.4"
27-
serde_json = "1.0"
28-
serde = "1.0"
2916
exit-future = "0.1"
17+
substrate-cli = { path = "../../substrate/cli" }
3018
substrate-client = { path = "../../substrate/client" }
3119
substrate-codec = { path = "../../substrate/codec" }
3220
substrate-extrinsic-pool = { path = "../../substrate/extrinsic-pool" }
@@ -42,7 +30,4 @@ polkadot-primitives = { path = "../primitives" }
4230
polkadot-runtime = { path = "../runtime" }
4331
polkadot-service = { path = "../service" }
4432
polkadot-transaction-pool = { path = "../transaction-pool" }
45-
names = "0.11.0"
4633

47-
[build-dependencies]
48-
clap = "~2.32"

polkadot/cli/doc/shell-completion.adoc

Lines changed: 0 additions & 41 deletions
This file was deleted.

polkadot/cli/src/chain_spec.rs

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
//! Predefined chains.
1818
1919
use service;
20-
use std::path::PathBuf;
2120

2221
/// The chain specification (this should eventually be replaced by a more general JSON-based chain
2322
/// specification).
@@ -31,8 +30,6 @@ pub enum ChainSpec {
3130
KrummeLanke,
3231
/// Whatever the current runtime is with the "global testnet" defaults.
3332
StagingTestnet,
34-
/// Custom Genesis file.
35-
Custom(String),
3633
}
3734

3835
/// Get a chain config from a spec setting.
@@ -43,32 +40,18 @@ impl ChainSpec {
4340
ChainSpec::Development => service::chain_spec::development_config(),
4441
ChainSpec::LocalTestnet => service::chain_spec::local_testnet_config(),
4542
ChainSpec::StagingTestnet => service::chain_spec::staging_testnet_config(),
46-
ChainSpec::Custom(f) => service::ChainSpec::from_json_file(PathBuf::from(f))?,
4743
})
4844
}
49-
}
5045

51-
impl<'a> From<&'a str> for ChainSpec {
52-
fn from(s: &'a str) -> Self {
46+
pub(crate) fn from(s: &str) -> Option<Self> {
5347
match s {
54-
"dev" => ChainSpec::Development,
55-
"local" => ChainSpec::LocalTestnet,
56-
"poc-1" => ChainSpec::KrummeLanke,
57-
"krummelanke" => ChainSpec::KrummeLanke,
58-
"staging" => ChainSpec::StagingTestnet,
59-
s => ChainSpec::Custom(s.into()),
48+
"dev" => Some(ChainSpec::Development),
49+
"local" => Some(ChainSpec::LocalTestnet),
50+
"poc-1" => Some(ChainSpec::KrummeLanke),
51+
"" | "krummelanke" => Some(ChainSpec::KrummeLanke),
52+
"staging" => Some(ChainSpec::StagingTestnet),
53+
_ => None,
6054
}
6155
}
6256
}
6357

64-
impl From<ChainSpec> for String {
65-
fn from(s: ChainSpec) -> String {
66-
match s {
67-
ChainSpec::Development => "dev".into(),
68-
ChainSpec::LocalTestnet => "local".into(),
69-
ChainSpec::KrummeLanke => "krummelanke".into(),
70-
ChainSpec::StagingTestnet => "staging".into(),
71-
ChainSpec::Custom(f) => format!("custom ({})", f),
72-
}
73-
}
74-
}

0 commit comments

Comments
 (0)