diff --git a/.gitignore b/.gitignore index 2e0651ba435d1..0a2ce91ba00ff 100644 --- a/.gitignore +++ b/.gitignore @@ -3,13 +3,13 @@ *.swp .wasm-binaries polkadot/runtime/wasm/target/ -substrate/executor/wasm/target/ -substrate/test-runtime/wasm/target/ -substrate/pwasm-alloc/target/ -substrate/pwasm-libc/target/ -substrate/pwasm-alloc/Cargo.lock -substrate/pwasm-libc/Cargo.lock -demo/runtime/wasm/target/ +core/executor/wasm/target/ +core/test-runtime/wasm/target/ +pwasm-alloc/target/ +pwasm-libc/target/ +pwasm-alloc/Cargo.lock +pwasm-libc/Cargo.lock +node/runtime/wasm/target/ **/._* .vscode polkadot.* diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f4d781880bffb..cc9e3985e62d0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -50,7 +50,6 @@ test:rust:stable: &test - ./scripts/init.sh - export PATH="${CI_PROJECT_DIR}/cargo/bin/:$PATH" - ./scripts/build.sh - - ./scripts/build-demos.sh - time cargo test --all --release tags: - rust-stable @@ -74,7 +73,6 @@ build:linux:ubuntu:amd64: &build - ./scripts/init.sh - export PATH="${CI_PROJECT_DIR}/cargo/bin/:$PATH" - ./scripts/build.sh - - ./scripts/build-demos.sh - cargo build --release <<: *collect_artifacts tags: diff --git a/CONTRIBUTING.adoc b/CONTRIBUTING.adoc index b789e03ed114c..32976ad7757be 100644 --- a/CONTRIBUTING.adoc +++ b/CONTRIBUTING.adoc @@ -18,9 +18,9 @@ There are a few basic ground-rules for contributors (including the maintainer(s) Merging pull requests once CI is successful: -. A pull request that does not alter any logic (e.g. comments, dependencies, docs) may be tagged https://github.com/paritytech/substrate/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aopen+label%3AA2-insubstantial[`insubstantial`] and merged by its author. +. A pull request that does not alter any logic (e.g. comments, dependencies, docs) may be tagged https://github.com/paritytech/core/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aopen+label%3AA2-insubstantial[`insubstantial`] and merged by its author. . A pull request with no large change to logic that is an urgent fix may be merged after a non-author contributor has reviewed it well. -. All other PRs should sit for 48 hours with the https://github.com/paritytech/substrate/pulls?q=is%3Apr+is%3Aopen+label%3AA0-pleasereview[`pleasereview`] tag in order to garner feedback. +. All other PRs should sit for 48 hours with the https://github.com/paritytech/core/pulls?q=is%3Apr+is%3Aopen+label%3AA0-pleasereview[`pleasereview`] tag in order to garner feedback. . No PR should be merged until all reviews' comments are addressed. .Reviewing pull requests: diff --git a/Cargo.lock b/Cargo.lock index 14ab7f229bb92..6d4ab0eac72c4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -402,189 +402,6 @@ dependencies = [ "tempfile 3.0.3 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "demo-api" -version = "0.1.0" -dependencies = [ - "demo-primitives 0.1.0", - "demo-runtime 0.1.0", - "substrate-client 0.1.0", - "substrate-keyring 0.1.0", - "substrate-primitives 0.1.0", -] - -[[package]] -name = "demo-cli" -version = "0.1.0" -dependencies = [ - "demo-service 0.1.0", - "exit-future 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-cli 0.3.0", - "tokio 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "demo-consensus" -version = "0.1.0" -dependencies = [ - "demo-api 0.1.0", - "demo-primitives 0.1.0", - "demo-runtime 0.1.0", - "demo-transaction-pool 0.1.0", - "ed25519 0.1.0", - "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", - "exit-future 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "rhododendron 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-bft 0.1.0", - "substrate-client 0.1.0", - "substrate-codec 0.1.0", - "substrate-keyring 0.1.0", - "substrate-primitives 0.1.0", - "substrate-runtime-primitives 0.1.0", - "substrate-runtime-support 0.1.0", - "tokio 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "demo-executor" -version = "0.1.0" -dependencies = [ - "demo-primitives 0.1.0", - "demo-runtime 0.1.0", - "ed25519 0.1.0", - "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-codec 0.1.0", - "substrate-executor 0.1.0", - "substrate-keyring 0.1.0", - "substrate-primitives 0.1.0", - "substrate-runtime-balances 0.1.0", - "substrate-runtime-consensus 0.1.0", - "substrate-runtime-io 0.1.0", - "substrate-runtime-primitives 0.1.0", - "substrate-runtime-session 0.1.0", - "substrate-runtime-staking 0.1.0", - "substrate-runtime-support 0.1.0", - "substrate-runtime-system 0.1.0", - "substrate-runtime-timestamp 0.1.0", - "substrate-runtime-treasury 0.1.0", - "substrate-state-machine 0.1.0", - "triehash 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "demo-network" -version = "0.1.0" -dependencies = [ - "demo-api 0.1.0", - "demo-consensus 0.1.0", - "demo-primitives 0.1.0", - "ed25519 0.1.0", - "futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "rhododendron 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-bft 0.1.0", - "substrate-network 0.1.0", - "tokio 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "demo-primitives" -version = "0.1.0" -dependencies = [ - "pretty_assertions 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-codec 0.1.0", - "substrate-codec-derive 0.1.0", - "substrate-primitives 0.1.0", - "substrate-runtime-primitives 0.1.0", - "substrate-runtime-std 0.1.0", - "substrate-serializer 0.1.0", -] - -[[package]] -name = "demo-runtime" -version = "0.1.0" -dependencies = [ - "demo-primitives 0.1.0", - "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-codec 0.1.0", - "substrate-codec-derive 0.1.0", - "substrate-keyring 0.1.0", - "substrate-primitives 0.1.0", - "substrate-runtime-balances 0.1.0", - "substrate-runtime-consensus 0.1.0", - "substrate-runtime-contract 0.1.0", - "substrate-runtime-council 0.1.0", - "substrate-runtime-democracy 0.1.0", - "substrate-runtime-executive 0.1.0", - "substrate-runtime-io 0.1.0", - "substrate-runtime-primitives 0.1.0", - "substrate-runtime-session 0.1.0", - "substrate-runtime-staking 0.1.0", - "substrate-runtime-std 0.1.0", - "substrate-runtime-support 0.1.0", - "substrate-runtime-system 0.1.0", - "substrate-runtime-timestamp 0.1.0", - "substrate-runtime-treasury 0.1.0", - "substrate-runtime-version 0.1.0", -] - -[[package]] -name = "demo-service" -version = "0.1.0" -dependencies = [ - "demo-api 0.1.0", - "demo-consensus 0.1.0", - "demo-executor 0.1.0", - "demo-network 0.1.0", - "demo-primitives 0.1.0", - "demo-runtime 0.1.0", - "demo-transaction-pool 0.1.0", - "ed25519 0.1.0", - "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", - "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "slog 2.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-client 0.1.0", - "substrate-network 0.1.0", - "substrate-primitives 0.1.0", - "substrate-runtime-io 0.1.0", - "substrate-service 0.3.0", - "substrate-telemetry 0.3.0", - "tokio 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "demo-transaction-pool" -version = "0.1.0" -dependencies = [ - "demo-api 0.1.0", - "demo-primitives 0.1.0", - "demo-runtime 0.1.0", - "ed25519 0.1.0", - "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-client 0.1.0", - "substrate-codec 0.1.0", - "substrate-extrinsic-pool 0.1.0", - "substrate-keyring 0.1.0", - "substrate-primitives 0.1.0", - "substrate-runtime-primitives 0.1.0", -] - [[package]] name = "difference" version = "1.0.0" @@ -608,18 +425,6 @@ name = "dtoa" version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "ed25519" -version = "0.1.0" -dependencies = [ - "base58 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", - "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "ring 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-primitives 0.1.0", - "untrusted 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "edit-distance" version = "2.0.1" @@ -1693,6 +1498,184 @@ dependencies = [ "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "node-api" +version = "0.1.0" +dependencies = [ + "node-primitives 0.1.0", + "node-runtime 0.1.0", + "substrate-client 0.1.0", + "substrate-keyring 0.1.0", + "substrate-primitives 0.1.0", +] + +[[package]] +name = "node-cli" +version = "0.1.0" +dependencies = [ + "exit-future 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "node-service 0.1.0", + "substrate-cli 0.3.0", + "tokio 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "node-consensus" +version = "0.1.0" +dependencies = [ + "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "exit-future 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "node-api 0.1.0", + "node-primitives 0.1.0", + "node-runtime 0.1.0", + "node-transaction-pool 0.1.0", + "parity-codec 0.1.0", + "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "rhododendron 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-primitives 0.1.0", + "substrate-bft 0.1.0", + "substrate-client 0.1.0", + "substrate-keyring 0.1.0", + "substrate-primitives 0.1.0", + "tokio 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "node-executor" +version = "0.1.0" +dependencies = [ + "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "node-primitives 0.1.0", + "node-runtime 0.1.0", + "parity-codec 0.1.0", + "sr-io 0.1.0", + "sr-primitives 0.1.0", + "srml-balances 0.1.0", + "srml-consensus 0.1.0", + "srml-session 0.1.0", + "srml-staking 0.1.0", + "srml-support 0.1.0", + "srml-system 0.1.0", + "srml-timestamp 0.1.0", + "srml-treasury 0.1.0", + "substrate-executor 0.1.0", + "substrate-keyring 0.1.0", + "substrate-primitives 0.1.0", + "substrate-state-machine 0.1.0", + "triehash 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "node-network" +version = "0.1.0" +dependencies = [ + "futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "node-api 0.1.0", + "node-consensus 0.1.0", + "node-primitives 0.1.0", + "rhododendron 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "substrate-bft 0.1.0", + "substrate-network 0.1.0", + "substrate-primitives 0.1.0", + "tokio 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "node-primitives" +version = "0.1.0" +dependencies = [ + "parity-codec 0.1.0", + "parity-codec-derive 0.1.0", + "pretty_assertions 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-primitives 0.1.0", + "sr-std 0.1.0", + "substrate-primitives 0.1.0", + "substrate-serializer 0.1.0", +] + +[[package]] +name = "node-runtime" +version = "0.1.0" +dependencies = [ + "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "node-primitives 0.1.0", + "parity-codec 0.1.0", + "parity-codec-derive 0.1.0", + "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-io 0.1.0", + "sr-primitives 0.1.0", + "sr-std 0.1.0", + "sr-version 0.1.0", + "srml-balances 0.1.0", + "srml-consensus 0.1.0", + "srml-contract 0.1.0", + "srml-council 0.1.0", + "srml-democracy 0.1.0", + "srml-executive 0.1.0", + "srml-session 0.1.0", + "srml-staking 0.1.0", + "srml-support 0.1.0", + "srml-system 0.1.0", + "srml-timestamp 0.1.0", + "srml-treasury 0.1.0", + "substrate-keyring 0.1.0", + "substrate-primitives 0.1.0", +] + +[[package]] +name = "node-service" +version = "0.1.0" +dependencies = [ + "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "node-api 0.1.0", + "node-consensus 0.1.0", + "node-executor 0.1.0", + "node-network 0.1.0", + "node-primitives 0.1.0", + "node-runtime 0.1.0", + "node-transaction-pool 0.1.0", + "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "slog 2.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-io 0.1.0", + "substrate-client 0.1.0", + "substrate-network 0.1.0", + "substrate-primitives 0.1.0", + "substrate-service 0.3.0", + "substrate-telemetry 0.3.0", + "tokio 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "node-transaction-pool" +version = "0.1.0" +dependencies = [ + "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "node-api 0.1.0", + "node-primitives 0.1.0", + "node-runtime 0.1.0", + "parity-codec 0.1.0", + "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-primitives 0.1.0", + "substrate-client 0.1.0", + "substrate-extrinsic-pool 0.1.0", + "substrate-keyring 0.1.0", + "substrate-primitives 0.1.0", +] + [[package]] name = "nodrop" version = "0.1.12" @@ -1764,6 +1747,23 @@ name = "parity-bytes" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "parity-codec" +version = "0.1.0" +dependencies = [ + "arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "parity-codec-derive" +version = "0.1.0" +dependencies = [ + "parity-codec 0.1.0", + "proc-macro2 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "parity-crypto" version = "0.1.0" @@ -2400,37 +2400,352 @@ dependencies = [ ] [[package]] -name = "stable_deref_trait" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "stdweb" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "strsim" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "subkey" +name = "sr-io" version = "0.1.0" dependencies = [ - "ed25519 0.1.0", - "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-primitives 0.1.0", -] + "environmental 0.1.0", + "hashdb 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 0.1.0", + "rlp 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc_version 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-std 0.1.0", + "substrate-primitives 0.1.0", + "substrate-state-machine 0.1.0", + "triehash 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "sr-primitives" +version = "0.1.0" +dependencies = [ + "integer-sqrt 0.1.0 (git+https://github.com/paritytech/integer-sqrt-rs.git)", + "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 0.1.0", + "parity-codec-derive 0.1.0", + "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-io 0.1.0", + "sr-std 0.1.0", + "substrate-primitives 0.1.0", +] + +[[package]] +name = "sr-sandbox" +version = "0.1.0" +dependencies = [ + "assert_matches 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 0.1.0", + "rustc_version 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-io 0.1.0", + "sr-std 0.1.0", + "substrate-primitives 0.1.0", + "wabt 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "wasmi 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "sr-std" +version = "0.1.0" +dependencies = [ + "pwasm-alloc 0.1.0", + "pwasm-libc 0.1.0", + "rustc_version 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "sr-version" +version = "0.1.0" +dependencies = [ + "parity-codec 0.1.0", + "parity-codec-derive 0.1.0", + "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-std 0.1.0", +] + +[[package]] +name = "srml-balances" +version = "0.1.0" +dependencies = [ + "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 0.1.0", + "parity-codec-derive 0.1.0", + "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-io 0.1.0", + "sr-primitives 0.1.0", + "sr-std 0.1.0", + "srml-support 0.1.0", + "srml-system 0.1.0", + "substrate-keyring 0.1.0", + "substrate-primitives 0.1.0", +] + +[[package]] +name = "srml-consensus" +version = "0.1.0" +dependencies = [ + "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 0.1.0", + "parity-codec-derive 0.1.0", + "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-io 0.1.0", + "sr-primitives 0.1.0", + "sr-std 0.1.0", + "srml-support 0.1.0", + "srml-system 0.1.0", + "substrate-primitives 0.1.0", +] + +[[package]] +name = "srml-contract" +version = "0.1.0" +dependencies = [ + "assert_matches 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 0.1.0", + "parity-wasm 0.31.0 (registry+https://github.com/rust-lang/crates.io-index)", + "pwasm-utils 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-io 0.1.0", + "sr-primitives 0.1.0", + "sr-sandbox 0.1.0", + "sr-std 0.1.0", + "srml-balances 0.1.0", + "srml-support 0.1.0", + "srml-system 0.1.0", + "substrate-primitives 0.1.0", + "wabt 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "srml-council" +version = "0.1.0" +dependencies = [ + "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "integer-sqrt 0.1.0 (git+https://github.com/paritytech/integer-sqrt-rs.git)", + "parity-codec 0.1.0", + "parity-codec-derive 0.1.0", + "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-io 0.1.0", + "sr-primitives 0.1.0", + "sr-std 0.1.0", + "srml-balances 0.1.0", + "srml-consensus 0.1.0", + "srml-democracy 0.1.0", + "srml-support 0.1.0", + "srml-system 0.1.0", + "substrate-keyring 0.1.0", + "substrate-primitives 0.1.0", +] + +[[package]] +name = "srml-democracy" +version = "0.1.0" +dependencies = [ + "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 0.1.0", + "parity-codec-derive 0.1.0", + "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-io 0.1.0", + "sr-primitives 0.1.0", + "sr-std 0.1.0", + "srml-balances 0.1.0", + "srml-consensus 0.1.0", + "srml-support 0.1.0", + "srml-system 0.1.0", + "substrate-primitives 0.1.0", +] + +[[package]] +name = "srml-example" +version = "0.1.0" +dependencies = [ + "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 0.1.0", + "parity-codec-derive 0.1.0", + "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-io 0.1.0", + "sr-primitives 0.1.0", + "sr-std 0.1.0", + "srml-balances 0.1.0", + "srml-support 0.1.0", + "srml-system 0.1.0", + "substrate-primitives 0.1.0", +] + +[[package]] +name = "srml-executive" +version = "0.1.0" +dependencies = [ + "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 0.1.0", + "parity-codec-derive 0.1.0", + "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-io 0.1.0", + "sr-primitives 0.1.0", + "sr-std 0.1.0", + "srml-balances 0.1.0", + "srml-support 0.1.0", + "srml-system 0.1.0", + "substrate-primitives 0.1.0", +] + +[[package]] +name = "srml-session" +version = "0.1.0" +dependencies = [ + "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 0.1.0", + "parity-codec-derive 0.1.0", + "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-io 0.1.0", + "sr-primitives 0.1.0", + "sr-std 0.1.0", + "srml-consensus 0.1.0", + "srml-support 0.1.0", + "srml-system 0.1.0", + "srml-timestamp 0.1.0", + "substrate-keyring 0.1.0", + "substrate-primitives 0.1.0", +] + +[[package]] +name = "srml-staking" +version = "0.1.0" +dependencies = [ + "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 0.1.0", + "parity-codec-derive 0.1.0", + "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-io 0.1.0", + "sr-primitives 0.1.0", + "sr-sandbox 0.1.0", + "sr-std 0.1.0", + "srml-balances 0.1.0", + "srml-consensus 0.1.0", + "srml-session 0.1.0", + "srml-support 0.1.0", + "srml-system 0.1.0", + "srml-timestamp 0.1.0", + "substrate-keyring 0.1.0", + "substrate-primitives 0.1.0", +] + +[[package]] +name = "srml-support" +version = "0.1.0" +dependencies = [ + "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 0.1.0", + "parity-codec-derive 0.1.0", + "pretty_assertions 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-io 0.1.0", + "sr-std 0.1.0", + "substrate-metadata 0.1.0", + "substrate-primitives 0.1.0", +] + +[[package]] +name = "srml-system" +version = "0.1.0" +dependencies = [ + "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 0.1.0", + "parity-codec-derive 0.1.0", + "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-io 0.1.0", + "sr-primitives 0.1.0", + "sr-std 0.1.0", + "srml-support 0.1.0", + "substrate-primitives 0.1.0", +] + +[[package]] +name = "srml-timestamp" +version = "0.1.0" +dependencies = [ + "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 0.1.0", + "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-io 0.1.0", + "sr-primitives 0.1.0", + "sr-std 0.1.0", + "srml-consensus 0.1.0", + "srml-support 0.1.0", + "srml-system 0.1.0", + "substrate-primitives 0.1.0", +] + +[[package]] +name = "srml-treasury" +version = "0.1.0" +dependencies = [ + "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 0.1.0", + "parity-codec-derive 0.1.0", + "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-io 0.1.0", + "sr-primitives 0.1.0", + "sr-std 0.1.0", + "srml-balances 0.1.0", + "srml-support 0.1.0", + "srml-system 0.1.0", + "substrate-primitives 0.1.0", +] + +[[package]] +name = "stable_deref_trait" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "stdweb" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "strsim" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "subkey" +version = "0.1.0" +dependencies = [ + "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "substrate-primitives 0.1.0", +] [[package]] name = "substrate" version = "0.1.0" dependencies = [ "ctrlc 3.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "demo-cli 0.1.0", "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", + "node-cli 0.1.0", "vergen 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2438,19 +2753,17 @@ dependencies = [ name = "substrate-bft" version = "0.1.0" dependencies = [ - "ed25519 0.1.0", "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 0.1.0", "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "rhododendron 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-codec 0.1.0", + "sr-primitives 0.1.0", + "sr-version 0.1.0", "substrate-executor 0.1.0", "substrate-keyring 0.1.0", "substrate-primitives 0.1.0", - "substrate-runtime-primitives 0.1.0", - "substrate-runtime-support 0.1.0", - "substrate-runtime-version 0.1.0", "tokio 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2473,10 +2786,10 @@ dependencies = [ "names 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "regex 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "slog 2.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-primitives 0.1.0", "substrate-client 0.1.0", "substrate-network 0.1.0", "substrate-network-libp2p 0.1.0", - "substrate-runtime-primitives 0.1.0", "substrate-service 0.3.0", "substrate-telemetry 0.3.0", "sysinfo 0.5.7 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2488,7 +2801,6 @@ dependencies = [ name = "substrate-client" version = "0.1.0" dependencies = [ - "ed25519 0.1.0", "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2496,18 +2808,18 @@ dependencies = [ "heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 0.1.0", "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "patricia-trie 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", "slog 2.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-io 0.1.0", + "sr-primitives 0.1.0", "substrate-bft 0.1.0", - "substrate-codec 0.1.0", "substrate-executor 0.1.0", "substrate-keyring 0.1.0", + "substrate-metadata 0.1.0", "substrate-primitives 0.1.0", - "substrate-runtime-io 0.1.0", - "substrate-runtime-primitives 0.1.0", - "substrate-runtime-support 0.1.0", "substrate-state-machine 0.1.0", "substrate-telemetry 0.3.0", "substrate-test-client 0.1.0", @@ -2524,54 +2836,35 @@ dependencies = [ "kvdb-rocksdb 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "memorydb 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 0.1.0", + "parity-codec-derive 0.1.0", "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-primitives 0.1.0", "substrate-client 0.1.0", - "substrate-codec 0.1.0", - "substrate-codec-derive 0.1.0", "substrate-executor 0.1.0", "substrate-primitives 0.1.0", - "substrate-runtime-primitives 0.1.0", - "substrate-runtime-support 0.1.0", "substrate-state-db 0.1.0", "substrate-state-machine 0.1.0", ] -[[package]] -name = "substrate-codec" -version = "0.1.0" -dependencies = [ - "arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "substrate-codec-derive" -version = "0.1.0" -dependencies = [ - "proc-macro2 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-codec 0.1.0", - "syn 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "substrate-executor" version = "0.1.0" dependencies = [ "assert_matches 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "ed25519 0.1.0", "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "hashdb 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 0.1.0", "parking_lot 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-codec 0.1.0", + "sr-io 0.1.0", + "sr-version 0.1.0", "substrate-primitives 0.1.0", - "substrate-runtime-io 0.1.0", - "substrate-runtime-version 0.1.0", "substrate-serializer 0.1.0", "substrate-state-machine 0.1.0", "triehash 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2587,12 +2880,12 @@ dependencies = [ "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 0.1.0", "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-codec 0.1.0", + "sr-primitives 0.1.0", "substrate-keyring 0.1.0", - "substrate-runtime-primitives 0.1.0", "substrate-test-client 0.1.0", "transaction-pool 1.13.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2601,16 +2894,15 @@ dependencies = [ name = "substrate-keyring" version = "0.1.0" dependencies = [ - "ed25519 0.1.0", "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "substrate-primitives 0.1.0", ] [[package]] name = "substrate-keystore" version = "0.1.0" dependencies = [ - "ed25519 0.1.0", "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "parity-crypto 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2623,17 +2915,24 @@ dependencies = [ "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "substrate-metadata" +version = "0.1.0" +dependencies = [ + "parity-codec 0.1.0", +] + [[package]] name = "substrate-misbehavior-check" version = "0.1.0" dependencies = [ + "parity-codec 0.1.0", "rhododendron 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-io 0.1.0", + "sr-primitives 0.1.0", "substrate-bft 0.1.0", - "substrate-codec 0.1.0", "substrate-keyring 0.1.0", "substrate-primitives 0.1.0", - "substrate-runtime-io 0.1.0", - "substrate-runtime-primitives 0.1.0", ] [[package]] @@ -2641,22 +2940,21 @@ name = "substrate-network" version = "0.1.0" dependencies = [ "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "ed25519 0.1.0", "env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore-io 1.12.0 (git+https://github.com/paritytech/parity.git)", "futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", "linked-hash-map 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 0.1.0", + "parity-codec-derive 0.1.0", "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-primitives 0.1.0", "substrate-client 0.1.0", - "substrate-codec 0.1.0", - "substrate-codec-derive 0.1.0", "substrate-keyring 0.1.0", "substrate-network-libp2p 0.1.0", "substrate-primitives 0.1.0", - "substrate-runtime-primitives 0.1.0", "substrate-test-client 0.1.0", ] @@ -2692,6 +2990,7 @@ dependencies = [ name = "substrate-primitives" version = "0.1.0" dependencies = [ + "base58 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2699,19 +2998,22 @@ dependencies = [ "fixed-hash 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "hashdb 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 0.1.0", + "parity-codec-derive 0.1.0", "patricia-trie 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "plain_hasher 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "pretty_assertions 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ring 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-codec 0.1.0", - "substrate-codec-derive 0.1.0", - "substrate-runtime-std 0.1.0", + "sr-std 0.1.0", "substrate-serializer 0.1.0", "twox-hash 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "uint 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "untrusted 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "wasmi 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2725,16 +3027,16 @@ dependencies = [ "jsonrpc-macros 8.0.1 (git+https://github.com/paritytech/jsonrpc.git)", "jsonrpc-pubsub 8.0.1 (git+https://github.com/paritytech/jsonrpc.git)", "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 0.1.0", "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-primitives 0.1.0", + "sr-version 0.1.0", "substrate-client 0.1.0", - "substrate-codec 0.1.0", "substrate-executor 0.1.0", "substrate-extrinsic-pool 0.1.0", "substrate-primitives 0.1.0", - "substrate-runtime-primitives 0.1.0", - "substrate-runtime-version 0.1.0", "substrate-state-machine 0.1.0", "substrate-test-client 0.1.0", "tokio 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2750,327 +3052,8 @@ dependencies = [ "jsonrpc-ws-server 8.0.0 (git+https://github.com/paritytech/jsonrpc.git)", "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-primitives 0.1.0", "substrate-rpc 0.1.0", - "substrate-runtime-primitives 0.1.0", -] - -[[package]] -name = "substrate-runtime-balances" -version = "0.1.0" -dependencies = [ - "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-codec 0.1.0", - "substrate-codec-derive 0.1.0", - "substrate-keyring 0.1.0", - "substrate-primitives 0.1.0", - "substrate-runtime-io 0.1.0", - "substrate-runtime-primitives 0.1.0", - "substrate-runtime-std 0.1.0", - "substrate-runtime-support 0.1.0", - "substrate-runtime-system 0.1.0", -] - -[[package]] -name = "substrate-runtime-consensus" -version = "0.1.0" -dependencies = [ - "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-codec 0.1.0", - "substrate-codec-derive 0.1.0", - "substrate-primitives 0.1.0", - "substrate-runtime-io 0.1.0", - "substrate-runtime-primitives 0.1.0", - "substrate-runtime-std 0.1.0", - "substrate-runtime-support 0.1.0", - "substrate-runtime-system 0.1.0", -] - -[[package]] -name = "substrate-runtime-contract" -version = "0.1.0" -dependencies = [ - "assert_matches 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-wasm 0.31.0 (registry+https://github.com/rust-lang/crates.io-index)", - "pwasm-utils 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-codec 0.1.0", - "substrate-primitives 0.1.0", - "substrate-runtime-balances 0.1.0", - "substrate-runtime-io 0.1.0", - "substrate-runtime-primitives 0.1.0", - "substrate-runtime-sandbox 0.1.0", - "substrate-runtime-std 0.1.0", - "substrate-runtime-support 0.1.0", - "substrate-runtime-system 0.1.0", - "wabt 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "substrate-runtime-council" -version = "0.1.0" -dependencies = [ - "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "integer-sqrt 0.1.0 (git+https://github.com/paritytech/integer-sqrt-rs.git)", - "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-codec 0.1.0", - "substrate-codec-derive 0.1.0", - "substrate-keyring 0.1.0", - "substrate-primitives 0.1.0", - "substrate-runtime-balances 0.1.0", - "substrate-runtime-consensus 0.1.0", - "substrate-runtime-democracy 0.1.0", - "substrate-runtime-io 0.1.0", - "substrate-runtime-primitives 0.1.0", - "substrate-runtime-std 0.1.0", - "substrate-runtime-support 0.1.0", - "substrate-runtime-system 0.1.0", -] - -[[package]] -name = "substrate-runtime-democracy" -version = "0.1.0" -dependencies = [ - "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-codec 0.1.0", - "substrate-codec-derive 0.1.0", - "substrate-primitives 0.1.0", - "substrate-runtime-balances 0.1.0", - "substrate-runtime-consensus 0.1.0", - "substrate-runtime-io 0.1.0", - "substrate-runtime-primitives 0.1.0", - "substrate-runtime-std 0.1.0", - "substrate-runtime-support 0.1.0", - "substrate-runtime-system 0.1.0", -] - -[[package]] -name = "substrate-runtime-example" -version = "0.1.0" -dependencies = [ - "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-codec 0.1.0", - "substrate-codec-derive 0.1.0", - "substrate-primitives 0.1.0", - "substrate-runtime-balances 0.1.0", - "substrate-runtime-io 0.1.0", - "substrate-runtime-primitives 0.1.0", - "substrate-runtime-std 0.1.0", - "substrate-runtime-support 0.1.0", - "substrate-runtime-system 0.1.0", -] - -[[package]] -name = "substrate-runtime-executive" -version = "0.1.0" -dependencies = [ - "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-codec 0.1.0", - "substrate-codec-derive 0.1.0", - "substrate-primitives 0.1.0", - "substrate-runtime-balances 0.1.0", - "substrate-runtime-io 0.1.0", - "substrate-runtime-primitives 0.1.0", - "substrate-runtime-std 0.1.0", - "substrate-runtime-support 0.1.0", - "substrate-runtime-system 0.1.0", -] - -[[package]] -name = "substrate-runtime-io" -version = "0.1.0" -dependencies = [ - "ed25519 0.1.0", - "environmental 0.1.0", - "hashdb 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc_version 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-codec 0.1.0", - "substrate-primitives 0.1.0", - "substrate-runtime-std 0.1.0", - "substrate-state-machine 0.1.0", - "triehash 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "substrate-runtime-primitives" -version = "0.1.0" -dependencies = [ - "integer-sqrt 0.1.0 (git+https://github.com/paritytech/integer-sqrt-rs.git)", - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-codec 0.1.0", - "substrate-codec-derive 0.1.0", - "substrate-primitives 0.1.0", - "substrate-runtime-io 0.1.0", - "substrate-runtime-std 0.1.0", - "substrate-runtime-support 0.1.0", -] - -[[package]] -name = "substrate-runtime-sandbox" -version = "0.1.0" -dependencies = [ - "assert_matches 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc_version 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-codec 0.1.0", - "substrate-primitives 0.1.0", - "substrate-runtime-io 0.1.0", - "substrate-runtime-std 0.1.0", - "wabt 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "wasmi 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "substrate-runtime-session" -version = "0.1.0" -dependencies = [ - "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-codec 0.1.0", - "substrate-codec-derive 0.1.0", - "substrate-keyring 0.1.0", - "substrate-primitives 0.1.0", - "substrate-runtime-consensus 0.1.0", - "substrate-runtime-io 0.1.0", - "substrate-runtime-primitives 0.1.0", - "substrate-runtime-std 0.1.0", - "substrate-runtime-support 0.1.0", - "substrate-runtime-system 0.1.0", - "substrate-runtime-timestamp 0.1.0", -] - -[[package]] -name = "substrate-runtime-staking" -version = "0.1.0" -dependencies = [ - "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-codec 0.1.0", - "substrate-codec-derive 0.1.0", - "substrate-keyring 0.1.0", - "substrate-primitives 0.1.0", - "substrate-runtime-balances 0.1.0", - "substrate-runtime-consensus 0.1.0", - "substrate-runtime-io 0.1.0", - "substrate-runtime-primitives 0.1.0", - "substrate-runtime-sandbox 0.1.0", - "substrate-runtime-session 0.1.0", - "substrate-runtime-std 0.1.0", - "substrate-runtime-support 0.1.0", - "substrate-runtime-system 0.1.0", - "substrate-runtime-timestamp 0.1.0", -] - -[[package]] -name = "substrate-runtime-std" -version = "0.1.0" -dependencies = [ - "pwasm-alloc 0.1.0", - "pwasm-libc 0.1.0", - "rustc_version 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "substrate-runtime-support" -version = "0.1.0" -dependencies = [ - "ed25519 0.1.0", - "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "pretty_assertions 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-codec 0.1.0", - "substrate-codec-derive 0.1.0", - "substrate-primitives 0.1.0", - "substrate-runtime-io 0.1.0", - "substrate-runtime-std 0.1.0", -] - -[[package]] -name = "substrate-runtime-system" -version = "0.1.0" -dependencies = [ - "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-codec 0.1.0", - "substrate-codec-derive 0.1.0", - "substrate-primitives 0.1.0", - "substrate-runtime-io 0.1.0", - "substrate-runtime-primitives 0.1.0", - "substrate-runtime-std 0.1.0", - "substrate-runtime-support 0.1.0", -] - -[[package]] -name = "substrate-runtime-timestamp" -version = "0.1.0" -dependencies = [ - "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-codec 0.1.0", - "substrate-primitives 0.1.0", - "substrate-runtime-consensus 0.1.0", - "substrate-runtime-io 0.1.0", - "substrate-runtime-primitives 0.1.0", - "substrate-runtime-std 0.1.0", - "substrate-runtime-support 0.1.0", - "substrate-runtime-system 0.1.0", -] - -[[package]] -name = "substrate-runtime-treasury" -version = "0.1.0" -dependencies = [ - "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-codec 0.1.0", - "substrate-codec-derive 0.1.0", - "substrate-primitives 0.1.0", - "substrate-runtime-balances 0.1.0", - "substrate-runtime-io 0.1.0", - "substrate-runtime-primitives 0.1.0", - "substrate-runtime-std 0.1.0", - "substrate-runtime-support 0.1.0", - "substrate-runtime-system 0.1.0", -] - -[[package]] -name = "substrate-runtime-version" -version = "0.1.0" -dependencies = [ - "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-codec 0.1.0", - "substrate-codec-derive 0.1.0", - "substrate-runtime-std 0.1.0", - "substrate-runtime-support 0.1.0", ] [[package]] @@ -3090,14 +3073,16 @@ dependencies = [ "futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 0.1.0", "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)", "slog 2.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-io 0.1.0", + "sr-primitives 0.1.0", "substrate-client 0.1.0", "substrate-client-db 0.1.0", - "substrate-codec 0.1.0", "substrate-executor 0.1.0", "substrate-extrinsic-pool 0.1.0", "substrate-keystore 0.1.0", @@ -3105,8 +3090,6 @@ dependencies = [ "substrate-primitives 0.1.0", "substrate-rpc 0.1.0", "substrate-rpc-servers 0.1.0", - "substrate-runtime-io 0.1.0", - "substrate-runtime-primitives 0.1.0", "substrate-telemetry 0.3.0", "target_info 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "tokio 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3118,9 +3101,9 @@ version = "0.1.0" dependencies = [ "env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 0.1.0", + "parity-codec-derive 0.1.0", "parking_lot 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-codec 0.1.0", - "substrate-codec-derive 0.1.0", "substrate-primitives 0.1.0", ] @@ -3134,10 +3117,10 @@ dependencies = [ "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "memorydb 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 0.1.0", "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "patricia-trie 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-codec 0.1.0", "substrate-primitives 0.1.0", "triehash 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3161,15 +3144,15 @@ name = "substrate-test-client" version = "0.1.0" dependencies = [ "hashdb 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 0.1.0", "rhododendron 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-primitives 0.1.0", + "srml-support 0.1.0", "substrate-bft 0.1.0", "substrate-client 0.1.0", - "substrate-codec 0.1.0", "substrate-executor 0.1.0", "substrate-keyring 0.1.0", "substrate-primitives 0.1.0", - "substrate-runtime-primitives 0.1.0", - "substrate-runtime-support 0.1.0", "substrate-test-runtime 0.1.0", ] @@ -3177,20 +3160,19 @@ dependencies = [ name = "substrate-test-runtime" version = "0.1.0" dependencies = [ - "ed25519 0.1.0", "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 0.1.0", + "parity-codec-derive 0.1.0", "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-codec 0.1.0", - "substrate-codec-derive 0.1.0", + "sr-io 0.1.0", + "sr-primitives 0.1.0", + "sr-std 0.1.0", + "sr-version 0.1.0", + "srml-support 0.1.0", "substrate-keyring 0.1.0", "substrate-primitives 0.1.0", - "substrate-runtime-io 0.1.0", - "substrate-runtime-primitives 0.1.0", - "substrate-runtime-std 0.1.0", - "substrate-runtime-support 0.1.0", - "substrate-runtime-version 0.1.0", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index a0550303dcccd..81ec49dc999ae 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,63 +1,64 @@ [workspace] members = [ - "substrate/bft", - "substrate/cli", - "substrate/client", - "substrate/client/db", - "substrate/codec", - "substrate/codec/derive", - "substrate/environmental", - "substrate/executor", - "substrate/extrinsic-pool", - "substrate/keyring", - "substrate/misbehavior-check", - "substrate/network", - "substrate/primitives", - "substrate/rpc", - "substrate/rpc-servers", - "substrate/runtime-io", - "substrate/runtime-sandbox", - "substrate/runtime-std", - "substrate/runtime-support", - "substrate/runtime/balances", - "substrate/runtime/consensus", - "substrate/runtime/contract", - "substrate/runtime/council", - "substrate/runtime/democracy", - "substrate/runtime/example", - "substrate/runtime/executive", - "substrate/runtime/primitives", - "substrate/runtime/session", - "substrate/runtime/staking", - "substrate/runtime/system", - "substrate/runtime/timestamp", - "substrate/runtime/treasury", - "substrate/runtime/version", - "substrate/serializer", - "substrate/service", - "substrate/state-db", - "substrate/state-machine", - "substrate/test-runtime", - "substrate/telemetry", - "substrate/keystore", - "demo", - "demo/cli", - "demo/api", - "demo/consensus", - "demo/executor", - "demo/network", - "demo/primitives", - "demo/runtime", - "demo/service", - "demo/transaction-pool", + "codec", + "codec/derive", + "environmental", + "core/bft", + "core/cli", + "core/client", + "core/client/db", + "core/executor", + "core/extrinsic-pool", + "core/keyring", + "core/metadata", + "core/misbehavior-check", + "core/network", + "core/primitives", + "core/rpc", + "core/rpc-servers", + "core/sr-io", + "core/sr-sandbox", + "core/sr-std", + "core/sr-version", + "srml/support", + "srml/balances", + "srml/consensus", + "srml/contract", + "srml/council", + "srml/democracy", + "srml/example", + "srml/executive", + "core/sr-primitives", + "srml/session", + "srml/staking", + "srml/system", + "srml/timestamp", + "srml/treasury", + "core/serializer", + "core/service", + "core/state-db", + "core/state-machine", + "core/test-runtime", + "core/telemetry", + "core/keystore", + "node", + "node/cli", + "node/api", + "node/consensus", + "node/executor", + "node/network", + "node/primitives", + "node/runtime", + "node/service", + "node/transaction-pool", "subkey", ] exclude = [ - "demo/runtime/wasm", - "substrate/executor/wasm", - "substrate/pwasm-alloc", - "substrate/pwasm-libc", - "substrate/test-runtime/wasm", + "node/runtime/wasm", + "core/executor/wasm", + "pwasm-alloc", + "pwasm-libc", + "core/test-runtime/wasm", ] [badges] diff --git a/README.adoc b/README.adoc index f1502ca3313fc..a6d7ab30c643a 100644 --- a/README.adoc +++ b/README.adoc @@ -145,7 +145,6 @@ Then build the code: [source, shell] ---- ./scripts/build.sh # Builds the WebAssembly binaries -./scripts/build-demos.sh # Builds the WebAssembly binaries cargo build # Builds all native code ---- diff --git a/ci/script.sh b/ci/script.sh index 812da2d816805..7eee447bb06cb 100755 --- a/ci/script.sh +++ b/ci/script.sh @@ -24,6 +24,5 @@ case $TARGET in # Install prerequisites and build all wasm projects ./scripts/init.sh ./scripts/build.sh - ./scripts/build-demos.sh ;; esac diff --git a/substrate/codec/Cargo.toml b/codec/Cargo.toml similarity index 91% rename from substrate/codec/Cargo.toml rename to codec/Cargo.toml index a228686e90b1d..00bbed49852c1 100644 --- a/substrate/codec/Cargo.toml +++ b/codec/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "substrate-codec" +name = "parity-codec" description = "Serialization and deserialization codec for runtime values" version = "0.1.0" authors = ["Parity Technologies "] diff --git a/substrate/codec/README.adoc b/codec/README.adoc similarity index 100% rename from substrate/codec/README.adoc rename to codec/README.adoc diff --git a/substrate/codec/derive/Cargo.toml b/codec/derive/Cargo.toml similarity index 81% rename from substrate/codec/derive/Cargo.toml rename to codec/derive/Cargo.toml index d5ccd9fdd57aa..f92b1f5981202 100644 --- a/substrate/codec/derive/Cargo.toml +++ b/codec/derive/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "substrate-codec-derive" +name = "parity-codec-derive" description = "Serialization and deserialization derive macro" version = "0.1.0" authors = ["Parity Technologies "] @@ -13,7 +13,7 @@ quote = "0.6" proc-macro2 = "0.4" [dev-dependencies] -substrate-codec = { path = "../" } +parity-codec = { path = "../" } [features] default = ["std"] diff --git a/substrate/codec/derive/src/decode.rs b/codec/derive/src/decode.rs similarity index 100% rename from substrate/codec/derive/src/decode.rs rename to codec/derive/src/decode.rs diff --git a/substrate/codec/derive/src/encode.rs b/codec/derive/src/encode.rs similarity index 100% rename from substrate/codec/derive/src/encode.rs rename to codec/derive/src/encode.rs diff --git a/substrate/codec/derive/src/lib.rs b/codec/derive/src/lib.rs similarity index 100% rename from substrate/codec/derive/src/lib.rs rename to codec/derive/src/lib.rs diff --git a/substrate/codec/derive/tests/mod.rs b/codec/derive/tests/mod.rs similarity index 98% rename from substrate/codec/derive/tests/mod.rs rename to codec/derive/tests/mod.rs index 6b3260f8f64e2..f7b4b77be3d93 100644 --- a/substrate/codec/derive/tests/mod.rs +++ b/codec/derive/tests/mod.rs @@ -14,10 +14,10 @@ // You should have received a copy of the GNU General Public License // along with Substrate. If not, see . -extern crate substrate_codec as codec; +extern crate parity_codec as codec; #[macro_use] -extern crate substrate_codec_derive; +extern crate parity_codec_derive; use codec::{Encode, Decode}; diff --git a/substrate/codec/src/codec.rs b/codec/src/codec.rs similarity index 100% rename from substrate/codec/src/codec.rs rename to codec/src/codec.rs diff --git a/substrate/codec/src/joiner.rs b/codec/src/joiner.rs similarity index 100% rename from substrate/codec/src/joiner.rs rename to codec/src/joiner.rs diff --git a/substrate/codec/src/keyedvec.rs b/codec/src/keyedvec.rs similarity index 100% rename from substrate/codec/src/keyedvec.rs rename to codec/src/keyedvec.rs diff --git a/substrate/codec/src/lib.rs b/codec/src/lib.rs similarity index 100% rename from substrate/codec/src/lib.rs rename to codec/src/lib.rs diff --git a/substrate/bft/Cargo.toml b/core/bft/Cargo.toml similarity index 59% rename from substrate/bft/Cargo.toml rename to core/bft/Cargo.toml index f15f24a0d5bd8..96e1c6a523c36 100644 --- a/substrate/bft/Cargo.toml +++ b/core/bft/Cargo.toml @@ -5,12 +5,10 @@ authors = ["Parity Technologies "] [dependencies] futures = "0.1.17" -substrate-codec = { path = "../codec" } +parity-codec = { path = "../../codec" } substrate-primitives = { path = "../primitives" } -substrate-runtime-support = { path = "../runtime-support" } -substrate-runtime-primitives = { path = "../runtime/primitives" } -substrate-runtime-version = { path = "../runtime/version" } -ed25519 = { path = "../ed25519" } +sr-primitives = { path = "../sr-primitives" } +sr-version = { path = "../sr-version" } tokio = "0.1.7" parking_lot = "0.4" error-chain = "0.12" diff --git a/substrate/bft/README.adoc b/core/bft/README.adoc similarity index 100% rename from substrate/bft/README.adoc rename to core/bft/README.adoc diff --git a/substrate/bft/src/error.rs b/core/bft/src/error.rs similarity index 96% rename from substrate/bft/src/error.rs rename to core/bft/src/error.rs index d8de262364965..fb41e7efa9055 100644 --- a/substrate/bft/src/error.rs +++ b/core/bft/src/error.rs @@ -16,6 +16,7 @@ //! Error types in the BFT service. use runtime_version::RuntimeVersion; +use primitives::ed25519; error_chain! { errors { @@ -44,7 +45,7 @@ error_chain! { } /// Error checking signature - InvalidSignature(s: ::ed25519::Signature, a: ::primitives::AuthorityId) { + InvalidSignature(s: ed25519::Signature, a: ::primitives::AuthorityId) { description("Message signature is invalid"), display("Message signature {:?} by {:?} is invalid.", s, a), } diff --git a/substrate/bft/src/lib.rs b/core/bft/src/lib.rs similarity index 99% rename from substrate/bft/src/lib.rs rename to core/bft/src/lib.rs index 4b9d3be90c291..469f9710a3849 100644 --- a/substrate/bft/src/lib.rs +++ b/core/bft/src/lib.rs @@ -36,12 +36,10 @@ pub mod error; -extern crate substrate_codec as codec; +extern crate parity_codec as codec; extern crate substrate_primitives as primitives; -extern crate substrate_runtime_support as runtime_support; -extern crate substrate_runtime_primitives as runtime_primitives; -extern crate substrate_runtime_version as runtime_version; -extern crate ed25519; +extern crate sr_primitives as runtime_primitives; +extern crate sr_version as runtime_version; extern crate tokio; extern crate parking_lot; extern crate rhododendron; @@ -59,11 +57,10 @@ use std::sync::atomic::{AtomicUsize, Ordering}; use std::time::{Instant, Duration}; use codec::Encode; -use ed25519::LocalizedSignature; use runtime_primitives::generic::BlockId; use runtime_primitives::traits::{Block, Header}; use runtime_primitives::bft::{Message as PrimitiveMessage, Action as PrimitiveAction, Justification as PrimitiveJustification}; -use primitives::AuthorityId; +use primitives::{AuthorityId, ed25519, ed25519::LocalizedSignature}; use futures::{Async, Stream, Sink, Future, IntoFuture}; use futures::sync::oneshot; @@ -316,7 +313,7 @@ impl> rhododendron::Context for BftInstance use std::collections::HashSet; let collect_pubkeys = |participants: HashSet<&Self::AuthorityId>| participants.into_iter() - .map(|p| ::ed25519::Public::from_raw(p.0)) + .map(|p| ed25519::Public::from_raw(p.0)) .collect::>(); let round_timeout = self.round_timeout_duration(next_round); diff --git a/substrate/cli/Cargo.toml b/core/cli/Cargo.toml similarity index 59% rename from substrate/cli/Cargo.toml rename to core/cli/Cargo.toml index 7ae824c3dc104..23107218e2f1a 100644 --- a/substrate/cli/Cargo.toml +++ b/core/cli/Cargo.toml @@ -23,12 +23,12 @@ futures = "0.1.17" fdlimit = "0.1" exit-future = "0.1" sysinfo = "0.5.7" -substrate-client = { path = "../../substrate/client" } -substrate-network = { path = "../../substrate/network" } -substrate-network-libp2p = { path = "../../substrate/network-libp2p" } -substrate-runtime-primitives = { path = "../../substrate/runtime/primitives" } -substrate-service = { path = "../../substrate/service" } -substrate-telemetry = { path = "../../substrate/telemetry" } +substrate-client = { path = "../../core/client" } +substrate-network = { path = "../../core/network" } +substrate-network-libp2p = { path = "../../core/network-libp2p" } +sr-primitives = { path = "../../core/sr-primitives" } +substrate-service = { path = "../../core/service" } +substrate-telemetry = { path = "../../core/telemetry" } names = "0.11.0" [build-dependencies] diff --git a/substrate/cli/README.adoc b/core/cli/README.adoc similarity index 100% rename from substrate/cli/README.adoc rename to core/cli/README.adoc diff --git a/substrate/cli/build.rs b/core/cli/build.rs similarity index 100% rename from substrate/cli/build.rs rename to core/cli/build.rs diff --git a/substrate/cli/doc/shell-completion.adoc b/core/cli/doc/shell-completion.adoc similarity index 100% rename from substrate/cli/doc/shell-completion.adoc rename to core/cli/doc/shell-completion.adoc diff --git a/substrate/cli/src/cli.yml b/core/cli/src/cli.yml similarity index 100% rename from substrate/cli/src/cli.yml rename to core/cli/src/cli.yml diff --git a/substrate/cli/src/error.rs b/core/cli/src/error.rs similarity index 100% rename from substrate/cli/src/error.rs rename to core/cli/src/error.rs diff --git a/substrate/cli/src/informant.rs b/core/cli/src/informant.rs similarity index 100% rename from substrate/cli/src/informant.rs rename to core/cli/src/informant.rs diff --git a/substrate/cli/src/lib.rs b/core/cli/src/lib.rs similarity index 99% rename from substrate/cli/src/lib.rs rename to core/cli/src/lib.rs index 94d8849b05b35..199f3688ec036 100644 --- a/substrate/cli/src/lib.rs +++ b/core/cli/src/lib.rs @@ -37,7 +37,7 @@ extern crate sysinfo; extern crate substrate_client as client; extern crate substrate_network as network; extern crate substrate_network_libp2p as network_libp2p; -extern crate substrate_runtime_primitives as runtime_primitives; +extern crate sr_primitives as runtime_primitives; extern crate substrate_service as service; #[macro_use] extern crate slog; // needed until we can reexport `slog_info` from `substrate_telemetry` diff --git a/substrate/cli/src/panic_hook.rs b/core/cli/src/panic_hook.rs similarity index 100% rename from substrate/cli/src/panic_hook.rs rename to core/cli/src/panic_hook.rs diff --git a/substrate/client/Cargo.toml b/core/client/Cargo.toml similarity index 67% rename from substrate/client/Cargo.toml rename to core/client/Cargo.toml index 5512b0d65832a..ab26b99cd0d65 100644 --- a/substrate/client/Cargo.toml +++ b/core/client/Cargo.toml @@ -11,18 +11,17 @@ parking_lot = "0.4" triehash = "0.2" hex-literal = "0.1" futures = "0.1.17" -ed25519 = { path = "../ed25519" } slog = "^2" heapsize = "0.4" substrate-bft = { path = "../bft" } -substrate-codec = { path = "../codec" } +parity-codec = { path = "../../codec" } substrate-executor = { path = "../executor" } substrate-primitives = { path = "../primitives" } -substrate-runtime-io = { path = "../runtime-io" } -substrate-runtime-support = { path = "../runtime-support" } -substrate-runtime-primitives = { path = "../runtime/primitives" } +sr-io = { path = "../sr-io" } +substrate-metadata = { path = "../metadata" } +sr-primitives = { path = "../sr-primitives" } substrate-state-machine = { path = "../state-machine" } -substrate-keyring = { path = "../../substrate/keyring" } +substrate-keyring = { path = "../../core/keyring" } substrate-telemetry = { path = "../telemetry" } hashdb = "0.2.1" patricia-trie = "0.2.1" diff --git a/substrate/client/README.adoc b/core/client/README.adoc similarity index 100% rename from substrate/client/README.adoc rename to core/client/README.adoc diff --git a/core/client/db/Cargo.toml b/core/client/db/Cargo.toml new file mode 100644 index 0000000000000..cb69ed4856b1e --- /dev/null +++ b/core/client/db/Cargo.toml @@ -0,0 +1,23 @@ +[package] +name = "substrate-client-db" +version = "0.1.0" +authors = ["Parity Technologies "] + +[dependencies] +parking_lot = "0.4" +log = "0.3" +kvdb = "0.1" +kvdb-rocksdb = "0.1.3" +hashdb = "0.2.1" +memorydb = "0.2.1" +substrate-primitives = { path = "../../../core/primitives" } +sr-primitives = { path = "../../../core/sr-primitives" } +substrate-client = { path = "../../../core/client" } +substrate-state-machine = { path = "../../../core/state-machine" } +parity-codec = { path = "../../../codec" } +parity-codec-derive = { path = "../../../codec/derive" } +substrate-executor = { path = "../../../core/executor" } +substrate-state-db = { path = "../../../core/state-db" } + +[dev-dependencies] +kvdb-memorydb = "0.1" diff --git a/substrate/client/db/src/cache.rs b/core/client/db/src/cache.rs similarity index 100% rename from substrate/client/db/src/cache.rs rename to core/client/db/src/cache.rs diff --git a/substrate/client/db/src/lib.rs b/core/client/db/src/lib.rs similarity index 99% rename from substrate/client/db/src/lib.rs rename to core/client/db/src/lib.rs index acbd935ce8c32..0871b0cfe9170 100644 --- a/substrate/client/db/src/lib.rs +++ b/core/client/db/src/lib.rs @@ -26,9 +26,8 @@ extern crate memorydb; extern crate parking_lot; extern crate substrate_state_machine as state_machine; extern crate substrate_primitives as primitives; -extern crate substrate_runtime_support as runtime_support; -extern crate substrate_runtime_primitives as runtime_primitives; -extern crate substrate_codec as codec; +extern crate sr_primitives as runtime_primitives; +extern crate parity_codec as codec; extern crate substrate_executor as executor; extern crate substrate_state_db as state_db; @@ -36,7 +35,7 @@ extern crate substrate_state_db as state_db; extern crate log; #[macro_use] -extern crate substrate_codec_derive; +extern crate parity_codec_derive; #[cfg(test)] extern crate kvdb_memorydb; diff --git a/substrate/client/db/src/light.rs b/core/client/db/src/light.rs similarity index 100% rename from substrate/client/db/src/light.rs rename to core/client/db/src/light.rs diff --git a/substrate/client/db/src/utils.rs b/core/client/db/src/utils.rs similarity index 100% rename from substrate/client/db/src/utils.rs rename to core/client/db/src/utils.rs diff --git a/substrate/client/src/backend.rs b/core/client/src/backend.rs similarity index 100% rename from substrate/client/src/backend.rs rename to core/client/src/backend.rs diff --git a/substrate/client/src/block_builder.rs b/core/client/src/block_builder.rs similarity index 100% rename from substrate/client/src/block_builder.rs rename to core/client/src/block_builder.rs diff --git a/substrate/client/src/blockchain.rs b/core/client/src/blockchain.rs similarity index 100% rename from substrate/client/src/blockchain.rs rename to core/client/src/blockchain.rs diff --git a/substrate/client/src/call_executor.rs b/core/client/src/call_executor.rs similarity index 100% rename from substrate/client/src/call_executor.rs rename to core/client/src/call_executor.rs diff --git a/substrate/client/src/cht.rs b/core/client/src/cht.rs similarity index 100% rename from substrate/client/src/cht.rs rename to core/client/src/cht.rs diff --git a/substrate/client/src/client.rs b/core/client/src/client.rs similarity index 99% rename from substrate/client/src/client.rs rename to core/client/src/client.rs index 9b82413c6a670..f5dc77c116279 100644 --- a/substrate/client/src/client.rs +++ b/core/client/src/client.rs @@ -23,7 +23,7 @@ use primitives::AuthorityId; use runtime_primitives::{bft::Justification, generic::{BlockId, SignedBlock, Block as RuntimeBlock}}; use runtime_primitives::traits::{Block as BlockT, Header as HeaderT, Zero, One, As, NumberFor}; use runtime_primitives::BuildStorage; -use runtime_support::metadata::JSONMetadataDecodable; +use substrate_metadata::JsonMetadataDecodable; use primitives::{Blake2Hasher, RlpCodec}; use primitives::storage::{StorageKey, StorageData}; use codec::{Encode, Decode}; @@ -255,7 +255,7 @@ impl Client where /// Returns the runtime metadata as JSON. pub fn json_metadata(&self, id: &BlockId) -> error::Result { self.executor.call(id, "json_metadata",&[]) - .and_then(|r| Vec::::decode(&mut &r.return_data[..]) + .and_then(|r| Vec::::decode(&mut &r.return_data[..]) .ok_or("JSON Metadata decoding failed".into())) .and_then(|metadata| { let mut json = metadata.into_iter().enumerate().fold(String::from("{"), diff --git a/substrate/client/src/error.rs b/core/client/src/error.rs similarity index 100% rename from substrate/client/src/error.rs rename to core/client/src/error.rs diff --git a/substrate/client/src/genesis.rs b/core/client/src/genesis.rs similarity index 98% rename from substrate/client/src/genesis.rs rename to core/client/src/genesis.rs index 93b8244fec534..9c7810aedca3d 100644 --- a/substrate/client/src/genesis.rs +++ b/core/client/src/genesis.rs @@ -50,8 +50,7 @@ mod tests { use test_client; use test_client::runtime::genesismap::{GenesisConfig, additional_storage_with_genesis}; use test_client::runtime::{Hash, Transfer, Block, BlockNumber, Header, Digest, Extrinsic}; - use ed25519::{Public, Pair}; - use primitives::{Blake2Hasher, RlpCodec}; + use primitives::{Blake2Hasher, RlpCodec, ed25519::{Public, Pair}}; native_executor_instance!(Executor, test_client::runtime::api::dispatch, test_client::runtime::VERSION, include_bytes!("../../test-runtime/wasm/target/wasm32-unknown-unknown/release/substrate_test_runtime.compact.wasm")); diff --git a/substrate/client/src/in_mem.rs b/core/client/src/in_mem.rs similarity index 100% rename from substrate/client/src/in_mem.rs rename to core/client/src/in_mem.rs diff --git a/substrate/client/src/lib.rs b/core/client/src/lib.rs similarity index 90% rename from substrate/client/src/lib.rs rename to core/client/src/lib.rs index 127aafe848bfb..fdf8c3c22bc4e 100644 --- a/substrate/client/src/lib.rs +++ b/core/client/src/lib.rs @@ -20,18 +20,17 @@ #![recursion_limit="128"] extern crate substrate_bft as bft; -extern crate substrate_codec as codec; +extern crate parity_codec as codec; +extern crate substrate_metadata; extern crate substrate_primitives as primitives; -extern crate substrate_runtime_io as runtime_io; -extern crate substrate_runtime_support as runtime_support; -extern crate substrate_runtime_primitives as runtime_primitives; +extern crate sr_io as runtime_io; +extern crate sr_primitives as runtime_primitives; extern crate substrate_state_machine as state_machine; #[cfg(test)] extern crate substrate_keyring as keyring; #[cfg(test)] extern crate substrate_test_client as test_client; #[macro_use] extern crate substrate_telemetry; #[macro_use] extern crate slog; // needed until we can reexport `slog_info` from `substrate_telemetry` -extern crate ed25519; extern crate fnv; extern crate futures; extern crate parking_lot; diff --git a/substrate/client/src/light/backend.rs b/core/client/src/light/backend.rs similarity index 100% rename from substrate/client/src/light/backend.rs rename to core/client/src/light/backend.rs diff --git a/substrate/client/src/light/blockchain.rs b/core/client/src/light/blockchain.rs similarity index 100% rename from substrate/client/src/light/blockchain.rs rename to core/client/src/light/blockchain.rs diff --git a/substrate/client/src/light/call_executor.rs b/core/client/src/light/call_executor.rs similarity index 100% rename from substrate/client/src/light/call_executor.rs rename to core/client/src/light/call_executor.rs diff --git a/substrate/client/src/light/fetcher.rs b/core/client/src/light/fetcher.rs similarity index 100% rename from substrate/client/src/light/fetcher.rs rename to core/client/src/light/fetcher.rs diff --git a/substrate/client/src/light/mod.rs b/core/client/src/light/mod.rs similarity index 100% rename from substrate/client/src/light/mod.rs rename to core/client/src/light/mod.rs diff --git a/substrate/client/src/notifications.rs b/core/client/src/notifications.rs similarity index 100% rename from substrate/client/src/notifications.rs rename to core/client/src/notifications.rs diff --git a/substrate/executor/Cargo.toml b/core/executor/Cargo.toml similarity index 76% rename from substrate/executor/Cargo.toml rename to core/executor/Cargo.toml index 0c4e658740517..9ed88a215ed9c 100644 --- a/substrate/executor/Cargo.toml +++ b/core/executor/Cargo.toml @@ -5,13 +5,12 @@ authors = ["Parity Technologies "] [dependencies] error-chain = "0.12" -substrate-codec = { path = "../codec" } -substrate-runtime-io = { path = "../runtime-io" } +parity-codec = { path = "../../codec" } +sr-io = { path = "../sr-io" } substrate-primitives = { path = "../primitives" } substrate-serializer = { path = "../serializer" } substrate-state-machine = { path = "../state-machine" } -substrate-runtime-version = { path = "../runtime/version" } -ed25519 = { path = "../ed25519" } +sr-version = { path = "../sr-version" } serde = "1.0" serde_derive = "1.0" wasmi = "0.4" diff --git a/substrate/executor/README.adoc b/core/executor/README.adoc similarity index 100% rename from substrate/executor/README.adoc rename to core/executor/README.adoc diff --git a/substrate/executor/src/error.rs b/core/executor/src/error.rs similarity index 100% rename from substrate/executor/src/error.rs rename to core/executor/src/error.rs diff --git a/substrate/executor/src/lib.rs b/core/executor/src/lib.rs similarity index 93% rename from substrate/executor/src/lib.rs rename to core/executor/src/lib.rs index 7898411be47d4..02cdf65c903ce 100644 --- a/substrate/executor/src/lib.rs +++ b/core/executor/src/lib.rs @@ -30,13 +30,12 @@ #![warn(missing_docs)] #![recursion_limit="128"] -extern crate substrate_codec as codec; -extern crate substrate_runtime_io as runtime_io; +extern crate parity_codec as codec; +extern crate sr_io as runtime_io; extern crate substrate_primitives as primitives; extern crate substrate_serializer as serializer; extern crate substrate_state_machine as state_machine; -extern crate substrate_runtime_version as runtime_version; -extern crate ed25519; +extern crate sr_version as runtime_version; extern crate serde; extern crate wasmi; diff --git a/substrate/executor/src/native_executor.rs b/core/executor/src/native_executor.rs similarity index 100% rename from substrate/executor/src/native_executor.rs rename to core/executor/src/native_executor.rs diff --git a/substrate/executor/src/sandbox.rs b/core/executor/src/sandbox.rs similarity index 100% rename from substrate/executor/src/sandbox.rs rename to core/executor/src/sandbox.rs diff --git a/substrate/executor/src/wasm_executor.rs b/core/executor/src/wasm_executor.rs similarity index 97% rename from substrate/executor/src/wasm_executor.rs rename to core/executor/src/wasm_executor.rs index 50488ac285087..70d02d01891c5 100644 --- a/substrate/executor/src/wasm_executor.rs +++ b/core/executor/src/wasm_executor.rs @@ -27,7 +27,7 @@ use wasmi::memory_units::{Pages, Bytes}; use state_machine::Externalities; use error::{Error, ErrorKind, Result}; use wasm_utils::UserError; -use primitives::{blake2_256, twox_128, twox_256}; +use primitives::{blake2_256, twox_128, twox_256, ed25519}; use primitives::hexdisplay::HexDisplay; use primitives::sandbox as sandbox_primitives; use primitives::Blake2Hasher; @@ -173,29 +173,29 @@ impl_function_executor!(this: FunctionExecutor<'e, E>, ext_memcpy(dest: *mut u8, src: *const u8, count: usize) -> *mut u8 => { this.memory.copy_nonoverlapping(src as usize, dest as usize, count as usize) .map_err(|_| UserError("Invalid attempt to copy_nonoverlapping in ext_memcpy"))?; - debug_trace!(target: "runtime-io", "memcpy {} from {}, {} bytes", dest, src, count); + debug_trace!(target: "sr-io", "memcpy {} from {}, {} bytes", dest, src, count); Ok(dest) }, ext_memmove(dest: *mut u8, src: *const u8, count: usize) -> *mut u8 => { this.memory.copy(src as usize, dest as usize, count as usize) .map_err(|_| UserError("Invalid attempt to copy in ext_memmove"))?; - debug_trace!(target: "runtime-io", "memmove {} from {}, {} bytes", dest, src, count); + debug_trace!(target: "sr-io", "memmove {} from {}, {} bytes", dest, src, count); Ok(dest) }, ext_memset(dest: *mut u8, val: u32, count: usize) -> *mut u8 => { - debug_trace!(target: "runtime-io", "memset {} with {}, {} bytes", dest, val, count); + debug_trace!(target: "sr-io", "memset {} with {}, {} bytes", dest, val, count); this.memory.clear(dest as usize, val as u8, count as usize) .map_err(|_| UserError("Invalid attempt to clear in ext_memset"))?; Ok(dest) }, ext_malloc(size: usize) -> *mut u8 => { let r = this.heap.allocate(size); - debug_trace!(target: "runtime-io", "malloc {} bytes at {}", size, r); + debug_trace!(target: "sr-io", "malloc {} bytes at {}", size, r); Ok(r) }, ext_free(addr: *mut u8) => { this.heap.deallocate(addr); - debug_trace!(target: "runtime-io", "free {}", addr); + debug_trace!(target: "sr-io", "free {}", addr); Ok(()) }, ext_set_storage(key_data: *const u8, key_len: u32, value_data: *const u8, value_len: u32) => { @@ -359,7 +359,7 @@ impl_function_executor!(this: FunctionExecutor<'e, E>, this.memory.get_into(pubkey_data, &mut pubkey[..]).map_err(|_| UserError("Invalid attempt to get pubkey in ext_ed25519_verify"))?; let msg = this.memory.get(msg_data, msg_len as usize).map_err(|_| UserError("Invalid attempt to get message in ext_ed25519_verify"))?; - Ok(if ::ed25519::verify(&sig, &msg, &pubkey) { + Ok(if ed25519::verify(&sig, &msg, &pubkey) { 0 } else { 5 @@ -389,7 +389,7 @@ impl_function_executor!(this: FunctionExecutor<'e, E>, ext_sandbox_invoke(instance_idx: u32, export_ptr: *const u8, export_len: usize, args_ptr: *const u8, args_len: usize, return_val_ptr: *const u8, return_val_len: usize, state: usize) -> u32 => { use codec::{Decode, Encode}; - trace!(target: "runtime-sandbox", "invoke, instance_idx={}", instance_idx); + trace!(target: "sr-sandbox", "invoke, instance_idx={}", instance_idx); let export = this.memory.get(export_ptr, export_len as usize) .map_err(|_| UserError("Sandbox error")) .and_then(|b| @@ -684,7 +684,7 @@ mod tests { fn ed25519_verify_should_work() { let mut ext = TestExternalities::default(); let test_code = include_bytes!("../wasm/target/wasm32-unknown-unknown/release/runtime_test.compact.wasm"); - let key = ::ed25519::Pair::from_seed(&blake2_256(b"test")); + let key = ed25519::Pair::from_seed(&blake2_256(b"test")); let sig = key.sign(b"all ok!"); let mut calldata = vec![]; calldata.extend_from_slice(key.public().as_ref()); diff --git a/substrate/executor/src/wasm_utils.rs b/core/executor/src/wasm_utils.rs similarity index 100% rename from substrate/executor/src/wasm_utils.rs rename to core/executor/src/wasm_utils.rs diff --git a/substrate/executor/wasm/Cargo.lock b/core/executor/wasm/Cargo.lock similarity index 94% rename from substrate/executor/wasm/Cargo.lock rename to core/executor/wasm/Cargo.lock index ed26df817ed7b..9ae42e7b30242 100644 --- a/substrate/executor/wasm/Cargo.lock +++ b/core/executor/wasm/Cargo.lock @@ -31,6 +31,22 @@ name = "nodrop" version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "parity-codec" +version = "0.1.0" +dependencies = [ + "arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "parity-codec-derive" +version = "0.1.0" +dependencies = [ + "proc-macro2 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.14.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "plain_hasher" version = "0.2.0" @@ -71,9 +87,9 @@ dependencies = [ name = "runtime-test" version = "0.1.0" dependencies = [ + "sr-io 0.1.0", + "sr-sandbox 0.1.0", "substrate-primitives 0.1.0", - "substrate-runtime-io 0.1.0", - "substrate-runtime-sandbox 0.1.0", ] [[package]] @@ -108,67 +124,51 @@ version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] -name = "substrate-codec" -version = "0.1.0" -dependencies = [ - "arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "substrate-codec-derive" -version = "0.1.0" -dependencies = [ - "proc-macro2 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.14.7 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "substrate-primitives" +name = "sr-io" version = "0.1.0" dependencies = [ - "byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "fixed-hash 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "hashdb 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "plain_hasher 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-hex 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-codec 0.1.0", - "substrate-codec-derive 0.1.0", - "substrate-runtime-std 0.1.0", - "uint 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 0.1.0", + "rustc_version 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-std 0.1.0", + "substrate-primitives 0.1.0", ] [[package]] -name = "substrate-runtime-io" +name = "sr-sandbox" version = "0.1.0" dependencies = [ - "hashdb 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 0.1.0", "rustc_version 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-codec 0.1.0", + "sr-io 0.1.0", + "sr-std 0.1.0", "substrate-primitives 0.1.0", - "substrate-runtime-std 0.1.0", ] [[package]] -name = "substrate-runtime-sandbox" +name = "sr-std" version = "0.1.0" dependencies = [ + "pwasm-alloc 0.1.0", + "pwasm-libc 0.1.0", "rustc_version 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-codec 0.1.0", - "substrate-primitives 0.1.0", - "substrate-runtime-io 0.1.0", - "substrate-runtime-std 0.1.0", ] [[package]] -name = "substrate-runtime-std" +name = "substrate-primitives" version = "0.1.0" dependencies = [ - "pwasm-alloc 0.1.0", - "pwasm-libc 0.1.0", - "rustc_version 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "fixed-hash 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "hashdb 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 0.1.0", + "parity-codec-derive 0.1.0", + "plain_hasher 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-hex 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-std 0.1.0", + "uint 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] diff --git a/substrate/executor/wasm/Cargo.toml b/core/executor/wasm/Cargo.toml similarity index 59% rename from substrate/executor/wasm/Cargo.toml rename to core/executor/wasm/Cargo.toml index 44e0dafe5d995..6c650e9463015 100644 --- a/substrate/executor/wasm/Cargo.toml +++ b/core/executor/wasm/Cargo.toml @@ -7,8 +7,8 @@ authors = ["Parity Technologies "] crate-type = ["cdylib"] [dependencies] -substrate-runtime-io = { path = "../../runtime-io", version = "0.1", default_features = false } -substrate-runtime-sandbox = { path = "../../runtime-sandbox", version = "0.1", default_features = false } +sr-io = { path = "../../sr-io", version = "0.1", default_features = false } +sr-sandbox = { path = "../../sr-sandbox", version = "0.1", default_features = false } substrate-primitives = { path = "../../primitives", default_features = false } [profile.release] diff --git a/substrate/executor/wasm/build.sh b/core/executor/wasm/build.sh similarity index 100% rename from substrate/executor/wasm/build.sh rename to core/executor/wasm/build.sh diff --git a/substrate/executor/wasm/src/lib.rs b/core/executor/wasm/src/lib.rs similarity index 97% rename from substrate/executor/wasm/src/lib.rs rename to core/executor/wasm/src/lib.rs index 3046fd1f166ca..3bec626091f9e 100644 --- a/substrate/executor/wasm/src/lib.rs +++ b/core/executor/wasm/src/lib.rs @@ -7,8 +7,8 @@ extern crate alloc; use alloc::vec::Vec; #[macro_use] -extern crate substrate_runtime_io as runtime_io; -extern crate substrate_runtime_sandbox as sandbox; +extern crate sr_io as runtime_io; +extern crate sr_sandbox as sandbox; extern crate substrate_primitives; use runtime_io::{ diff --git a/substrate/extrinsic-pool/Cargo.toml b/core/extrinsic-pool/Cargo.toml similarity index 52% rename from substrate/extrinsic-pool/Cargo.toml rename to core/extrinsic-pool/Cargo.toml index ba62e6a382e0f..9de07854a2e53 100644 --- a/substrate/extrinsic-pool/Cargo.toml +++ b/core/extrinsic-pool/Cargo.toml @@ -11,9 +11,9 @@ futures = "0.1" log = "0.3" parking_lot = "0.4" transaction-pool = "1.13.2" -substrate-runtime-primitives = { path = "../../substrate/runtime/primitives" } +sr-primitives = { path = "../../core/sr-primitives" } [dev-dependencies] -substrate-test-client = { path = "../../substrate/test-client" } -substrate-keyring = { path = "../../substrate/keyring" } -substrate-codec = { path = "../../substrate/codec" } +substrate-test-client = { path = "../../core/test-client" } +substrate-keyring = { path = "../../core/keyring" } +parity-codec = { path = "../../codec" } diff --git a/substrate/extrinsic-pool/README.adoc b/core/extrinsic-pool/README.adoc similarity index 100% rename from substrate/extrinsic-pool/README.adoc rename to core/extrinsic-pool/README.adoc diff --git a/substrate/extrinsic-pool/src/error.rs b/core/extrinsic-pool/src/error.rs similarity index 100% rename from substrate/extrinsic-pool/src/error.rs rename to core/extrinsic-pool/src/error.rs diff --git a/substrate/extrinsic-pool/src/lib.rs b/core/extrinsic-pool/src/lib.rs similarity index 92% rename from substrate/extrinsic-pool/src/lib.rs rename to core/extrinsic-pool/src/lib.rs index bcd2b03c80e00..f7c6c4bfd2f26 100644 --- a/substrate/extrinsic-pool/src/lib.rs +++ b/core/extrinsic-pool/src/lib.rs @@ -23,7 +23,7 @@ extern crate futures; extern crate parking_lot; -extern crate substrate_runtime_primitives as runtime_primitives; +extern crate sr_primitives as runtime_primitives; #[macro_use] extern crate log; @@ -33,7 +33,7 @@ extern crate serde_derive; extern crate transaction_pool as txpool; #[cfg(test)] extern crate substrate_test_client as test_client; #[cfg(test)] extern crate substrate_keyring as keyring; -#[cfg(test)] extern crate substrate_codec as codec; +#[cfg(test)] extern crate parity_codec as codec; pub mod watcher; mod error; diff --git a/substrate/extrinsic-pool/src/listener.rs b/core/extrinsic-pool/src/listener.rs similarity index 100% rename from substrate/extrinsic-pool/src/listener.rs rename to core/extrinsic-pool/src/listener.rs diff --git a/substrate/extrinsic-pool/src/pool.rs b/core/extrinsic-pool/src/pool.rs similarity index 100% rename from substrate/extrinsic-pool/src/pool.rs rename to core/extrinsic-pool/src/pool.rs diff --git a/substrate/extrinsic-pool/src/rotator.rs b/core/extrinsic-pool/src/rotator.rs similarity index 100% rename from substrate/extrinsic-pool/src/rotator.rs rename to core/extrinsic-pool/src/rotator.rs diff --git a/substrate/extrinsic-pool/src/watcher.rs b/core/extrinsic-pool/src/watcher.rs similarity index 100% rename from substrate/extrinsic-pool/src/watcher.rs rename to core/extrinsic-pool/src/watcher.rs diff --git a/substrate/keyring/Cargo.toml b/core/keyring/Cargo.toml similarity index 79% rename from substrate/keyring/Cargo.toml rename to core/keyring/Cargo.toml index 69bd55a6f3e24..04d6c2bd134bf 100644 --- a/substrate/keyring/Cargo.toml +++ b/core/keyring/Cargo.toml @@ -4,6 +4,6 @@ version = "0.1.0" authors = ["Parity Technologies "] [dependencies] -ed25519 = { path = "../ed25519" } +substrate-primitives = { path = "../primitives" } hex-literal = { version = "0.1.0" } lazy_static = { version = "1.0" } diff --git a/substrate/keyring/README.adoc b/core/keyring/README.adoc similarity index 100% rename from substrate/keyring/README.adoc rename to core/keyring/README.adoc diff --git a/substrate/keyring/src/lib.rs b/core/keyring/src/lib.rs similarity index 96% rename from substrate/keyring/src/lib.rs rename to core/keyring/src/lib.rs index 6f0270c9d4de9..33869ae7ad8ac 100644 --- a/substrate/keyring/src/lib.rs +++ b/core/keyring/src/lib.rs @@ -20,11 +20,12 @@ #[macro_use] extern crate hex_literal; #[macro_use] extern crate lazy_static; -pub extern crate ed25519; +extern crate substrate_primitives; use std::collections::HashMap; use std::ops::Deref; -use ed25519::{Pair, Public, Signature}; +use substrate_primitives::ed25519::{Pair, Public, Signature}; +pub use substrate_primitives::ed25519; /// Set of test accounts. #[derive(Clone, Copy, PartialEq, Eq, Hash)] diff --git a/substrate/keystore/Cargo.toml b/core/keystore/Cargo.toml similarity index 91% rename from substrate/keystore/Cargo.toml rename to core/keystore/Cargo.toml index eb1da7e02061b..7ec5444e417bd 100644 --- a/substrate/keystore/Cargo.toml +++ b/core/keystore/Cargo.toml @@ -6,7 +6,6 @@ authors = ["Parity Technologies "] [dependencies] substrate-primitives = { path = "../primitives" } parity-crypto = { version = "0.1", default_features = false } -ed25519 = { path = "../ed25519" } error-chain = "0.12" hex = "0.3" rand = "0.4" diff --git a/substrate/keystore/README.adoc b/core/keystore/README.adoc similarity index 100% rename from substrate/keystore/README.adoc rename to core/keystore/README.adoc diff --git a/substrate/keystore/src/lib.rs b/core/keystore/src/lib.rs similarity index 98% rename from substrate/keystore/src/lib.rs rename to core/keystore/src/lib.rs index 5686e637371b7..f3eeb4be3f81f 100644 --- a/substrate/keystore/src/lib.rs +++ b/core/keystore/src/lib.rs @@ -21,7 +21,6 @@ extern crate substrate_primitives; extern crate parity_crypto as crypto; extern crate subtle; -extern crate ed25519; extern crate rand; extern crate serde_json; extern crate serde; @@ -41,8 +40,7 @@ use std::path::PathBuf; use std::fs::{self, File}; use std::io::{self, Write}; -use substrate_primitives::hashing::blake2_256; -use ed25519::{Pair, Public, PKCS_LEN}; +use substrate_primitives::{hashing::blake2_256, ed25519::{Pair, Public, PKCS_LEN}}; pub use crypto::KEY_ITERATIONS; diff --git a/core/metadata/Cargo.toml b/core/metadata/Cargo.toml new file mode 100644 index 0000000000000..f3d068c08bd1e --- /dev/null +++ b/core/metadata/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "substrate-metadata" +version = "0.1.0" +authors = ["Parity Technologies "] + +[dependencies] +parity-codec = { path = "../../codec", default_features = false } + +[features] +default = ["std"] +std = [ + "parity-codec/std" +] diff --git a/substrate/ed25519/README.adoc b/core/metadata/README.adoc similarity index 88% rename from substrate/ed25519/README.adoc rename to core/metadata/README.adoc index 97c10769ee902..8f4939087eed7 100644 --- a/substrate/ed25519/README.adoc +++ b/core/metadata/README.adoc @@ -1,5 +1,5 @@ -= ED25519 += Substrate BFT .Summary [source, toml] diff --git a/core/metadata/src/lib.rs b/core/metadata/src/lib.rs new file mode 100644 index 0000000000000..926740892528c --- /dev/null +++ b/core/metadata/src/lib.rs @@ -0,0 +1,190 @@ +// Copyright 2017 Parity Technologies (UK) Ltd. +// This file is part of Substrate. + +// Substrate 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. + +// Substrate 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 Substrate. If not, see . + +//! Decodable variant of the JsonMetadata. +//! +//! This really doesn't belong here, but is necessary for the moment. In the future +//! it should be removed entirely to an external module for shimming on to the +//! codec-encoded metadata. + +#![cfg_attr(not(feature = "std"), no_std)] + +extern crate parity_codec as codec; + +use codec::{Encode, Output}; +#[cfg(feature = "std")] +use codec::{Decode, Input}; + +/// The metadata of a runtime encoded as JSON. +#[derive(Eq)] +#[cfg_attr(feature = "std", derive(Debug))] +pub enum JsonMetadata { + Events { name: &'static str, events: &'static [(&'static str, fn() -> &'static str)] }, + Module { module: &'static str, prefix: &'static str }, + ModuleWithStorage { module: &'static str, prefix: &'static str, storage: &'static str } +} + +impl Encode for JsonMetadata { + fn encode_to(&self, dest: &mut W) { + match self { + JsonMetadata::Events { name, events } => { + 0i8.encode_to(dest); + name.encode_to(dest); + events.iter().fold(0u32, |count, _| count + 1).encode_to(dest); + events + .iter() + .map(|(module, data)| (module, data())) + .for_each(|val| val.encode_to(dest)); + }, + JsonMetadata::Module { module, prefix } => { + 1i8.encode_to(dest); + prefix.encode_to(dest); + module.encode_to(dest); + }, + JsonMetadata::ModuleWithStorage { module, prefix, storage } => { + 2i8.encode_to(dest); + prefix.encode_to(dest); + module.encode_to(dest); + storage.encode_to(dest); + } + } + } +} + +impl PartialEq for JsonMetadata { + fn eq(&self, other: &JsonMetadata) -> bool { + match (self, other) { + ( + JsonMetadata::Events { name: lname, events: left }, + JsonMetadata::Events { name: rname, events: right } + ) => { + lname == rname && left.iter().zip(right.iter()).fold(true, |res, (l, r)| { + res && l.0 == r.0 && l.1() == r.1() + }) + }, + ( + JsonMetadata::Module { prefix: lpre, module: lmod }, + JsonMetadata::Module { prefix: rpre, module: rmod } + ) => { + lpre == rpre && lmod == rmod + }, + ( + JsonMetadata::ModuleWithStorage { prefix: lpre, module: lmod, storage: lstore }, + JsonMetadata::ModuleWithStorage { prefix: rpre, module: rmod, storage: rstore } + ) => { + lpre == rpre && lmod == rmod && lstore == rstore + }, + _ => false, + } + } +} + +/// Utility struct for making `JsonMetadata` decodeable. +#[derive(Eq, PartialEq, Debug)] +#[cfg(feature = "std")] +pub enum JsonMetadataDecodable { + Events { name: String, events: Vec<(String, String)> }, + Module { module: String, prefix: String }, + ModuleWithStorage { module: String, prefix: String, storage: String } +} + +#[cfg(feature = "std")] +impl JsonMetadataDecodable { + /// Returns the instance as JSON string. + /// The first value of the tuple is the name of the metadata type and the second in the JSON string. + pub fn into_json_string(self) -> (&'static str, String) { + match self { + JsonMetadataDecodable::Events { name, events } => { + ( + "events", + format!( + r#"{{ "name": "{}", "events": {{ {} }} }}"#, name, + events.iter().enumerate() + .fold(String::from(""), |mut json, (i, (name, data))| { + if i > 0 { + json.push_str(", "); + } + json.push_str(&format!(r#""{}": {}"#, name, data)); + json + }) + ) + ) + }, + JsonMetadataDecodable::Module { prefix, module } => { + ("module", format!(r#"{{ "prefix": "{}", "module": {} }}"#, prefix, module)) + }, + JsonMetadataDecodable::ModuleWithStorage { prefix, module, storage } => { + ( + "moduleWithStorage", + format!( + r#"{{ "prefix": "{}", "module": {}, "storage": {} }}"#, + prefix, module, storage + ) + ) + } + } + } +} + +#[cfg(feature = "std")] +impl Decode for JsonMetadataDecodable { + fn decode(input: &mut I) -> Option { + i8::decode(input).and_then(|variant| { + match variant { + 0 => String::decode(input) + .and_then(|name| Vec::<(String, String)>::decode(input).map(|events| (name, events))) + .and_then(|(name, events)| Some(JsonMetadataDecodable::Events { name, events })), + 1 => String::decode(input) + .and_then(|prefix| String::decode(input).map(|v| (prefix, v))) + .and_then(|(prefix, module)| Some(JsonMetadataDecodable::Module { prefix, module })), + 2 => String::decode(input) + .and_then(|prefix| String::decode(input).map(|v| (prefix, v))) + .and_then(|(prefix, module)| String::decode(input).map(|v| (prefix, module, v))) + .and_then(|(prefix, module, storage)| Some(JsonMetadataDecodable::ModuleWithStorage { prefix, module, storage })), + _ => None, + } + }) + } +} + +#[cfg(feature = "std")] +impl PartialEq for JsonMetadataDecodable { + fn eq(&self, other: &JsonMetadata) -> bool { + match (self, other) { + ( + JsonMetadataDecodable::Events { name: lname, events: left }, + JsonMetadata::Events { name: rname, events: right } + ) => { + lname == rname && left.iter().zip(right.iter()).fold(true, |res, (l, r)| { + res && l.0 == r.0 && l.1 == r.1() + }) + }, + ( + JsonMetadataDecodable::Module { prefix: lpre, module: lmod }, + JsonMetadata::Module { prefix: rpre, module: rmod } + ) => { + lpre == rpre && lmod == rmod + }, + ( + JsonMetadataDecodable::ModuleWithStorage { prefix: lpre, module: lmod, storage: lstore }, + JsonMetadata::ModuleWithStorage { prefix: rpre, module: rmod, storage: rstore } + ) => { + lpre == rpre && lmod == rmod && lstore == rstore + }, + _ => false, + } + } +} diff --git a/substrate/misbehavior-check/Cargo.toml b/core/misbehavior-check/Cargo.toml similarity index 50% rename from substrate/misbehavior-check/Cargo.toml rename to core/misbehavior-check/Cargo.toml index aa726c18b18db..3ae60d2d30f2f 100644 --- a/substrate/misbehavior-check/Cargo.toml +++ b/core/misbehavior-check/Cargo.toml @@ -4,10 +4,10 @@ version = "0.1.0" authors = ["Parity Technologies "] [dependencies] -substrate-codec = { path = "../codec", default-features = false } +parity-codec = { path = "../../codec", default-features = false } substrate-primitives = { path = "../primitives", default-features = false } -substrate-runtime-primitives = { path = "../runtime/primitives", default-features = false } -substrate-runtime-io = { path = "../runtime-io", default-features = false } +sr-primitives = { path = "../sr-primitives", default-features = false } +sr-io = { path = "../sr-io", default-features = false } [dev-dependencies] substrate-bft = { path = "../bft" } @@ -16,4 +16,4 @@ substrate-keyring = { path = "../keyring" } [features] default = ["std"] -std = ["substrate-codec/std", "substrate-primitives/std", "substrate-runtime-primitives/std", "substrate-runtime-io/std"] +std = ["parity-codec/std", "substrate-primitives/std", "sr-primitives/std", "sr-io/std"] diff --git a/substrate/misbehavior-check/README.adoc b/core/misbehavior-check/README.adoc similarity index 100% rename from substrate/misbehavior-check/README.adoc rename to core/misbehavior-check/README.adoc diff --git a/substrate/misbehavior-check/src/lib.rs b/core/misbehavior-check/src/lib.rs similarity index 97% rename from substrate/misbehavior-check/src/lib.rs rename to core/misbehavior-check/src/lib.rs index eff87ab1e5efb..69ddb525400d3 100644 --- a/substrate/misbehavior-check/src/lib.rs +++ b/core/misbehavior-check/src/lib.rs @@ -20,10 +20,10 @@ #![cfg_attr(not(feature = "std"), no_std)] -extern crate substrate_codec as codec; +extern crate parity_codec as codec; extern crate substrate_primitives as primitives; -extern crate substrate_runtime_io as runtime_io; -extern crate substrate_runtime_primitives as runtime_primitives; +extern crate sr_io as runtime_io; +extern crate sr_primitives as runtime_primitives; #[cfg(test)] extern crate substrate_bft; diff --git a/substrate/network-libp2p/Cargo.toml b/core/network-libp2p/Cargo.toml similarity index 100% rename from substrate/network-libp2p/Cargo.toml rename to core/network-libp2p/Cargo.toml diff --git a/substrate/network-libp2p/README.adoc b/core/network-libp2p/README.adoc similarity index 100% rename from substrate/network-libp2p/README.adoc rename to core/network-libp2p/README.adoc diff --git a/substrate/network-libp2p/src/connection_filter.rs b/core/network-libp2p/src/connection_filter.rs similarity index 100% rename from substrate/network-libp2p/src/connection_filter.rs rename to core/network-libp2p/src/connection_filter.rs diff --git a/substrate/network-libp2p/src/custom_proto.rs b/core/network-libp2p/src/custom_proto.rs similarity index 99% rename from substrate/network-libp2p/src/custom_proto.rs rename to core/network-libp2p/src/custom_proto.rs index 72807f21e8f2e..b6c3d5c5d354d 100644 --- a/substrate/network-libp2p/src/custom_proto.rs +++ b/core/network-libp2p/src/custom_proto.rs @@ -72,7 +72,7 @@ impl RegisteredProtocol { /// passed inside the `RegisteredProtocolOutput`. pub fn new(custom_data: T, protocol: ProtocolId, versions: &[(u8, u8)]) -> Self { - let mut proto_name = Bytes::from_static(b"/substrate/"); + let mut proto_name = Bytes::from_static(b"/core/"); proto_name.extend_from_slice(&protocol); proto_name.extend_from_slice(b"/"); diff --git a/substrate/network-libp2p/src/error.rs b/core/network-libp2p/src/error.rs similarity index 100% rename from substrate/network-libp2p/src/error.rs rename to core/network-libp2p/src/error.rs diff --git a/substrate/network-libp2p/src/lib.rs b/core/network-libp2p/src/lib.rs similarity index 100% rename from substrate/network-libp2p/src/lib.rs rename to core/network-libp2p/src/lib.rs diff --git a/substrate/network-libp2p/src/network_state.rs b/core/network-libp2p/src/network_state.rs similarity index 100% rename from substrate/network-libp2p/src/network_state.rs rename to core/network-libp2p/src/network_state.rs diff --git a/substrate/network-libp2p/src/service.rs b/core/network-libp2p/src/service.rs similarity index 99% rename from substrate/network-libp2p/src/service.rs rename to core/network-libp2p/src/service.rs index 4e82973893240..1f6f54a979624 100644 --- a/substrate/network-libp2p/src/service.rs +++ b/core/network-libp2p/src/service.rs @@ -630,9 +630,9 @@ fn listener_handle<'a, C>( sender.send( IdentifyInfo { public_key: shared.network_state.local_public_key().clone(), - protocol_version: concat!("substrate/", + protocol_version: concat!("core/", env!("CARGO_PKG_VERSION")).to_owned(), // TODO: ? - agent_version: concat!("substrate/", + agent_version: concat!("core/", env!("CARGO_PKG_VERSION")).to_owned(), listen_addrs: shared.listened_addrs.read().clone(), protocols: Vec::new(), // TODO: protocols_to_report, @@ -771,7 +771,7 @@ fn build_kademlia_response( } /// Handles a newly-opened connection to a remote with a custom protocol -/// (eg. `/substrate/dot/0`). +/// (eg. `/core/dot/0`). /// Returns a future that corresponds to when the handling is finished. fn handle_custom_connection( shared: Arc, diff --git a/substrate/network-libp2p/src/timeouts.rs b/core/network-libp2p/src/timeouts.rs similarity index 100% rename from substrate/network-libp2p/src/timeouts.rs rename to core/network-libp2p/src/timeouts.rs diff --git a/substrate/network-libp2p/src/topology.rs b/core/network-libp2p/src/topology.rs similarity index 100% rename from substrate/network-libp2p/src/topology.rs rename to core/network-libp2p/src/topology.rs diff --git a/substrate/network-libp2p/src/traits.rs b/core/network-libp2p/src/traits.rs similarity index 100% rename from substrate/network-libp2p/src/traits.rs rename to core/network-libp2p/src/traits.rs diff --git a/substrate/network-libp2p/src/transport.rs b/core/network-libp2p/src/transport.rs similarity index 100% rename from substrate/network-libp2p/src/transport.rs rename to core/network-libp2p/src/transport.rs diff --git a/substrate/network-libp2p/tests/tests.rs b/core/network-libp2p/tests/tests.rs similarity index 100% rename from substrate/network-libp2p/tests/tests.rs rename to core/network-libp2p/tests/tests.rs diff --git a/core/network/Cargo.toml b/core/network/Cargo.toml new file mode 100644 index 0000000000000..0e4364b1ff967 --- /dev/null +++ b/core/network/Cargo.toml @@ -0,0 +1,29 @@ +[package] +description = "Polkadot network protocol" +name = "substrate-network" +version = "0.1.0" +license = "GPL-3.0" +authors = ["Parity Technologies "] + +[lib] + +[dependencies] +log = "0.3" +parking_lot = "0.4" +error-chain = "0.12" +bitflags = "1.0" +futures = "0.1.17" +linked-hash-map = "0.5" +rustc-hex = "1.0" +ethcore-io = { git = "https://github.com/paritytech/parity.git" } +substrate-primitives = { path = "../../core/primitives" } +substrate-client = { path = "../../core/client" } +sr-primitives = { path = "../../core/sr-primitives" } +parity-codec = { path = "../../codec" } +parity-codec-derive = { path = "../../codec/derive" } +substrate-network-libp2p = { path = "../../core/network-libp2p" } + +[dev-dependencies] +env_logger = "0.4" +substrate-keyring = { path = "../../core/keyring" } +substrate-test-client = { path = "../../core/test-client" } diff --git a/substrate/network/README.adoc b/core/network/README.adoc similarity index 100% rename from substrate/network/README.adoc rename to core/network/README.adoc diff --git a/substrate/network/src/blocks.rs b/core/network/src/blocks.rs similarity index 100% rename from substrate/network/src/blocks.rs rename to core/network/src/blocks.rs diff --git a/substrate/network/src/chain.rs b/core/network/src/chain.rs similarity index 100% rename from substrate/network/src/chain.rs rename to core/network/src/chain.rs diff --git a/substrate/network/src/config.rs b/core/network/src/config.rs similarity index 100% rename from substrate/network/src/config.rs rename to core/network/src/config.rs diff --git a/substrate/network/src/consensus_gossip.rs b/core/network/src/consensus_gossip.rs similarity index 100% rename from substrate/network/src/consensus_gossip.rs rename to core/network/src/consensus_gossip.rs diff --git a/substrate/network/src/error.rs b/core/network/src/error.rs similarity index 100% rename from substrate/network/src/error.rs rename to core/network/src/error.rs diff --git a/substrate/network/src/import_queue.rs b/core/network/src/import_queue.rs similarity index 100% rename from substrate/network/src/import_queue.rs rename to core/network/src/import_queue.rs diff --git a/substrate/network/src/io.rs b/core/network/src/io.rs similarity index 100% rename from substrate/network/src/io.rs rename to core/network/src/io.rs diff --git a/substrate/network/src/lib.rs b/core/network/src/lib.rs similarity index 93% rename from substrate/network/src/lib.rs rename to core/network/src/lib.rs index 14d3d82da5dbc..996504889dc9d 100644 --- a/substrate/network/src/lib.rs +++ b/core/network/src/lib.rs @@ -27,16 +27,15 @@ extern crate linked_hash_map; extern crate parking_lot; extern crate substrate_primitives as primitives; extern crate substrate_client as client; -extern crate substrate_runtime_primitives as runtime_primitives; +extern crate sr_primitives as runtime_primitives; extern crate substrate_network_libp2p as network_libp2p; -extern crate substrate_codec as codec; +extern crate parity_codec as codec; extern crate futures; -extern crate ed25519; extern crate rustc_hex; #[macro_use] extern crate log; #[macro_use] extern crate bitflags; #[macro_use] extern crate error_chain; -#[macro_use] extern crate substrate_codec_derive; +#[macro_use] extern crate parity_codec_derive; #[cfg(test)] extern crate env_logger; #[cfg(test)] extern crate substrate_keyring as keyring; diff --git a/substrate/network/src/message.rs b/core/network/src/message.rs similarity index 99% rename from substrate/network/src/message.rs rename to core/network/src/message.rs index 875529f0fe923..3bb080e13354d 100644 --- a/substrate/network/src/message.rs +++ b/core/network/src/message.rs @@ -147,9 +147,8 @@ pub struct RemoteReadResponse { /// Generic types. pub mod generic { - use primitives::AuthorityId; + use primitives::{AuthorityId, ed25519}; use runtime_primitives::bft::Justification; - use ed25519; use service::Roles; use super::{ BlockAttributes, RemoteCallResponse, RemoteReadResponse, diff --git a/substrate/network/src/on_demand.rs b/core/network/src/on_demand.rs similarity index 100% rename from substrate/network/src/on_demand.rs rename to core/network/src/on_demand.rs diff --git a/substrate/network/src/protocol.rs b/core/network/src/protocol.rs similarity index 100% rename from substrate/network/src/protocol.rs rename to core/network/src/protocol.rs diff --git a/substrate/network/src/service.rs b/core/network/src/service.rs similarity index 100% rename from substrate/network/src/service.rs rename to core/network/src/service.rs diff --git a/substrate/network/src/specialization.rs b/core/network/src/specialization.rs similarity index 100% rename from substrate/network/src/specialization.rs rename to core/network/src/specialization.rs diff --git a/substrate/network/src/sync.rs b/core/network/src/sync.rs similarity index 100% rename from substrate/network/src/sync.rs rename to core/network/src/sync.rs diff --git a/substrate/network/src/test/mod.rs b/core/network/src/test/mod.rs similarity index 100% rename from substrate/network/src/test/mod.rs rename to core/network/src/test/mod.rs diff --git a/substrate/network/src/test/sync.rs b/core/network/src/test/sync.rs similarity index 100% rename from substrate/network/src/test/sync.rs rename to core/network/src/test/sync.rs diff --git a/substrate/primitives/Cargo.toml b/core/primitives/Cargo.toml similarity index 73% rename from substrate/primitives/Cargo.toml rename to core/primitives/Cargo.toml index 206bb24c5626a..5b28fcfb3e463 100644 --- a/substrate/primitives/Cargo.toml +++ b/core/primitives/Cargo.toml @@ -5,9 +5,9 @@ authors = ["Parity Technologies "] [dependencies] crunchy = "0.1" -substrate-runtime-std = { path = "../runtime-std", default_features = false } -substrate-codec = { path = "../codec", default_features = false } -substrate-codec-derive = { path = "../codec/derive", default_features = false } +sr-std = { path = "../sr-std", default_features = false } +parity-codec = { path = "../../codec", default_features = false } +parity-codec-derive = { path = "../../codec/derive", default_features = false } elastic-array = {version = "0.10", optional = true } fixed-hash = { version = "0.2.2", default_features = false } rustc-hex = { version = "2.0", default_features = false } @@ -21,7 +21,10 @@ wasmi = { version = "0.4", optional = true } hashdb = { version = "0.2.1", default_features = false } patricia-trie = { version = "0.2.1", optional = true } plain_hasher = { version = "0.2", default_features = false } - +ring = { version = "0.12", optional = true } +untrusted = { version = "0.5", optional = true } +hex-literal = { version = "0.1", optional = true } +base58 = { version = "0.1", optional = true } blake2-rfc = { version = "0.2.18", optional = true } [dev-dependencies] @@ -37,12 +40,16 @@ std = [ "fixed-hash/std", "fixed-hash/heapsizeof", "fixed-hash/libc", - "substrate-codec/std", - "substrate-runtime-std/std", + "parity-codec/std", + "sr-std/std", "serde/std", "rustc-hex/std", "twox-hash", "blake2-rfc", + "ring", + "untrusted", + "hex-literal", + "base58", "serde_derive", "byteorder/std", "patricia-trie", diff --git a/substrate/primitives/README.adoc b/core/primitives/README.adoc similarity index 100% rename from substrate/primitives/README.adoc rename to core/primitives/README.adoc diff --git a/substrate/primitives/src/authority_id.rs b/core/primitives/src/authority_id.rs similarity index 100% rename from substrate/primitives/src/authority_id.rs rename to core/primitives/src/authority_id.rs diff --git a/substrate/primitives/src/bytes.rs b/core/primitives/src/bytes.rs similarity index 100% rename from substrate/primitives/src/bytes.rs rename to core/primitives/src/bytes.rs diff --git a/substrate/ed25519/src/lib.rs b/core/primitives/src/ed25519.rs similarity index 95% rename from substrate/ed25519/src/lib.rs rename to core/primitives/src/ed25519.rs index a7f419f47842c..7a95e4307c04c 100644 --- a/substrate/ed25519/src/lib.rs +++ b/core/primitives/src/ed25519.rs @@ -18,20 +18,12 @@ //! Simple Ed25519 API. // end::description[] -extern crate ring; -extern crate base58; -extern crate substrate_primitives as primitives; -extern crate untrusted; -extern crate blake2_rfc; - +use untrusted; +use blake2_rfc; use ring::{rand, signature}; -use primitives::{hash::H512, AuthorityId}; +use {hash::H512, AuthorityId}; use base58::{ToBase58, FromBase58}; -#[cfg(test)] -#[macro_use] -extern crate hex_literal; - /// Alias to 512-bit hash when used in the context of a signature on the relay chain. pub type Signature = H512; @@ -72,11 +64,16 @@ impl ::std::hash::Hash for Public { } } +/// An error type for SS58 decoding. #[derive(Clone, Copy, Eq, PartialEq, Debug)] pub enum PublicError { + /// Bad alphabet. BadBase58, + /// Bad length. BadLength, + /// Unknown version. UnknownVersion, + /// Invalid checksum. InvalidChecksum, } @@ -189,7 +186,7 @@ impl ::std::fmt::Display for Public { impl ::std::fmt::Debug for Public { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { let s = self.to_ss58check(); - write!(f, "{} ({}...)", ::primitives::hexdisplay::HexDisplay::from(&self.0), &s[0..8]) + write!(f, "{} ({}...)", ::hexdisplay::HexDisplay::from(&self.0), &s[0..8]) } } @@ -261,6 +258,7 @@ pub fn verify_strong>(sig: &Signature, message: &[u8], pubkey: } } +/// Something that acts as a signature allowing a message to be verified. pub trait Verifiable { /// Verify something that acts like a signature. fn verify>(&self, message: &[u8], pubkey: P) -> bool; @@ -285,7 +283,7 @@ mod test { fn _test_primitives_signature_and_local_the_same() { fn takes_two(_: T, _: T) { } - takes_two(Signature::default(), primitives::Signature::default()) + takes_two(Signature::default(), ::Signature::default()) } #[test] @@ -310,7 +308,7 @@ mod test { #[test] fn seeded_pair_should_work() { - use primitives::hexdisplay::HexDisplay; + use ::hexdisplay::HexDisplay; let pair = Pair::from_seed(b"12345678901234567890123456789012"); let public = pair.public(); diff --git a/substrate/primitives/src/hash.rs b/core/primitives/src/hash.rs similarity index 100% rename from substrate/primitives/src/hash.rs rename to core/primitives/src/hash.rs diff --git a/substrate/primitives/src/hasher.rs b/core/primitives/src/hasher.rs similarity index 100% rename from substrate/primitives/src/hasher.rs rename to core/primitives/src/hasher.rs diff --git a/substrate/primitives/src/hashing.rs b/core/primitives/src/hashing.rs similarity index 100% rename from substrate/primitives/src/hashing.rs rename to core/primitives/src/hashing.rs diff --git a/substrate/primitives/src/hexdisplay.rs b/core/primitives/src/hexdisplay.rs similarity index 100% rename from substrate/primitives/src/hexdisplay.rs rename to core/primitives/src/hexdisplay.rs diff --git a/substrate/primitives/src/lib.rs b/core/primitives/src/lib.rs similarity index 90% rename from substrate/primitives/src/lib.rs rename to core/primitives/src/lib.rs index 5fddf350d811f..c5fc9c07f62ce 100644 --- a/substrate/primitives/src/lib.rs +++ b/core/primitives/src/lib.rs @@ -30,11 +30,11 @@ extern crate fixed_hash; #[macro_use] extern crate uint as uint_crate; #[macro_use] -extern crate substrate_codec_derive; +extern crate parity_codec_derive; extern crate rustc_hex; extern crate byteorder; -extern crate substrate_codec as codec; +extern crate parity_codec as codec; #[cfg(feature = "std")] extern crate rlp; @@ -45,6 +45,15 @@ extern crate twox_hash; #[cfg(feature = "std")] extern crate blake2_rfc; +#[cfg(feature = "std")] +extern crate ring; +#[cfg(feature = "std")] +extern crate base58; +#[cfg(feature = "std")] +extern crate untrusted; +#[cfg(test)] +#[macro_use] +extern crate hex_literal; #[cfg(feature = "std")] #[macro_use] @@ -60,7 +69,7 @@ extern crate patricia_trie; #[cfg(feature = "std")] extern crate elastic_array; -extern crate substrate_runtime_std as rstd; +extern crate sr_std as rstd; #[cfg(test)] extern crate substrate_serializer; @@ -90,6 +99,8 @@ pub mod hashing; pub use hashing::{blake2_256, twox_128, twox_256}; #[cfg(feature = "std")] pub mod hexdisplay; +#[cfg(feature = "std")] +pub mod ed25519; pub mod u32_trait; diff --git a/substrate/primitives/src/rlp_codec.rs b/core/primitives/src/rlp_codec.rs similarity index 100% rename from substrate/primitives/src/rlp_codec.rs rename to core/primitives/src/rlp_codec.rs diff --git a/substrate/primitives/src/sandbox.rs b/core/primitives/src/sandbox.rs similarity index 100% rename from substrate/primitives/src/sandbox.rs rename to core/primitives/src/sandbox.rs diff --git a/substrate/primitives/src/storage.rs b/core/primitives/src/storage.rs similarity index 100% rename from substrate/primitives/src/storage.rs rename to core/primitives/src/storage.rs diff --git a/substrate/primitives/src/tests.rs b/core/primitives/src/tests.rs similarity index 100% rename from substrate/primitives/src/tests.rs rename to core/primitives/src/tests.rs diff --git a/substrate/primitives/src/u32_trait.rs b/core/primitives/src/u32_trait.rs similarity index 100% rename from substrate/primitives/src/u32_trait.rs rename to core/primitives/src/u32_trait.rs diff --git a/substrate/primitives/src/uint.rs b/core/primitives/src/uint.rs similarity index 100% rename from substrate/primitives/src/uint.rs rename to core/primitives/src/uint.rs diff --git a/substrate/rpc-servers/Cargo.toml b/core/rpc-servers/Cargo.toml similarity index 88% rename from substrate/rpc-servers/Cargo.toml rename to core/rpc-servers/Cargo.toml index 6b7038d44a628..56a9c62006b21 100644 --- a/substrate/rpc-servers/Cargo.toml +++ b/core/rpc-servers/Cargo.toml @@ -11,4 +11,4 @@ jsonrpc-ws-server = { git = "https://github.com/paritytech/jsonrpc.git" } log = "0.3" serde = "1.0" substrate-rpc = { path = "../rpc", version = "0.1" } -substrate-runtime-primitives = { path = "../runtime/primitives" } +sr-primitives = { path = "../sr-primitives" } diff --git a/substrate/rpc-servers/README.adoc b/core/rpc-servers/README.adoc similarity index 100% rename from substrate/rpc-servers/README.adoc rename to core/rpc-servers/README.adoc diff --git a/substrate/rpc-servers/src/lib.rs b/core/rpc-servers/src/lib.rs similarity index 92% rename from substrate/rpc-servers/src/lib.rs rename to core/rpc-servers/src/lib.rs index 6139d32aec963..8d9620535c7bf 100644 --- a/substrate/rpc-servers/src/lib.rs +++ b/core/rpc-servers/src/lib.rs @@ -27,13 +27,13 @@ extern crate jsonrpc_http_server as http; extern crate jsonrpc_pubsub as pubsub; extern crate jsonrpc_ws_server as ws; extern crate serde; -extern crate substrate_runtime_primitives; +extern crate sr_primitives; #[macro_use] extern crate log; use std::io; -use substrate_runtime_primitives::traits::{Block as BlockT, NumberFor}; +use sr_primitives::traits::{Block as BlockT, NumberFor}; type Metadata = apis::metadata::Metadata; type RpcHandler = pubsub::PubSubHandler; @@ -48,7 +48,7 @@ pub fn rpc_handler( system: Y, ) -> RpcHandler where Block: BlockT + 'static, - ExHash: Send + Sync + 'static + substrate_runtime_primitives::Serialize + substrate_runtime_primitives::DeserializeOwned, + ExHash: Send + Sync + 'static + sr_primitives::Serialize + sr_primitives::DeserializeOwned, PendingExtrinsics: serde::Serialize + serde::de::DeserializeOwned + Send + Sync + 'static, S: apis::state::StateApi, C: apis::chain::ChainApi, Block::Extrinsic, Metadata=Metadata>, diff --git a/substrate/rpc/Cargo.toml b/core/rpc/Cargo.toml similarity index 82% rename from substrate/rpc/Cargo.toml rename to core/rpc/Cargo.toml index 423a0523b8b69..3caf7a84b6adb 100644 --- a/substrate/rpc/Cargo.toml +++ b/core/rpc/Cargo.toml @@ -10,13 +10,13 @@ jsonrpc-macros = { git="https://github.com/paritytech/jsonrpc.git" } jsonrpc-pubsub = { git="https://github.com/paritytech/jsonrpc.git" } log = "0.3" parking_lot = "0.4" -substrate-codec = { path = "../codec" } +parity-codec = { path = "../../codec" } substrate-client = { path = "../client" } substrate-executor = { path = "../executor" } substrate-extrinsic-pool = { path = "../extrinsic-pool" } substrate-primitives = { path = "../primitives" } -substrate-runtime-primitives = { path = "../runtime/primitives" } -substrate-runtime-version = { path = "../runtime/version" } +sr-primitives = { path = "../sr-primitives" } +sr-version = { path = "../sr-version" } substrate-state-machine = { path = "../state-machine" } tokio = "0.1.7" serde_json = "1.0" diff --git a/substrate/rpc/README.adoc b/core/rpc/README.adoc similarity index 100% rename from substrate/rpc/README.adoc rename to core/rpc/README.adoc diff --git a/substrate/rpc/src/author/error.rs b/core/rpc/src/author/error.rs similarity index 100% rename from substrate/rpc/src/author/error.rs rename to core/rpc/src/author/error.rs diff --git a/substrate/rpc/src/author/mod.rs b/core/rpc/src/author/mod.rs similarity index 100% rename from substrate/rpc/src/author/mod.rs rename to core/rpc/src/author/mod.rs diff --git a/substrate/rpc/src/author/tests.rs b/core/rpc/src/author/tests.rs similarity index 100% rename from substrate/rpc/src/author/tests.rs rename to core/rpc/src/author/tests.rs diff --git a/substrate/rpc/src/chain/error.rs b/core/rpc/src/chain/error.rs similarity index 100% rename from substrate/rpc/src/chain/error.rs rename to core/rpc/src/chain/error.rs diff --git a/substrate/rpc/src/chain/mod.rs b/core/rpc/src/chain/mod.rs similarity index 100% rename from substrate/rpc/src/chain/mod.rs rename to core/rpc/src/chain/mod.rs diff --git a/substrate/rpc/src/chain/tests.rs b/core/rpc/src/chain/tests.rs similarity index 100% rename from substrate/rpc/src/chain/tests.rs rename to core/rpc/src/chain/tests.rs diff --git a/substrate/rpc/src/errors.rs b/core/rpc/src/errors.rs similarity index 100% rename from substrate/rpc/src/errors.rs rename to core/rpc/src/errors.rs diff --git a/substrate/rpc/src/helpers.rs b/core/rpc/src/helpers.rs similarity index 100% rename from substrate/rpc/src/helpers.rs rename to core/rpc/src/helpers.rs diff --git a/substrate/rpc/src/lib.rs b/core/rpc/src/lib.rs similarity index 90% rename from substrate/rpc/src/lib.rs rename to core/rpc/src/lib.rs index b4e07fc823e80..a62c78955134a 100644 --- a/substrate/rpc/src/lib.rs +++ b/core/rpc/src/lib.rs @@ -23,13 +23,13 @@ extern crate jsonrpc_core as rpc; extern crate jsonrpc_pubsub; extern crate parking_lot; -extern crate substrate_codec as codec; +extern crate parity_codec as codec; extern crate substrate_client as client; extern crate substrate_extrinsic_pool as extrinsic_pool; extern crate substrate_primitives as primitives; -extern crate substrate_runtime_primitives as runtime_primitives; +extern crate sr_primitives as runtime_primitives; extern crate substrate_state_machine as state_machine; -extern crate substrate_runtime_version as runtime_version; +extern crate sr_version as runtime_version; extern crate tokio; extern crate serde_json; diff --git a/substrate/rpc/src/metadata.rs b/core/rpc/src/metadata.rs similarity index 100% rename from substrate/rpc/src/metadata.rs rename to core/rpc/src/metadata.rs diff --git a/substrate/rpc/src/state/error.rs b/core/rpc/src/state/error.rs similarity index 100% rename from substrate/rpc/src/state/error.rs rename to core/rpc/src/state/error.rs diff --git a/substrate/rpc/src/state/mod.rs b/core/rpc/src/state/mod.rs similarity index 100% rename from substrate/rpc/src/state/mod.rs rename to core/rpc/src/state/mod.rs diff --git a/substrate/rpc/src/state/tests.rs b/core/rpc/src/state/tests.rs similarity index 100% rename from substrate/rpc/src/state/tests.rs rename to core/rpc/src/state/tests.rs diff --git a/substrate/rpc/src/subscriptions.rs b/core/rpc/src/subscriptions.rs similarity index 100% rename from substrate/rpc/src/subscriptions.rs rename to core/rpc/src/subscriptions.rs diff --git a/substrate/rpc/src/system/error.rs b/core/rpc/src/system/error.rs similarity index 100% rename from substrate/rpc/src/system/error.rs rename to core/rpc/src/system/error.rs diff --git a/substrate/rpc/src/system/mod.rs b/core/rpc/src/system/mod.rs similarity index 100% rename from substrate/rpc/src/system/mod.rs rename to core/rpc/src/system/mod.rs diff --git a/substrate/rpc/src/system/tests.rs b/core/rpc/src/system/tests.rs similarity index 100% rename from substrate/rpc/src/system/tests.rs rename to core/rpc/src/system/tests.rs diff --git a/substrate/serializer/Cargo.toml b/core/serializer/Cargo.toml similarity index 100% rename from substrate/serializer/Cargo.toml rename to core/serializer/Cargo.toml diff --git a/substrate/serializer/README.adoc b/core/serializer/README.adoc similarity index 100% rename from substrate/serializer/README.adoc rename to core/serializer/README.adoc diff --git a/substrate/serializer/src/lib.rs b/core/serializer/src/lib.rs similarity index 100% rename from substrate/serializer/src/lib.rs rename to core/serializer/src/lib.rs diff --git a/core/service/Cargo.toml b/core/service/Cargo.toml new file mode 100644 index 0000000000000..4dfe64350ce55 --- /dev/null +++ b/core/service/Cargo.toml @@ -0,0 +1,31 @@ +[package] +name = "substrate-service" +version = "0.3.0" +authors = ["Parity Technologies "] + +[dependencies] +futures = "0.1.17" +parking_lot = "0.4" +error-chain = "0.12" +lazy_static = "1.0" +log = "0.3" +slog = "^2" +tokio = "0.1.7" +exit-future = "0.1" +serde = "1.0" +serde_json = "1.0" +serde_derive = "1.0" +target_info = "0.1" +substrate-keystore = { path = "../../core/keystore" } +sr-io = { path = "../../core/sr-io" } +sr-primitives = { path = "../../core/sr-primitives" } +substrate-primitives = { path = "../../core/primitives" } +substrate-network = { path = "../../core/network" } +substrate-client = { path = "../../core/client" } +substrate-client-db = { path = "../../core/client/db" } +parity-codec = { path = "../../codec" } +substrate-executor = { path = "../../core/executor" } +substrate-extrinsic-pool = { path = "../../core/extrinsic-pool" } +substrate-rpc = { path = "../../core/rpc" } +substrate-rpc-servers = { path = "../../core/rpc-servers" } +substrate-telemetry = { path = "../../core/telemetry" } diff --git a/substrate/service/README.adoc b/core/service/README.adoc similarity index 100% rename from substrate/service/README.adoc rename to core/service/README.adoc diff --git a/substrate/service/src/chain_ops.rs b/core/service/src/chain_ops.rs similarity index 100% rename from substrate/service/src/chain_ops.rs rename to core/service/src/chain_ops.rs diff --git a/substrate/service/src/chain_spec.rs b/core/service/src/chain_spec.rs similarity index 100% rename from substrate/service/src/chain_spec.rs rename to core/service/src/chain_spec.rs diff --git a/substrate/service/src/components.rs b/core/service/src/components.rs similarity index 100% rename from substrate/service/src/components.rs rename to core/service/src/components.rs diff --git a/substrate/service/src/config.rs b/core/service/src/config.rs similarity index 100% rename from substrate/service/src/config.rs rename to core/service/src/config.rs diff --git a/substrate/service/src/error.rs b/core/service/src/error.rs similarity index 100% rename from substrate/service/src/error.rs rename to core/service/src/error.rs diff --git a/substrate/service/src/lib.rs b/core/service/src/lib.rs similarity index 99% rename from substrate/service/src/lib.rs rename to core/service/src/lib.rs index d7c1e90e599d9..56e894a0bdc98 100644 --- a/substrate/service/src/lib.rs +++ b/core/service/src/lib.rs @@ -27,12 +27,12 @@ extern crate serde; extern crate serde_json; extern crate substrate_keystore as keystore; extern crate substrate_primitives as primitives; -extern crate substrate_runtime_primitives as runtime_primitives; +extern crate sr_primitives as runtime_primitives; extern crate substrate_network as network; extern crate substrate_executor; extern crate substrate_client as client; extern crate substrate_client_db as client_db; -extern crate substrate_codec as codec; +extern crate parity_codec as codec; extern crate substrate_extrinsic_pool as extrinsic_pool; extern crate substrate_rpc; extern crate substrate_rpc_servers as rpc; diff --git a/substrate/runtime-io/Cargo.toml b/core/sr-io/Cargo.toml similarity index 64% rename from substrate/runtime-io/Cargo.toml rename to core/sr-io/Cargo.toml index cf8a01dcf8731..c23e7aed361f5 100644 --- a/substrate/runtime-io/Cargo.toml +++ b/core/sr-io/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "substrate-runtime-io" +name = "sr-io" version = "0.1.0" authors = ["Parity Technologies "] build = "build.rs" @@ -8,13 +8,12 @@ build = "build.rs" rustc_version = "0.2" [dependencies] -substrate-runtime-std = { path = "../runtime-std", default_features = false } -environmental = { path = "../environmental", optional = true } +sr-std = { path = "../sr-std", default_features = false } +environmental = { path = "../../environmental", optional = true } substrate-state-machine = { path = "../state-machine", optional = true } substrate-primitives = { path = "../primitives", default_features = false } -substrate-codec = { path = "../codec", default_features = false } +parity-codec = { path = "../../codec", default_features = false } triehash = { version = "0.2", optional = true } -ed25519 = { path = "../ed25519", optional = true } hashdb = { version = "0.2", default_features = false } rlp = { version = "0.2", optional = true, default_features = false } @@ -25,9 +24,8 @@ std = [ "substrate-state-machine", "triehash", "substrate-primitives/std", - "substrate-codec/std", - "substrate-runtime-std/std", - "ed25519", + "parity-codec/std", + "sr-std/std", "rlp" ] nightly = [] diff --git a/substrate/runtime-io/README.adoc b/core/sr-io/README.adoc similarity index 100% rename from substrate/runtime-io/README.adoc rename to core/sr-io/README.adoc diff --git a/substrate/pwasm-alloc/build.rs b/core/sr-io/build.rs similarity index 100% rename from substrate/pwasm-alloc/build.rs rename to core/sr-io/build.rs diff --git a/substrate/runtime-io/src/lib.rs b/core/sr-io/src/lib.rs similarity index 100% rename from substrate/runtime-io/src/lib.rs rename to core/sr-io/src/lib.rs diff --git a/substrate/runtime-io/with_std.rs b/core/sr-io/with_std.rs similarity index 98% rename from substrate/runtime-io/with_std.rs rename to core/sr-io/with_std.rs index c1d85d914ebef..4a69c45eed4bb 100644 --- a/substrate/runtime-io/with_std.rs +++ b/core/sr-io/with_std.rs @@ -22,14 +22,13 @@ extern crate substrate_primitives as primitives; extern crate substrate_state_machine; extern crate triehash; -extern crate ed25519; extern crate hashdb; extern crate rlp; #[doc(hidden)] -pub extern crate substrate_codec as codec; +pub extern crate parity_codec as codec; // re-export hashing functions. -pub use primitives::{blake2_256, twox_128, twox_256}; +pub use primitives::{blake2_256, twox_128, twox_256, ed25519}; pub use primitives::Blake2Hasher; // Switch to this after PoC-3 diff --git a/substrate/runtime-io/without_std.rs b/core/sr-io/without_std.rs similarity index 99% rename from substrate/runtime-io/without_std.rs rename to core/sr-io/without_std.rs index 34c4191e97e22..6e9d391a657cd 100644 --- a/substrate/runtime-io/without_std.rs +++ b/core/sr-io/without_std.rs @@ -19,10 +19,10 @@ extern crate substrate_primitives as primitives; extern crate hashdb; #[doc(hidden)] -pub extern crate substrate_runtime_std as rstd; +pub extern crate sr_std as rstd; #[doc(hidden)] -pub extern crate substrate_codec as codec; +pub extern crate parity_codec as codec; use core::intrinsics; use rstd::vec::Vec; diff --git a/core/sr-primitives/Cargo.toml b/core/sr-primitives/Cargo.toml new file mode 100644 index 0000000000000..a1316b300fde9 --- /dev/null +++ b/core/sr-primitives/Cargo.toml @@ -0,0 +1,32 @@ +[package] +name = "sr-primitives" +version = "0.1.0" +authors = ["Parity Technologies "] + +[dependencies] +num-traits = { version = "0.2", default_features = false } +integer-sqrt = { git = "https://github.com/paritytech/integer-sqrt-rs.git", branch = "master" } +serde = { version = "1.0", optional = true } +serde_derive = { version = "1.0", optional = true } +parity-codec = { path = "../../codec", default_features = false } +parity-codec-derive = { path = "../../codec/derive", default_features = false } +substrate-primitives = { path = "../primitives", default_features = false } +sr-std = { path = "../sr-std", default_features = false } +sr-io = { path = "../sr-io", default_features = false } +log = {version = "0.3", optional = true } + +[dev-dependencies] +serde_json = "1.0" + +[features] +default = ["std"] +std = [ + "num-traits/std", + "serde", + "serde_derive", + "log", + "sr-std/std", + "sr-io/std", + "parity-codec/std", + "substrate-primitives/std", +] diff --git a/substrate/runtime/primitives/src/bft.rs b/core/sr-primitives/src/bft.rs similarity index 100% rename from substrate/runtime/primitives/src/bft.rs rename to core/sr-primitives/src/bft.rs diff --git a/substrate/runtime/primitives/src/generic/block.rs b/core/sr-primitives/src/generic/block.rs similarity index 100% rename from substrate/runtime/primitives/src/generic/block.rs rename to core/sr-primitives/src/generic/block.rs diff --git a/substrate/runtime/primitives/src/generic/checked_extrinsic.rs b/core/sr-primitives/src/generic/checked_extrinsic.rs similarity index 89% rename from substrate/runtime/primitives/src/generic/checked_extrinsic.rs rename to core/sr-primitives/src/generic/checked_extrinsic.rs index e5aee32a02c58..e8be8dd53482d 100644 --- a/substrate/runtime/primitives/src/generic/checked_extrinsic.rs +++ b/core/sr-primitives/src/generic/checked_extrinsic.rs @@ -17,7 +17,6 @@ //! Generic implementation of an extrinsic that has passed the verification //! stage. -use runtime_support::Dispatchable; use traits::{self, Member, SimpleArithmetic, MaybeDisplay}; /// Definition of something that the external world might want to say; its @@ -39,11 +38,11 @@ impl traits::Applyable where AccountId: Member + MaybeDisplay, Index: Member + MaybeDisplay + SimpleArithmetic, - Call: Member + Dispatchable, - ::Origin: From> + Call: Member { type Index = Index; type AccountId = AccountId; + type Call = Call; fn index(&self) -> &Self::Index { &self.index @@ -53,7 +52,7 @@ where self.signed.as_ref() } - fn apply(self) -> Result<(), &'static str> { - self.function.dispatch(self.signed.into()) + fn deconstruct(self) -> (Self::Call, Option) { + (self.function, self.signed) } } diff --git a/substrate/runtime/primitives/src/generic/digest.rs b/core/sr-primitives/src/generic/digest.rs similarity index 100% rename from substrate/runtime/primitives/src/generic/digest.rs rename to core/sr-primitives/src/generic/digest.rs diff --git a/substrate/runtime/primitives/src/generic/header.rs b/core/sr-primitives/src/generic/header.rs similarity index 100% rename from substrate/runtime/primitives/src/generic/header.rs rename to core/sr-primitives/src/generic/header.rs diff --git a/substrate/runtime/primitives/src/generic/mod.rs b/core/sr-primitives/src/generic/mod.rs similarity index 100% rename from substrate/runtime/primitives/src/generic/mod.rs rename to core/sr-primitives/src/generic/mod.rs diff --git a/substrate/runtime/primitives/src/generic/tests.rs b/core/sr-primitives/src/generic/tests.rs similarity index 100% rename from substrate/runtime/primitives/src/generic/tests.rs rename to core/sr-primitives/src/generic/tests.rs diff --git a/substrate/runtime/primitives/src/generic/unchecked_extrinsic.rs b/core/sr-primitives/src/generic/unchecked_extrinsic.rs similarity index 100% rename from substrate/runtime/primitives/src/generic/unchecked_extrinsic.rs rename to core/sr-primitives/src/generic/unchecked_extrinsic.rs diff --git a/substrate/runtime/primitives/src/lib.rs b/core/sr-primitives/src/lib.rs similarity index 98% rename from substrate/runtime/primitives/src/lib.rs rename to core/sr-primitives/src/lib.rs index e9bddc3286d87..c0d1133d415df 100644 --- a/substrate/runtime/primitives/src/lib.rs +++ b/core/sr-primitives/src/lib.rs @@ -31,14 +31,13 @@ extern crate serde_derive; extern crate log; #[macro_use] -extern crate substrate_codec_derive; +extern crate parity_codec_derive; extern crate num_traits; extern crate integer_sqrt; -extern crate substrate_runtime_std as rstd; -extern crate substrate_runtime_io as runtime_io; -extern crate substrate_runtime_support as runtime_support; -extern crate substrate_codec as codec; +extern crate sr_std as rstd; +extern crate sr_io as runtime_io; +extern crate parity_codec as codec; extern crate substrate_primitives; #[cfg(test)] diff --git a/substrate/runtime/primitives/src/testing.rs b/core/sr-primitives/src/testing.rs similarity index 91% rename from substrate/runtime/primitives/src/testing.rs rename to core/sr-primitives/src/testing.rs index 764828bfe5662..b9646ea339ff2 100644 --- a/substrate/runtime/primitives/src/testing.rs +++ b/core/sr-primitives/src/testing.rs @@ -19,7 +19,6 @@ use serde::{Serialize, de::DeserializeOwned}; use std::fmt::Debug; use codec::Codec; -use runtime_support::Dispatchable; use traits::{self, Checkable, Applyable, BlakeTwo256}; pub use substrate_primitives::H256; @@ -122,17 +121,19 @@ impl(pub Option, pub u64, pub Call); -impl Checkable for TestXt { +impl Checkable for TestXt { type Checked = Self; fn check_with(self, _: Context) -> Result { Ok(self) } } impl Applyable for TestXt where - Call: Sized + Send + Sync + Clone + Eq + Dispatchable + Codec + Debug + Serialize + DeserializeOwned, - ::Origin: From> + Call: 'static + Sized + Send + Sync + Clone + Eq + Codec + Debug + Serialize + DeserializeOwned, { type AccountId = u64; type Index = u64; + type Call = Call; fn sender(&self) -> Option<&u64> { self.0.as_ref() } fn index(&self) -> &u64 { &self.1 } - fn apply(self) -> Result<(), &'static str> { self.2.dispatch(self.0.into()) } + fn deconstruct(self) -> (Self::Call, Option) { + (self.2, self.0) + } } diff --git a/substrate/runtime/primitives/src/traits.rs b/core/sr-primitives/src/traits.rs similarity index 99% rename from substrate/runtime/primitives/src/traits.rs rename to core/sr-primitives/src/traits.rs index 32aa47a16f95a..460d52042be7f 100644 --- a/substrate/runtime/primitives/src/traits.rs +++ b/core/sr-primitives/src/traits.rs @@ -435,9 +435,10 @@ impl Checkable for T { pub trait Applyable: Sized + Send + Sync { type AccountId: Member + MaybeDisplay; type Index: Member + MaybeDisplay + SimpleArithmetic; + type Call: Member; fn index(&self) -> &Self::Index; fn sender(&self) -> Option<&Self::AccountId>; - fn apply(self) -> Result<(), &'static str>; + fn deconstruct(self) -> (Self::Call, Option); } /// Something that acts like a `Digest` - it can have `Log`s `push`ed onto it and these `Log`s are diff --git a/substrate/runtime-sandbox/Cargo.toml b/core/sr-sandbox/Cargo.toml similarity index 56% rename from substrate/runtime-sandbox/Cargo.toml rename to core/sr-sandbox/Cargo.toml index b80cb4443f8ae..f62a5c0809f23 100755 --- a/substrate/runtime-sandbox/Cargo.toml +++ b/core/sr-sandbox/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "substrate-runtime-sandbox" +name = "sr-sandbox" version = "0.1.0" authors = ["Parity Technologies "] build = "build.rs" @@ -10,9 +10,9 @@ rustc_version = "0.2" [dependencies] wasmi = { version = "0.4", optional = true } substrate-primitives = { path = "../primitives", default_features = false } -substrate-runtime-std = { path = "../runtime-std", default_features = false } -substrate-runtime-io = { path = "../runtime-io", default_features = false } -substrate-codec = { path = "../codec", default_features = false } +sr-std = { path = "../sr-std", default_features = false } +sr-io = { path = "../sr-io", default_features = false } +parity-codec = { path = "../../codec", default_features = false } [dev-dependencies] wabt = "0.4" @@ -23,9 +23,9 @@ default = ["std"] std = [ "wasmi", "substrate-primitives/std", - "substrate-runtime-std/std", - "substrate-codec/std", - "substrate-runtime-io/std", + "sr-std/std", + "parity-codec/std", + "sr-io/std", ] nightly = [] strict = [] diff --git a/substrate/runtime-sandbox/README.adoc b/core/sr-sandbox/README.adoc similarity index 100% rename from substrate/runtime-sandbox/README.adoc rename to core/sr-sandbox/README.adoc diff --git a/substrate/runtime-io/build.rs b/core/sr-sandbox/build.rs old mode 100644 new mode 100755 similarity index 100% rename from substrate/runtime-io/build.rs rename to core/sr-sandbox/build.rs diff --git a/substrate/runtime-sandbox/src/lib.rs b/core/sr-sandbox/src/lib.rs similarity index 98% rename from substrate/runtime-sandbox/src/lib.rs rename to core/sr-sandbox/src/lib.rs index 16066af160f15..ca94edf4e4107 100755 --- a/substrate/runtime-sandbox/src/lib.rs +++ b/core/sr-sandbox/src/lib.rs @@ -43,10 +43,10 @@ #![cfg_attr(not(feature = "std"), feature(core_intrinsics))] #![cfg_attr(not(feature = "std"), feature(alloc))] -extern crate substrate_codec as codec; -extern crate substrate_runtime_io as runtime_io; +extern crate parity_codec as codec; +extern crate sr_io as runtime_io; #[cfg_attr(not(feature = "std"), macro_use)] -extern crate substrate_runtime_std as rstd; +extern crate sr_std as rstd; extern crate substrate_primitives as primitives; #[cfg(test)] diff --git a/substrate/runtime-sandbox/with_std.rs b/core/sr-sandbox/with_std.rs similarity index 100% rename from substrate/runtime-sandbox/with_std.rs rename to core/sr-sandbox/with_std.rs diff --git a/substrate/runtime-sandbox/without_std.rs b/core/sr-sandbox/without_std.rs similarity index 100% rename from substrate/runtime-sandbox/without_std.rs rename to core/sr-sandbox/without_std.rs diff --git a/substrate/runtime-std/Cargo.toml b/core/sr-std/Cargo.toml similarity index 66% rename from substrate/runtime-std/Cargo.toml rename to core/sr-std/Cargo.toml index 42745a0152a10..459d0f72d1a3c 100644 --- a/substrate/runtime-std/Cargo.toml +++ b/core/sr-std/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "substrate-runtime-std" +name = "sr-std" version = "0.1.0" authors = ["Parity Technologies "] build = "build.rs" @@ -8,8 +8,8 @@ build = "build.rs" rustc_version = "0.2" [dependencies] -pwasm-alloc = { path = "../pwasm-alloc" } -pwasm-libc = { path = "../pwasm-libc" } +pwasm-alloc = { path = "../../pwasm-alloc" } +pwasm-libc = { path = "../../pwasm-libc" } [features] default = ["std"] diff --git a/substrate/runtime-std/README.adoc b/core/sr-std/README.adoc similarity index 100% rename from substrate/runtime-std/README.adoc rename to core/sr-std/README.adoc diff --git a/substrate/runtime-std/build.rs b/core/sr-std/build.rs similarity index 100% rename from substrate/runtime-std/build.rs rename to core/sr-std/build.rs diff --git a/substrate/runtime-std/src/lib.rs b/core/sr-std/src/lib.rs similarity index 100% rename from substrate/runtime-std/src/lib.rs rename to core/sr-std/src/lib.rs diff --git a/substrate/runtime-std/with_std.rs b/core/sr-std/with_std.rs similarity index 100% rename from substrate/runtime-std/with_std.rs rename to core/sr-std/with_std.rs diff --git a/substrate/runtime-std/without_std.rs b/core/sr-std/without_std.rs similarity index 100% rename from substrate/runtime-std/without_std.rs rename to core/sr-std/without_std.rs diff --git a/core/sr-version/Cargo.toml b/core/sr-version/Cargo.toml new file mode 100644 index 0000000000000..b78fbbebba1cd --- /dev/null +++ b/core/sr-version/Cargo.toml @@ -0,0 +1,20 @@ +[package] +name = "sr-version" +version = "0.1.0" +authors = ["Parity Technologies "] + +[dependencies] +serde = { version = "1.0", default_features = false } +serde_derive = { version = "1.0", optional = true } +parity-codec = { path = "../../codec", default_features = false } +parity-codec-derive = { path = "../../codec/derive", default_features = false } +sr-std = { path = "../sr-std", default_features = false } + +[features] +default = ["std"] +std = [ + "serde/std", + "serde_derive", + "parity-codec/std", + "sr-std/std", +] diff --git a/substrate/runtime/version/src/lib.rs b/core/sr-version/src/lib.rs similarity index 96% rename from substrate/runtime/version/src/lib.rs rename to core/sr-version/src/lib.rs index c8e3b8f4a6dc1..2a66e0a794b39 100644 --- a/substrate/runtime/version/src/lib.rs +++ b/core/sr-version/src/lib.rs @@ -27,12 +27,12 @@ extern crate serde_derive; #[allow(unused_imports)] #[macro_use] -extern crate substrate_runtime_std as rstd; +extern crate sr_std as rstd; #[macro_use] -extern crate substrate_codec_derive; +extern crate parity_codec_derive; -extern crate substrate_codec as codec; +extern crate parity_codec as codec; #[cfg(feature = "std")] use std::fmt; @@ -62,7 +62,7 @@ macro_rules! ver_str { #[derive(Clone, PartialEq, Eq, Encode)] #[cfg_attr(feature = "std", derive(Debug, Serialize, Deserialize, Decode))] pub struct RuntimeVersion { - /// Identifies the different Substrate runtimes. There'll be at least polkadot and demo. + /// Identifies the different Substrate runtimes. There'll be at least polkadot and node. /// A different on-chain spec_name to that of the native runtime would normally result /// in node not attempting to sync or author blocks. pub spec_name: VersionString, diff --git a/substrate/state-db/Cargo.toml b/core/state-db/Cargo.toml similarity index 51% rename from substrate/state-db/Cargo.toml rename to core/state-db/Cargo.toml index d3e4c878cf50b..5093f70612a8f 100644 --- a/substrate/state-db/Cargo.toml +++ b/core/state-db/Cargo.toml @@ -6,9 +6,9 @@ authors = ["Parity Technologies "] [dependencies] parking_lot = "0.5" log = "0.4" -substrate-primitives = { path = "../../substrate/primitives" } -substrate-codec = { path = "../../substrate/codec" } -substrate-codec-derive = { path = "../../substrate/codec/derive" } +substrate-primitives = { path = "../../core/primitives" } +parity-codec = { path = "../../codec" } +parity-codec-derive = { path = "../../codec/derive" } [dev-dependencies] env_logger = "0.4" diff --git a/substrate/state-db/README.adoc b/core/state-db/README.adoc similarity index 100% rename from substrate/state-db/README.adoc rename to core/state-db/README.adoc diff --git a/substrate/state-db/src/lib.rs b/core/state-db/src/lib.rs similarity index 99% rename from substrate/state-db/src/lib.rs rename to core/state-db/src/lib.rs index 7e7dd3369c918..349abc63c3dc2 100644 --- a/substrate/state-db/src/lib.rs +++ b/core/state-db/src/lib.rs @@ -33,9 +33,9 @@ // end::description[] #[macro_use] extern crate log; -#[macro_use] extern crate substrate_codec_derive; +#[macro_use] extern crate parity_codec_derive; extern crate parking_lot; -extern crate substrate_codec as codec; +extern crate parity_codec as codec; extern crate substrate_primitives as primitives; mod unfinalized; diff --git a/substrate/state-db/src/pruning.rs b/core/state-db/src/pruning.rs similarity index 100% rename from substrate/state-db/src/pruning.rs rename to core/state-db/src/pruning.rs diff --git a/substrate/state-db/src/test.rs b/core/state-db/src/test.rs similarity index 100% rename from substrate/state-db/src/test.rs rename to core/state-db/src/test.rs diff --git a/substrate/state-db/src/unfinalized.rs b/core/state-db/src/unfinalized.rs similarity index 100% rename from substrate/state-db/src/unfinalized.rs rename to core/state-db/src/unfinalized.rs diff --git a/substrate/state-machine/Cargo.toml b/core/state-machine/Cargo.toml similarity index 86% rename from substrate/state-machine/Cargo.toml rename to core/state-machine/Cargo.toml index 3635627999f35..6f762dd4ef59d 100644 --- a/substrate/state-machine/Cargo.toml +++ b/core/state-machine/Cargo.toml @@ -17,5 +17,5 @@ triehash = "0.2" rlp = "0.2.4" substrate-primitives = { path = "../primitives", version = "0.1.0" } -substrate-codec = { path = "../codec", default_features = false } +parity-codec = { path = "../../codec", default_features = false } diff --git a/substrate/state-machine/README.adoc b/core/state-machine/README.adoc similarity index 100% rename from substrate/state-machine/README.adoc rename to core/state-machine/README.adoc diff --git a/substrate/state-machine/src/backend.rs b/core/state-machine/src/backend.rs similarity index 100% rename from substrate/state-machine/src/backend.rs rename to core/state-machine/src/backend.rs diff --git a/substrate/state-machine/src/ext.rs b/core/state-machine/src/ext.rs similarity index 100% rename from substrate/state-machine/src/ext.rs rename to core/state-machine/src/ext.rs diff --git a/substrate/state-machine/src/lib.rs b/core/state-machine/src/lib.rs similarity index 99% rename from substrate/state-machine/src/lib.rs rename to core/state-machine/src/lib.rs index 7dab6e6af6375..5cdef5b064fcb 100644 --- a/substrate/state-machine/src/lib.rs +++ b/core/state-machine/src/lib.rs @@ -36,7 +36,7 @@ extern crate rlp; extern crate heapsize; #[cfg(test)] extern crate substrate_primitives as primitives; -extern crate substrate_codec as codec; +extern crate parity_codec as codec; use std::collections::HashMap; use std::fmt; diff --git a/substrate/state-machine/src/proving_backend.rs b/core/state-machine/src/proving_backend.rs similarity index 100% rename from substrate/state-machine/src/proving_backend.rs rename to core/state-machine/src/proving_backend.rs diff --git a/substrate/state-machine/src/testing.rs b/core/state-machine/src/testing.rs similarity index 100% rename from substrate/state-machine/src/testing.rs rename to core/state-machine/src/testing.rs diff --git a/substrate/state-machine/src/trie_backend.rs b/core/state-machine/src/trie_backend.rs similarity index 100% rename from substrate/state-machine/src/trie_backend.rs rename to core/state-machine/src/trie_backend.rs diff --git a/substrate/telemetry/Cargo.toml b/core/telemetry/Cargo.toml similarity index 100% rename from substrate/telemetry/Cargo.toml rename to core/telemetry/Cargo.toml diff --git a/substrate/telemetry/README.adoc b/core/telemetry/README.adoc similarity index 100% rename from substrate/telemetry/README.adoc rename to core/telemetry/README.adoc diff --git a/substrate/telemetry/src/lib.rs b/core/telemetry/src/lib.rs similarity index 100% rename from substrate/telemetry/src/lib.rs rename to core/telemetry/src/lib.rs diff --git a/substrate/test-client/Cargo.toml b/core/test-client/Cargo.toml similarity index 63% rename from substrate/test-client/Cargo.toml rename to core/test-client/Cargo.toml index f36ec382f6028..fe85532d71877 100644 --- a/substrate/test-client/Cargo.toml +++ b/core/test-client/Cargo.toml @@ -7,12 +7,12 @@ authors = ["Parity Technologies "] rhododendron = "0.3" substrate-bft = { path = "../bft" } substrate-client = { path = "../client" } -substrate-codec = { path = "../codec" } +parity-codec = { path = "../../codec" } substrate-executor = { path = "../executor" } -substrate-keyring = { path = "../../substrate/keyring" } +substrate-keyring = { path = "../../core/keyring" } substrate-primitives = { path = "../primitives" } -substrate-runtime-support = { path = "../runtime-support" } +srml-support = { path = "../../srml/support" } substrate-test-runtime = { path = "../test-runtime" } -substrate-runtime-primitives = { path = "../runtime/primitives" } +sr-primitives = { path = "../sr-primitives" } hashdb = "0.2.1" diff --git a/substrate/test-client/README.adoc b/core/test-client/README.adoc similarity index 100% rename from substrate/test-client/README.adoc rename to core/test-client/README.adoc diff --git a/substrate/test-client/src/block_builder_ext.rs b/core/test-client/src/block_builder_ext.rs similarity index 100% rename from substrate/test-client/src/block_builder_ext.rs rename to core/test-client/src/block_builder_ext.rs diff --git a/substrate/test-client/src/client_ext.rs b/core/test-client/src/client_ext.rs similarity index 100% rename from substrate/test-client/src/client_ext.rs rename to core/test-client/src/client_ext.rs diff --git a/substrate/test-client/src/lib.rs b/core/test-client/src/lib.rs similarity index 92% rename from substrate/test-client/src/lib.rs rename to core/test-client/src/lib.rs index 3aeefed0fafb2..808b151727d73 100644 --- a/substrate/test-client/src/lib.rs +++ b/core/test-client/src/lib.rs @@ -22,10 +22,10 @@ extern crate rhododendron; extern crate substrate_bft as bft; -extern crate substrate_codec as codec; +extern crate parity_codec as codec; extern crate substrate_primitives as primitives; -extern crate substrate_runtime_support as runtime_support; -extern crate substrate_runtime_primitives as runtime_primitives; +extern crate srml_support as runtime_support; +extern crate sr_primitives as runtime_primitives; #[macro_use] extern crate substrate_executor as executor; extern crate hashdb; diff --git a/core/test-runtime/Cargo.toml b/core/test-runtime/Cargo.toml new file mode 100644 index 0000000000000..dc7266fc2e3a2 --- /dev/null +++ b/core/test-runtime/Cargo.toml @@ -0,0 +1,36 @@ +[package] +name = "substrate-test-runtime" +version = "0.1.0" +authors = ["Parity Technologies "] + +[dependencies] +log = { version = "0.3", optional = true } +hex-literal = { version = "0.1.0", optional = true } +serde = { version = "1.0", optional = true } +serde_derive = { version = "1.0", optional = true } +parity-codec = { path = "../../codec", default-features = false } +parity-codec-derive = { path = "../../codec/derive", default-features = false } +substrate-keyring = { path = "../keyring", optional = true } +substrate-primitives = { path = "../primitives", default-features = false } +sr-std = { path = "../sr-std", default-features = false } +sr-io = { path = "../sr-io", default-features = false } +sr-primitives = { path = "../sr-primitives", default-features = false } +sr-version = { path = "../sr-version", default-features = false } +srml-support = { path = "../../srml/support", default-features = false } + +[features] +default = ["std"] +std = [ + "log", + "hex-literal", + "serde", + "serde_derive", + "substrate-keyring", + "parity-codec/std", + "sr-std/std", + "sr-io/std", + "srml-support/std", + "substrate-primitives/std", + "sr-primitives/std", + "sr-version/std" +] diff --git a/substrate/test-runtime/README.adoc b/core/test-runtime/README.adoc similarity index 100% rename from substrate/test-runtime/README.adoc rename to core/test-runtime/README.adoc diff --git a/substrate/test-runtime/src/genesismap.rs b/core/test-runtime/src/genesismap.rs similarity index 100% rename from substrate/test-runtime/src/genesismap.rs rename to core/test-runtime/src/genesismap.rs diff --git a/substrate/test-runtime/src/lib.rs b/core/test-runtime/src/lib.rs similarity index 90% rename from substrate/test-runtime/src/lib.rs rename to core/test-runtime/src/lib.rs index eb1deca741c3f..2418ad34001dd 100644 --- a/substrate/test-runtime/src/lib.rs +++ b/core/test-runtime/src/lib.rs @@ -20,9 +20,9 @@ #![cfg_attr(not(feature = "std"), no_std)] -extern crate substrate_runtime_std as rstd; -extern crate substrate_codec as codec; -extern crate substrate_runtime_primitives as runtime_primitives; +extern crate sr_std as rstd; +extern crate parity_codec as codec; +extern crate sr_primitives as runtime_primitives; #[cfg(feature = "std")] extern crate serde; @@ -32,21 +32,19 @@ extern crate serde; extern crate serde_derive; #[macro_use] -extern crate substrate_runtime_support as runtime_support; +extern crate srml_support as runtime_support; #[macro_use] -extern crate substrate_codec_derive; +extern crate parity_codec_derive; #[macro_use] -extern crate substrate_runtime_io as runtime_io; +extern crate sr_io as runtime_io; #[macro_use] -extern crate substrate_runtime_version as runtime_version; +extern crate sr_version as runtime_version; #[cfg(test)] #[macro_use] extern crate hex_literal; #[cfg(test)] -extern crate ed25519; -#[cfg(test)] extern crate substrate_keyring as keyring; #[cfg_attr(test, macro_use)] extern crate substrate_primitives as primitives; @@ -144,7 +142,7 @@ pub mod api { version => |()| super::version(), json_metadata => |()| { let mut vec = ::runtime_support::metadata::Vec::new(); - vec.push(::runtime_support::metadata::JSONMetadata::Events { + vec.push(::runtime_support::metadata::JsonMetadata::Events { name: "Test", events: &[ ("event", super::test_event_json) ] }); vec diff --git a/substrate/test-runtime/src/system.rs b/core/test-runtime/src/system.rs similarity index 100% rename from substrate/test-runtime/src/system.rs rename to core/test-runtime/src/system.rs diff --git a/substrate/test-runtime/wasm/Cargo.lock b/core/test-runtime/wasm/Cargo.lock similarity index 96% rename from substrate/test-runtime/wasm/Cargo.lock rename to core/test-runtime/wasm/Cargo.lock index f42241061f26e..b4a0da92bba36 100644 --- a/substrate/test-runtime/wasm/Cargo.lock +++ b/core/test-runtime/wasm/Cargo.lock @@ -76,18 +76,6 @@ name = "crunchy" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "ed25519" -version = "0.1.0" -dependencies = [ - "base58 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", - "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "ring 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-primitives 0.1.0", - "untrusted 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "elastic-array" version = "0.10.0" @@ -290,6 +278,22 @@ name = "parity-bytes" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "parity-codec" +version = "0.1.0" +dependencies = [ + "arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "parity-codec-derive" +version = "0.1.0" +dependencies = [ + "proc-macro2 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "parity-wasm" version = "0.31.0" @@ -502,85 +506,38 @@ dependencies = [ ] [[package]] -name = "stable_deref_trait" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "substrate-codec" -version = "0.1.0" -dependencies = [ - "arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "substrate-codec-derive" -version = "0.1.0" -dependencies = [ - "proc-macro2 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "substrate-primitives" -version = "0.1.0" -dependencies = [ - "blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", - "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "elastic-array 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", - "fixed-hash 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "hashdb 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "patricia-trie 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "plain_hasher 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-hex 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-codec 0.1.0", - "substrate-codec-derive 0.1.0", - "substrate-runtime-std 0.1.0", - "twox-hash 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "uint 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "wasmi 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "substrate-runtime-io" +name = "sr-io" version = "0.1.0" dependencies = [ - "ed25519 0.1.0", "environmental 0.1.0", "hashdb 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 0.1.0", "rlp 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_version 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-codec 0.1.0", + "sr-std 0.1.0", "substrate-primitives 0.1.0", - "substrate-runtime-std 0.1.0", "substrate-state-machine 0.1.0", "triehash 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "substrate-runtime-primitives" +name = "sr-primitives" version = "0.1.0" dependencies = [ "integer-sqrt 0.1.0 (git+https://github.com/paritytech/integer-sqrt-rs.git)", "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 0.1.0", + "parity-codec-derive 0.1.0", "serde 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-codec 0.1.0", - "substrate-codec-derive 0.1.0", + "sr-io 0.1.0", + "sr-std 0.1.0", "substrate-primitives 0.1.0", - "substrate-runtime-io 0.1.0", - "substrate-runtime-std 0.1.0", - "substrate-runtime-support 0.1.0", ] [[package]] -name = "substrate-runtime-std" +name = "sr-std" version = "0.1.0" dependencies = [ "pwasm-alloc 0.1.0", @@ -589,29 +546,68 @@ dependencies = [ ] [[package]] -name = "substrate-runtime-support" +name = "sr-version" +version = "0.1.0" +dependencies = [ + "parity-codec 0.1.0", + "parity-codec-derive 0.1.0", + "serde 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-std 0.1.0", +] + +[[package]] +name = "srml-support" version = "0.1.0" dependencies = [ - "ed25519 0.1.0", "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 0.1.0", "serde 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-codec 0.1.0", + "sr-io 0.1.0", + "sr-std 0.1.0", + "substrate-metadata 0.1.0", "substrate-primitives 0.1.0", - "substrate-runtime-io 0.1.0", - "substrate-runtime-std 0.1.0", ] [[package]] -name = "substrate-runtime-version" +name = "stable_deref_trait" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "substrate-metadata" +version = "0.1.0" +dependencies = [ + "parity-codec 0.1.0", +] + +[[package]] +name = "substrate-primitives" version = "0.1.0" dependencies = [ + "base58 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "elastic-array 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", + "fixed-hash 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "hashdb 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 0.1.0", + "parity-codec-derive 0.1.0", + "patricia-trie 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "plain_hasher 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ring 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rlp 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-hex 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-codec 0.1.0", - "substrate-codec-derive 0.1.0", - "substrate-runtime-std 0.1.0", - "substrate-runtime-support 0.1.0", + "sr-std 0.1.0", + "twox-hash 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "uint 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "untrusted 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "wasmi 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -624,10 +620,10 @@ dependencies = [ "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "memorydb 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 0.1.0", "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "patricia-trie 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-codec 0.1.0", "substrate-primitives 0.1.0", "triehash 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -636,17 +632,16 @@ dependencies = [ name = "substrate-test-runtime" version = "0.1.0" dependencies = [ - "ed25519 0.1.0", "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-codec 0.1.0", - "substrate-codec-derive 0.1.0", + "parity-codec 0.1.0", + "parity-codec-derive 0.1.0", + "sr-io 0.1.0", + "sr-primitives 0.1.0", + "sr-std 0.1.0", + "sr-version 0.1.0", + "srml-support 0.1.0", "substrate-primitives 0.1.0", - "substrate-runtime-io 0.1.0", - "substrate-runtime-primitives 0.1.0", - "substrate-runtime-std 0.1.0", - "substrate-runtime-support 0.1.0", - "substrate-runtime-version 0.1.0", ] [[package]] diff --git a/core/test-runtime/wasm/Cargo.toml b/core/test-runtime/wasm/Cargo.toml new file mode 100644 index 0000000000000..0720a20896fd4 --- /dev/null +++ b/core/test-runtime/wasm/Cargo.toml @@ -0,0 +1,40 @@ +[package] +name = "substrate-test-runtime" +version = "0.1.0" +authors = ["Parity Technologies "] + +[dependencies] +log = { version = "0.3", optional = true } +hex-literal = { version = "0.1.0", optional = true } +parity-codec = { path = "../../../codec", default-features = false } +parity-codec-derive = { path = "../../../codec/derive", default-features = false } +substrate-primitives = { path = "../../primitives", default-features = false } +sr-std = { path = "../../sr-std", default-features = false } +sr-io = { path = "../../sr-io", default-features = false } +sr-version = { path = "../../sr-version", default-features = false } +sr-primitives = { path = "../../sr-primitives", default-features = false } +srml-support = { path = "../../../srml/support", default-features = false } + +[features] +default = [] +std = [ + "log", + "hex-literal", + "parity-codec/std", + "sr-std/std", + "sr-io/std", + "srml-support/std", + "sr-version/std", + "substrate-primitives/std", + "sr-primitives/std" +] + +[lib] +crate-type = ["cdylib"] + +[profile.release] +panic = "abort" +lto = true + +[workspace] +members = [] diff --git a/substrate/test-runtime/wasm/build.sh b/core/test-runtime/wasm/build.sh similarity index 100% rename from substrate/test-runtime/wasm/build.sh rename to core/test-runtime/wasm/build.sh diff --git a/demo/runtime/wasm/src b/core/test-runtime/wasm/src similarity index 100% rename from demo/runtime/wasm/src rename to core/test-runtime/wasm/src diff --git a/demo/api/Cargo.toml b/demo/api/Cargo.toml deleted file mode 100644 index b03eb27a72541..0000000000000 --- a/demo/api/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "demo-api" -version = "0.1.0" -authors = ["Parity Technologies "] - -[dependencies] -demo-runtime = { path = "../runtime" } -demo-primitives = { path = "../primitives" } -substrate-client = { path = "../../substrate/client" } -substrate-primitives = { path = "../../substrate/primitives" } - -[dev-dependencies] -substrate-keyring = { path = "../../substrate/keyring" } diff --git a/demo/cli/Cargo.toml b/demo/cli/Cargo.toml deleted file mode 100644 index 5c5b0f7a36f41..0000000000000 --- a/demo/cli/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "demo-cli" -version = "0.1.0" -authors = ["Parity Technologies "] -description = "Substrate Demo node implementation in Rust." - -[dependencies] -log = "0.3" -tokio = "0.1.7" -exit-future = "0.1" -substrate-cli = { path = "../../substrate/cli" } -demo-service = { path = "../service" } diff --git a/demo/consensus/Cargo.toml b/demo/consensus/Cargo.toml deleted file mode 100644 index 1dc8eb8367711..0000000000000 --- a/demo/consensus/Cargo.toml +++ /dev/null @@ -1,27 +0,0 @@ -[package] -name = "demo-consensus" -version = "0.1.0" -authors = ["Parity Technologies "] - -[dependencies] -futures = "0.1.17" -parking_lot = "0.4" -tokio = "0.1.7" -ed25519 = { path = "../../substrate/ed25519" } -error-chain = "0.12" -log = "0.3" -exit-future = "0.1" -rhododendron = "0.3" -demo-api = { path = "../api" } -demo-primitives = { path = "../primitives" } -demo-runtime = { path = "../runtime" } -demo-transaction-pool = { path = "../transaction-pool" } -substrate-bft = { path = "../../substrate/bft" } -substrate-codec = { path = "../../substrate/codec" } -substrate-primitives = { path = "../../substrate/primitives" } -substrate-runtime-support = { path = "../../substrate/runtime-support" } -substrate-client = { path = "../../substrate/client" } -substrate-runtime-primitives = { path = "../../substrate/runtime/primitives" } - -[dev-dependencies] -substrate-keyring = { path = "../../substrate/keyring" } diff --git a/demo/executor/Cargo.toml b/demo/executor/Cargo.toml deleted file mode 100644 index 5bf56e9a8f0c4..0000000000000 --- a/demo/executor/Cargo.toml +++ /dev/null @@ -1,29 +0,0 @@ -[package] -name = "demo-executor" -version = "0.1.0" -authors = ["Parity Technologies "] -description = "Substrate Demo node implementation in Rust." - -[dependencies] -hex-literal = "0.1" -triehash = "0.2" -ed25519 = { path = "../../substrate/ed25519" } -substrate-codec = { path = "../../substrate/codec" } -substrate-runtime-io = { path = "../../substrate/runtime-io" } -substrate-runtime-support = { path = "../../substrate/runtime-support" } -substrate-state-machine = { path = "../../substrate/state-machine" } -substrate-executor = { path = "../../substrate/executor" } -substrate-primitives = { path = "../../substrate/primitives" } -demo-primitives = { path = "../primitives" } -demo-runtime = { path = "../runtime" } - -[dev-dependencies] -substrate-keyring = { path = "../../substrate/keyring" } -substrate-runtime-primitives = { path = "../../substrate/runtime/primitives" } -substrate-runtime-balances = { path = "../../substrate/runtime/balances" } -substrate-runtime-session = { path = "../../substrate/runtime/session" } -substrate-runtime-staking = { path = "../../substrate/runtime/staking" } -substrate-runtime-system = { path = "../../substrate/runtime/system" } -substrate-runtime-consensus = { path = "../../substrate/runtime/consensus" } -substrate-runtime-timestamp = { path = "../../substrate/runtime/timestamp" } -substrate-runtime-treasury = { path = "../../substrate/runtime/treasury" } diff --git a/demo/network/Cargo.toml b/demo/network/Cargo.toml deleted file mode 100644 index 3329f779b4719..0000000000000 --- a/demo/network/Cargo.toml +++ /dev/null @@ -1,17 +0,0 @@ -[package] -name = "demo-network" -version = "0.1.0" -authors = ["Parity Technologies "] -description = "Substrate demo networking protocol" - -[dependencies] -demo-api = { path = "../api" } -demo-consensus = { path = "../consensus" } -demo-primitives = { path = "../primitives" } -substrate-bft = { path = "../../substrate/bft" } -substrate-network = { path = "../../substrate/network" } -ed25519 = { path = "../../substrate/ed25519" } -futures = "0.1" -tokio = "0.1.7" -log = "0.4" -rhododendron = "0.3" diff --git a/demo/primitives/Cargo.toml b/demo/primitives/Cargo.toml deleted file mode 100644 index b517210d1951b..0000000000000 --- a/demo/primitives/Cargo.toml +++ /dev/null @@ -1,29 +0,0 @@ -[package] -name = "demo-primitives" -version = "0.1.0" -authors = ["Parity Technologies "] - -[dependencies] -serde = { version = "1.0", default_features = false } -serde_derive = { version = "1.0", optional = true } -substrate-codec = { path = "../../substrate/codec", default_features = false } -substrate-codec-derive = { path = "../../substrate/codec/derive", default_features = false } -substrate-primitives = { path = "../../substrate/primitives", default_features = false } -substrate-runtime-std = { path = "../../substrate/runtime-std", default_features = false } -substrate-runtime-primitives = { path = "../../substrate/runtime/primitives", default_features = false } - -[dev-dependencies] -substrate-serializer = { path = "../../substrate/serializer" } -pretty_assertions = "0.4" - -[features] -default = ["std"] -std = [ - "substrate-codec-derive/std", - "substrate-codec/std", - "substrate-primitives/std", - "substrate-runtime-std/std", - "substrate-runtime-primitives/std", - "serde_derive", - "serde/std", -] diff --git a/demo/runtime/Cargo.toml b/demo/runtime/Cargo.toml deleted file mode 100644 index 3bf3b5af928db..0000000000000 --- a/demo/runtime/Cargo.toml +++ /dev/null @@ -1,61 +0,0 @@ -[package] -name = "demo-runtime" -version = "0.1.0" -authors = ["Parity Technologies "] - -[dependencies] -rustc-hex = "1.0" -hex-literal = "0.1.0" -log = { version = "0.3", optional = true } -serde = { version = "1.0", default_features = false } -serde_derive = { version = "1.0", optional = true } -safe-mix = { version = "1.0", default_features = false} -substrate-codec = { path = "../../substrate/codec" } -substrate-codec-derive = { path = "../../substrate/codec/derive" } -substrate-runtime-std = { path = "../../substrate/runtime-std" } -substrate-runtime-io = { path = "../../substrate/runtime-io" } -substrate-runtime-support = { path = "../../substrate/runtime-support" } -substrate-primitives = { path = "../../substrate/primitives" } -substrate-keyring = { path = "../../substrate/keyring" } -substrate-runtime-balances = { path = "../../substrate/runtime/balances" } -substrate-runtime-consensus = { path = "../../substrate/runtime/consensus" } -substrate-runtime-contract = { path = "../../substrate/runtime/contract" } -substrate-runtime-council = { path = "../../substrate/runtime/council" } -substrate-runtime-democracy = { path = "../../substrate/runtime/democracy" } -substrate-runtime-executive = { path = "../../substrate/runtime/executive" } -substrate-runtime-primitives = { path = "../../substrate/runtime/primitives" } -substrate-runtime-session = { path = "../../substrate/runtime/session" } -substrate-runtime-staking = { path = "../../substrate/runtime/staking" } -substrate-runtime-system = { path = "../../substrate/runtime/system" } -substrate-runtime-timestamp = { path = "../../substrate/runtime/timestamp" } -substrate-runtime-treasury = { path = "../../substrate/runtime/treasury" } -substrate-runtime-version = { path = "../../substrate/runtime/version" } -demo-primitives = { path = "../primitives" } - -[features] -default = ["std"] -std = [ - "substrate-codec/std", - "substrate-primitives/std", - "substrate-runtime-std/std", - "substrate-runtime-io/std", - "substrate-runtime-support/std", - "substrate-runtime-balances/std", - "substrate-runtime-consensus/std", - "substrate-runtime-contract/std", - "substrate-runtime-council/std", - "substrate-runtime-democracy/std", - "substrate-runtime-executive/std", - "substrate-runtime-primitives/std", - "substrate-runtime-session/std", - "substrate-runtime-staking/std", - "substrate-runtime-system/std", - "substrate-runtime-timestamp/std", - "substrate-runtime-treasury/std", - "substrate-runtime-version/std", - "demo-primitives/std", - "serde_derive", - "serde/std", - "log", - "safe-mix/std" -] diff --git a/demo/runtime/wasm/Cargo.toml b/demo/runtime/wasm/Cargo.toml deleted file mode 100644 index 198e8c6280ad9..0000000000000 --- a/demo/runtime/wasm/Cargo.toml +++ /dev/null @@ -1,63 +0,0 @@ -[package] -name = "demo-runtime" -version = "0.1.0" -authors = ["Parity Technologies "] - -[lib] -crate-type = ["cdylib"] - -[dependencies] -integer-sqrt = { git = "https://github.com/paritytech/integer-sqrt-rs.git", branch = "master" } -safe-mix = { version = "1.0", default_features = false} -substrate-codec-derive = { path = "../../../substrate/codec/derive" } -substrate-codec = { path = "../../../substrate/codec", default-features = false } -substrate-primitives = { path = "../../../substrate/primitives", default-features = false } -substrate-runtime-std = { path = "../../../substrate/runtime-std", default-features = false } -substrate-runtime-io = { path = "../../../substrate/runtime-io", default-features = false } -substrate-runtime-support = { path = "../../../substrate/runtime-support", default-features = false } -substrate-runtime-balances = { path = "../../../substrate/runtime/balances", default-features = false } -substrate-runtime-consensus = { path = "../../../substrate/runtime/consensus", default-features = false } -substrate-runtime-contract = { path = "../../../substrate/runtime/contract", default-features = false } -substrate-runtime-council = { path = "../../../substrate/runtime/council", default-features = false } -substrate-runtime-democracy = { path = "../../../substrate/runtime/democracy", default-features = false } -substrate-runtime-executive = { path = "../../../substrate/runtime/executive", default-features = false } -substrate-runtime-primitives = { path = "../../../substrate/runtime/primitives", default-features = false } -substrate-runtime-session = { path = "../../../substrate/runtime/session", default-features = false } -substrate-runtime-staking = { path = "../../../substrate/runtime/staking", default-features = false } -substrate-runtime-system = { path = "../../../substrate/runtime/system", default-features = false } -substrate-runtime-timestamp = { path = "../../../substrate/runtime/timestamp", default-features = false } -substrate-runtime-treasury = { path = "../../../substrate/runtime/treasury", default-features = false } -substrate-runtime-version = { path = "../../../substrate/runtime/version", default-features = false } -demo-primitives = { path = "../../primitives", default-features = false } - -[features] -default = [] -std = [ - "safe-mix/std", - "substrate-codec/std", - "substrate-primitives/std", - "substrate-runtime-std/std", - "substrate-runtime-io/std", - "substrate-runtime-support/std", - "substrate-runtime-balances/std", - "substrate-runtime-consensus/std", - "substrate-runtime-contract/std", - "substrate-runtime-council/std", - "substrate-runtime-democracy/std", - "substrate-runtime-executive/std", - "substrate-runtime-primitives/std", - "substrate-runtime-session/std", - "substrate-runtime-staking/std", - "substrate-runtime-system/std", - "substrate-runtime-timestamp/std", - "substrate-runtime-treasury/std", - "substrate-runtime-version/std", - "demo-primitives/std", -] - -[profile.release] -panic = "abort" -lto = true - -[workspace] -members = [] diff --git a/demo/runtime/wasm/target/wasm32-unknown-unknown/release/demo_runtime.compact.wasm b/demo/runtime/wasm/target/wasm32-unknown-unknown/release/demo_runtime.compact.wasm deleted file mode 100644 index 392a6759728e1..0000000000000 Binary files a/demo/runtime/wasm/target/wasm32-unknown-unknown/release/demo_runtime.compact.wasm and /dev/null differ diff --git a/demo/runtime/wasm/target/wasm32-unknown-unknown/release/demo_runtime.wasm b/demo/runtime/wasm/target/wasm32-unknown-unknown/release/demo_runtime.wasm deleted file mode 100755 index b0912cf63bf2e..0000000000000 Binary files a/demo/runtime/wasm/target/wasm32-unknown-unknown/release/demo_runtime.wasm and /dev/null differ diff --git a/demo/service/Cargo.toml b/demo/service/Cargo.toml deleted file mode 100644 index 8b38012870e17..0000000000000 --- a/demo/service/Cargo.toml +++ /dev/null @@ -1,27 +0,0 @@ -[package] -name = "demo-service" -version = "0.1.0" -authors = ["Parity Technologies "] - -[dependencies] -parking_lot = "0.4" -error-chain = "0.12" -lazy_static = "1.0" -log = "0.3" -slog = "^2" -tokio = "0.1.7" -hex-literal = "0.1" -ed25519 = { path = "../../substrate/ed25519" } -demo-api = { path = "../api" } -demo-primitives = { path = "../primitives" } -demo-runtime = { path = "../runtime" } -demo-executor = { path = "../executor" } -demo-consensus = { path = "../consensus" } -demo-network = { path = "../network" } -demo-transaction-pool = { path = "../transaction-pool" } -substrate-runtime-io = { path = "../../substrate/runtime-io" } -substrate-primitives = { path = "../../substrate/primitives" } -substrate-network = { path = "../../substrate/network" } -substrate-client = { path = "../../substrate/client" } -substrate-service = { path = "../../substrate/service" } -substrate-telemetry = { path = "../../substrate/telemetry" } diff --git a/demo/transaction-pool/Cargo.toml b/demo/transaction-pool/Cargo.toml deleted file mode 100644 index 94eaae111ae7d..0000000000000 --- a/demo/transaction-pool/Cargo.toml +++ /dev/null @@ -1,19 +0,0 @@ -[package] -name = "demo-transaction-pool" -version = "0.1.0" -authors = ["Parity Technologies "] - -[dependencies] -log = "0.3.0" -error-chain = "0.12" -parking_lot = "0.4" -demo-api = { path = "../api" } -demo-primitives = { path = "../primitives" } -demo-runtime = { path = "../runtime" } -substrate-client = { path = "../../substrate/client" } -substrate-codec = { path = "../../substrate/codec" } -substrate-keyring = { path = "../../substrate/keyring" } -substrate-extrinsic-pool = { path = "../../substrate/extrinsic-pool" } -substrate-primitives = { path = "../../substrate/primitives" } -substrate-runtime-primitives = { path = "../../substrate/runtime/primitives" } -ed25519 = { path = "../../substrate/ed25519" } diff --git a/doc/packages/substrate.adoc b/doc/packages/substrate.adoc index 75f391e2b6409..f82ed0ee688bc 100644 --- a/doc/packages/substrate.adoc +++ b/doc/packages/substrate.adoc @@ -3,64 +3,62 @@ :leveloffset: +3 -include::../../substrate/bft/README.adoc[] +include::../../core/bft/README.adoc[] -include::../../substrate/cli/README.adoc[] +include::../../core/cli/README.adoc[] -include::../../substrate/client/README.adoc[] +include::../../core/client/README.adoc[] -include::../../substrate/codec/README.adoc[] +include::../../codec/README.adoc[] -include::../../substrate/ed25519/README.adoc[] +include::../../environmental/README.adoc[] -include::../../substrate/environmental/README.adoc[] +include::../../core/executor/README.adoc[] -include::../../substrate/executor/README.adoc[] +include::../../core/extrinsic-pool/README.adoc[] -include::../../substrate/extrinsic-pool/README.adoc[] +include::../../core/keyring/README.adoc[] -include::../../substrate/keyring/README.adoc[] +include::../../core/keystore/README.adoc[] -include::../../substrate/keystore/README.adoc[] +include::../../core/misbehavior-check/README.adoc[] -include::../../substrate/misbehavior-check/README.adoc[] +include::../../core/network/README.adoc[] -include::../../substrate/network/README.adoc[] +include::../../core/network-libp2p/README.adoc[] -include::../../substrate/network-libp2p/README.adoc[] +include::../../core/primitives/README.adoc[] -include::../../substrate/primitives/README.adoc[] +include::../../pwasm-alloc/README.adoc[] -include::../../substrate/pwasm-alloc/README.adoc[] +include::../../pwasm-libc/README.adoc[] -include::../../substrate/pwasm-libc/README.adoc[] +include::../../core/rpc/README.adoc[] -include::../../substrate/rpc/README.adoc[] +include::../../core/rpc-servers/README.adoc[] -include::../../substrate/rpc-servers/README.adoc[] +include::../../srml/README.adoc[] -include::../../substrate/runtime/README.adoc[] +include::../../core/sr-io/README.adoc[] -include::../../substrate/runtime-io/README.adoc[] +include::../../core/sr-sandbox/README.adoc[] -include::../../substrate/runtime-sandbox/README.adoc[] +include::../../core/sr-std/README.adoc[] -include::../../substrate/runtime-std/README.adoc[] +include::../../core/runtime-support/README.adoc[] -include::../../substrate/runtime-support/README.adoc[] +include::../../core/serializer/README.adoc[] -include::../../substrate/serializer/README.adoc[] +include::../../core/service/README.adoc[] -include::../../substrate/service/README.adoc[] +include::../../core/state-db/README.adoc[] -include::../../substrate/state-db/README.adoc[] +include::../../core/state-machine/README.adoc[] -include::../../substrate/state-machine/README.adoc[] +include::../../core/telemetry/README.adoc[] -include::../../substrate/telemetry/README.adoc[] +include::../../core/test-client/README.adoc[] -include::../../substrate/test-client/README.adoc[] - -include::../../substrate/test-runtime/README.adoc[] +include::../../core/test-srml/README.adoc[] :leveloffset: -3 diff --git a/substrate/environmental/Cargo.toml b/environmental/Cargo.toml similarity index 100% rename from substrate/environmental/Cargo.toml rename to environmental/Cargo.toml diff --git a/substrate/environmental/README.adoc b/environmental/README.adoc similarity index 100% rename from substrate/environmental/README.adoc rename to environmental/README.adoc diff --git a/substrate/environmental/src/lib.rs b/environmental/src/lib.rs similarity index 100% rename from substrate/environmental/src/lib.rs rename to environmental/src/lib.rs diff --git a/substrate/environmental/with_std.rs b/environmental/with_std.rs similarity index 100% rename from substrate/environmental/with_std.rs rename to environmental/with_std.rs diff --git a/substrate/environmental/without_std.rs b/environmental/without_std.rs similarity index 100% rename from substrate/environmental/without_std.rs rename to environmental/without_std.rs diff --git a/demo/Cargo.toml b/node/Cargo.toml similarity index 91% rename from demo/Cargo.toml rename to node/Cargo.toml index 326844dc9002f..8746954b5a849 100644 --- a/demo/Cargo.toml +++ b/node/Cargo.toml @@ -10,7 +10,7 @@ build = "build.rs" [dependencies] error-chain = "0.12" -demo-cli = { path = "cli" } +node-cli = { path = "cli" } futures = "0.1" ctrlc = { version = "3.0", features = ["termination"] } diff --git a/node/api/Cargo.toml b/node/api/Cargo.toml new file mode 100644 index 0000000000000..5a0cee1387772 --- /dev/null +++ b/node/api/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "node-api" +version = "0.1.0" +authors = ["Parity Technologies "] + +[dependencies] +node-runtime = { path = "../runtime" } +node-primitives = { path = "../primitives" } +substrate-client = { path = "../../core/client" } +substrate-primitives = { path = "../../core/primitives" } + +[dev-dependencies] +substrate-keyring = { path = "../../core/keyring" } diff --git a/demo/api/src/lib.rs b/node/api/src/lib.rs similarity index 92% rename from demo/api/src/lib.rs rename to node/api/src/lib.rs index 848c0530464b5..233d82aac2bdb 100644 --- a/demo/api/src/lib.rs +++ b/node/api/src/lib.rs @@ -1,26 +1,26 @@ // Copyright 2018 Parity Technologies (UK) Ltd. -// This file is part of Substrate Demo. +// This file is part of Substrate. -// Substrate Demo is free software: you can redistribute it and/or modify +// Substrate 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. -// Substrate Demo is distributed in the hope that it will be useful, +// Substrate 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 Substrate Demo. If not, see . +// along with Substrate. If not, see . -//! Strongly typed API for Substrate Demo runtime. +//! Strongly typed API for Substrate runtime. #![warn(missing_docs)] #![warn(unused_extern_crates)] -extern crate demo_primitives as primitives; -extern crate demo_runtime as runtime; +extern crate node_primitives as primitives; +extern crate node_runtime as runtime; extern crate substrate_client as client; extern crate substrate_primitives; @@ -44,7 +44,7 @@ pub trait BlockBuilder { fn bake(self) -> Result; } -/// Trait encapsulating the demo API. +/// Trait encapsulating the node API. /// /// All calls should fail when the exact runtime is unknown. pub trait Api { diff --git a/demo/build.rs b/node/build.rs similarity index 73% rename from demo/build.rs rename to node/build.rs index 0f2f3b9bdcaf8..4e48353aeac42 100644 --- a/demo/build.rs +++ b/node/build.rs @@ -1,18 +1,18 @@ // Copyright 2015-2018 Parity Technologies (UK) Ltd. -// This file is part of Substrate Demo. +// This file is part of Substrate. -// Substrate Demo is free software: you can redistribute it and/or modify +// Substrate 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. -// Substrate Demo is distributed in the hope that it will be useful, +// Substrate 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 Substrate Demo. If not, see . +// along with Substrate. If not, see . extern crate vergen; diff --git a/node/cli/Cargo.toml b/node/cli/Cargo.toml new file mode 100644 index 0000000000000..d26a47aade099 --- /dev/null +++ b/node/cli/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "node-cli" +version = "0.1.0" +authors = ["Parity Technologies "] +description = "Substrate node implementation in Rust." + +[dependencies] +log = "0.3" +tokio = "0.1.7" +exit-future = "0.1" +substrate-cli = { path = "../../core/cli" } +node-service = { path = "../service" } diff --git a/demo/cli/src/cli.yml b/node/cli/src/cli.yml similarity index 76% rename from demo/cli/src/cli.yml rename to node/cli/src/cli.yml index 263af9d9ef300..6c1fe186e793b 100644 --- a/demo/cli/src/cli.yml +++ b/node/cli/src/cli.yml @@ -1,6 +1,6 @@ -name: substrate-demo +name: substrate-node author: "Parity Team " -about: Substrate Demo Node Rust Implementation +about: Substrate Node Rust Implementation args: - log: short: l diff --git a/demo/cli/src/error.rs b/node/cli/src/error.rs similarity index 73% rename from demo/cli/src/error.rs rename to node/cli/src/error.rs index c8b4fdedde099..a83466fbe679d 100644 --- a/demo/cli/src/error.rs +++ b/node/cli/src/error.rs @@ -1,18 +1,18 @@ // Copyright 2018 Parity Technologies (UK) Ltd. -// This file is part of Substrate Demo. +// This file is part of Substrate. -// Substrate Demo is free software: you can redistribute it and/or modify +// Substrate 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. -// Substrate Demo is distributed in the hope that it will be useful, +// Substrate 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 Substrate Demo. If not, see . +// along with Substrate. If not, see . //! Initialization errors. diff --git a/demo/cli/src/lib.rs b/node/cli/src/lib.rs similarity index 90% rename from demo/cli/src/lib.rs rename to node/cli/src/lib.rs index 09c09e1cc6ccb..75cbf5d003f7e 100644 --- a/demo/cli/src/lib.rs +++ b/node/cli/src/lib.rs @@ -1,20 +1,20 @@ // Copyright 2018 Parity Technologies (UK) Ltd. -// This file is part of Substrate Demo. +// This file is part of Substrate. -// Substrate Demo is free software: you can redistribute it and/or modify +// Substrate 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. -// Substrate Demo is distributed in the hope that it will be useful, +// Substrate 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 Substrate Demo. If not, see . +// along with Substrate. If not, see . -//! Substrate Demo CLI library. +//! Substrate CLI library. #![warn(missing_docs)] #![warn(unused_extern_crates)] @@ -22,7 +22,7 @@ extern crate tokio; extern crate substrate_cli as cli; -extern crate demo_service as service; +extern crate node_service as service; extern crate exit_future; #[macro_use] @@ -82,7 +82,7 @@ pub fn run(args: I, exit: E, version: cli::VersionInfo) -> error::Resul T: Into + Clone, E: IntoExit, { - match cli::prepare_execution::(args, exit, version, load_spec, "substrate-demo")? { + match cli::prepare_execution::(args, exit, version, load_spec, "substrate-node")? { cli::Action::ExecutedInternally => (), cli::Action::RunService((config, exit)) => { info!("Parity ·:· Substrate"); diff --git a/node/consensus/Cargo.toml b/node/consensus/Cargo.toml new file mode 100644 index 0000000000000..e733d7ae7e9f9 --- /dev/null +++ b/node/consensus/Cargo.toml @@ -0,0 +1,25 @@ +[package] +name = "node-consensus" +version = "0.1.0" +authors = ["Parity Technologies "] + +[dependencies] +futures = "0.1.17" +parking_lot = "0.4" +tokio = "0.1.7" +error-chain = "0.12" +log = "0.3" +exit-future = "0.1" +rhododendron = "0.3" +node-api = { path = "../api" } +node-primitives = { path = "../primitives" } +node-runtime = { path = "../runtime" } +node-transaction-pool = { path = "../transaction-pool" } +substrate-bft = { path = "../../core/bft" } +parity-codec = { path = "../../codec" } +substrate-primitives = { path = "../../core/primitives" } +substrate-client = { path = "../../core/client" } +sr-primitives = { path = "../../core/sr-primitives" } + +[dev-dependencies] +substrate-keyring = { path = "../../core/keyring" } diff --git a/demo/consensus/README.adoc b/node/consensus/README.adoc similarity index 100% rename from demo/consensus/README.adoc rename to node/consensus/README.adoc diff --git a/demo/consensus/src/error.rs b/node/consensus/src/error.rs similarity index 82% rename from demo/consensus/src/error.rs rename to node/consensus/src/error.rs index e8b60c847c34d..01823a8e50384 100644 --- a/demo/consensus/src/error.rs +++ b/node/consensus/src/error.rs @@ -1,18 +1,18 @@ // Copyright 2018 Parity Technologies (UK) Ltd. -// This file is part of Substrate Demo. +// This file is part of Substrate. -// Substrate Demo is free software: you can redistribute it and/or modify +// Substrate 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. -// Substrate Demo is distributed in the hope that it will be useful, +// Substrate 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 Substrate Demo. If not, see . +// along with Substrate. If not, see . //! Errors that can occur during the consensus process. @@ -20,7 +20,7 @@ use primitives::AuthorityId; error_chain! { links { - Api(::demo_api::Error, ::demo_api::ErrorKind); + Api(::node_api::Error, ::node_api::ErrorKind); Bft(::bft::Error, ::bft::ErrorKind); } diff --git a/demo/consensus/src/evaluation.rs b/node/consensus/src/evaluation.rs similarity index 84% rename from demo/consensus/src/evaluation.rs rename to node/consensus/src/evaluation.rs index 0d073aa52109c..9d4d5b0911905 100644 --- a/demo/consensus/src/evaluation.rs +++ b/node/consensus/src/evaluation.rs @@ -1,30 +1,30 @@ // Copyright 2018 Parity Technologies (UK) Ltd. -// This file is part of Substrate Demo. +// This file is part of Substrate. -// Substrate Demo is free software: you can redistribute it and/or modify +// Substrate 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. -// Substrate Demo is distributed in the hope that it will be useful, +// Substrate 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 Substrate Demo. If not, see . +// along with Substrate. If not, see . //! Block evaluation and evaluation errors. use super::MAX_TRANSACTIONS_SIZE; use codec::{Decode, Encode}; -use demo_runtime::{Block as GenericBlock, CheckedBlock}; -use demo_primitives::{Block, Hash, BlockNumber, Timestamp}; +use node_runtime::{Block as GenericBlock, CheckedBlock}; +use node_primitives::{Block, Hash, BlockNumber, Timestamp}; error_chain! { links { - Api(::demo_api::Error, ::demo_api::ErrorKind); + Api(::node_api::Error, ::node_api::ErrorKind); } errors { @@ -54,7 +54,7 @@ error_chain! { } } -/// Attempt to evaluate a substrate block as a demo block, returning error +/// Attempt to evaluate a substrate block as a node block, returning error /// upon any initial validity checks failing. pub fn evaluate_initial( proposal: &Block, diff --git a/demo/consensus/src/lib.rs b/node/consensus/src/lib.rs similarity index 92% rename from demo/consensus/src/lib.rs rename to node/consensus/src/lib.rs index 7f55bc1e68fef..a807ad69a70ec 100644 --- a/demo/consensus/src/lib.rs +++ b/node/consensus/src/lib.rs @@ -1,33 +1,31 @@ // Copyright 2018 Parity Technologies (UK) Ltd. -// This file is part of Substrate Demo. +// This file is part of Substrate. -// Substrate Demo is free software: you can redistribute it and/or modify +// Substrate 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. -// Substrate Demo is distributed in the hope that it will be useful, +// Substrate 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 Substrate Demo. If not, see . +// along with Substrate. If not, see . //! This service uses BFT consensus provided by the substrate. -extern crate ed25519; extern crate parking_lot; -extern crate demo_api; -extern crate demo_transaction_pool as transaction_pool; -extern crate demo_runtime; -extern crate demo_primitives; +extern crate node_api; +extern crate node_transaction_pool as transaction_pool; +extern crate node_runtime; +extern crate node_primitives; extern crate substrate_bft as bft; -extern crate substrate_codec as codec; +extern crate parity_codec as codec; extern crate substrate_primitives as primitives; -extern crate substrate_runtime_support as runtime_support; -extern crate substrate_runtime_primitives as runtime_primitives; +extern crate sr_primitives as runtime_primitives; extern crate substrate_client as client; extern crate exit_future; @@ -48,9 +46,9 @@ use std::sync::Arc; use std::time::{self, Duration, Instant}; use codec::{Decode, Encode}; -use demo_api::Api; -use demo_primitives::{AccountId, Hash, Block, BlockId, BlockNumber, Header, Timestamp, SessionKey}; -use primitives::AuthorityId; +use node_api::Api; +use node_primitives::{AccountId, Hash, Block, BlockId, BlockNumber, Header, Timestamp, SessionKey}; +use primitives::{AuthorityId, ed25519}; use transaction_pool::TransactionPool; use tokio::runtime::TaskExecutor; use tokio::timer::Delay; @@ -202,9 +200,9 @@ impl bft::Proposer for Proposer type Evaluate = Box>; fn propose(&self) -> Result { - use demo_api::BlockBuilder; + use node_api::BlockBuilder; use runtime_primitives::traits::{Hash as HashT, BlakeTwo256}; - use demo_primitives::InherentData; + use node_primitives::InherentData; const MAX_VOTE_OFFLINE_SECONDS: Duration = Duration::from_secs(60); @@ -363,8 +361,8 @@ impl bft::Proposer for Proposer fn import_misbehavior(&self, misbehavior: Vec<(AuthorityId, bft::Misbehavior)>) { use rhododendron::Misbehavior as GenericMisbehavior; use runtime_primitives::bft::{MisbehaviorKind, MisbehaviorReport}; - use demo_primitives::UncheckedExtrinsic as GenericExtrinsic; - use demo_runtime::{Call, UncheckedExtrinsic, ConsensusCall}; + use node_primitives::UncheckedExtrinsic as GenericExtrinsic; + use node_runtime::{Call, UncheckedExtrinsic, ConsensusCall}; let local_id = self.local_key.public().0.into(); let mut next_index = { @@ -408,7 +406,7 @@ impl bft::Proposer for Proposer let local_id = self.local_key.public().0.into(); let extrinsic = UncheckedExtrinsic { - signature: Some((demo_runtime::RawAddress::Id(local_id), signature)), + signature: Some((node_runtime::RawAddress::Id(local_id), signature)), index: payload.0, function: payload.1, }; @@ -427,7 +425,7 @@ impl bft::Proposer for Proposer // alter the message based on whether we think the empty proposer was forced to skip the round. // this is determined by checking if our local validator would have been forced to skip the round. if !was_proposed { - let public = ::ed25519::Public::from_raw(primary_validator.0); + let public = ed25519::Public::from_raw(primary_validator.0); info!( "Potential Offline Validator: {} failed to propose during assigned slot: {}", public, diff --git a/demo/consensus/src/offline_tracker.rs b/node/consensus/src/offline_tracker.rs similarity index 92% rename from demo/consensus/src/offline_tracker.rs rename to node/consensus/src/offline_tracker.rs index 243b801bcec0c..18845dd68b213 100644 --- a/demo/consensus/src/offline_tracker.rs +++ b/node/consensus/src/offline_tracker.rs @@ -1,22 +1,22 @@ // Copyright 2018 Parity Technologies (UK) Ltd. -// This file is part of Substrate Demo. +// This file is part of Substrate. -// Substrate Demo is free software: you can redistribute it and/or modify +// Substrate 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. -// Substrate Demo is distributed in the hope that it will be useful, +// Substrate 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 Substrate Demo. If not, see . +// along with Substrate. If not, see . //! Tracks offline validators. -use demo_primitives::AccountId; +use node_primitives::AccountId; use std::collections::HashMap; use std::time::{Instant, Duration}; diff --git a/demo/consensus/src/service.rs b/node/consensus/src/service.rs similarity index 93% rename from demo/consensus/src/service.rs rename to node/consensus/src/service.rs index e70bc78ab2154..08bfe40af6d0b 100644 --- a/demo/consensus/src/service.rs +++ b/node/consensus/src/service.rs @@ -1,18 +1,18 @@ // Copyright 2018 Parity Technologies (UK) Ltd. -// This file is part of Substrate Demo. +// This file is part of Substrate. -// Substrate Demo is free software: you can redistribute it and/or modify +// Substrate 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. -// Substrate Demo is distributed in the hope that it will be useful, +// Substrate 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 Substrate Demo. If not, see . +// along with Substrate. If not, see . //! Consensus service. @@ -26,8 +26,8 @@ use bft::{self, BftService}; use client::{BlockchainEvents, ChainHead, BlockBody}; use ed25519; use futures::prelude::*; -use demo_api::Api; -use demo_primitives::{Block, Header}; +use node_api::Api; +use node_primitives::{Block, Header}; use transaction_pool::TransactionPool; use tokio::executor::current_thread::TaskExecutor as LocalThreadHandle; diff --git a/node/executor/Cargo.toml b/node/executor/Cargo.toml new file mode 100644 index 0000000000000..fe93fd278da7c --- /dev/null +++ b/node/executor/Cargo.toml @@ -0,0 +1,28 @@ +[package] +name = "node-executor" +version = "0.1.0" +authors = ["Parity Technologies "] +description = "Substrate node implementation in Rust." + +[dependencies] +hex-literal = "0.1" +triehash = "0.2" +parity-codec = { path = "../../codec" } +sr-io = { path = "../../core/sr-io" } +substrate-state-machine = { path = "../../core/state-machine" } +substrate-executor = { path = "../../core/executor" } +substrate-primitives = { path = "../../core/primitives" } +node-primitives = { path = "../primitives" } +node-runtime = { path = "../runtime" } + +[dev-dependencies] +substrate-keyring = { path = "../../core/keyring" } +sr-primitives = { path = "../../core/sr-primitives" } +srml-support = { path = "../../srml/support" } +srml-balances = { path = "../../srml/balances" } +srml-session = { path = "../../srml/session" } +srml-staking = { path = "../../srml/staking" } +srml-system = { path = "../../srml/system" } +srml-consensus = { path = "../../srml/consensus" } +srml-timestamp = { path = "../../srml/timestamp" } +srml-treasury = { path = "../../srml/treasury" } diff --git a/demo/executor/src/lib.rs b/node/executor/src/lib.rs similarity index 91% rename from demo/executor/src/lib.rs rename to node/executor/src/lib.rs index 1c1631bea071b..a226834f1c80b 100644 --- a/demo/executor/src/lib.rs +++ b/node/executor/src/lib.rs @@ -1,46 +1,45 @@ // Copyright 2018 Parity Technologies (UK) Ltd. -// This file is part of Substrate Demo. +// This file is part of Substrate. -// Substrate Demo is free software: you can redistribute it and/or modify +// Substrate 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. -// Substrate Demo is distributed in the hope that it will be useful, +// Substrate 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 Substrate Demo. If not, see . +// along with Substrate. If not, see . //! A `CodeExecutor` specialisation which uses natively compiled runtime when the wasm to be //! executed is equivalent to the natively compiled code. -extern crate demo_runtime; +extern crate node_runtime; #[macro_use] extern crate substrate_executor; -extern crate substrate_codec as codec; +extern crate parity_codec as codec; extern crate substrate_state_machine as state_machine; -extern crate substrate_runtime_io as runtime_io; +extern crate sr_io as runtime_io; extern crate substrate_primitives as primitives; -extern crate demo_primitives; -extern crate ed25519; +extern crate node_primitives; extern crate triehash; #[cfg(test)] extern crate substrate_keyring as keyring; -#[cfg(test)] extern crate substrate_runtime_primitives as runtime_primitives; -#[cfg(test)] extern crate substrate_runtime_support as runtime_support; -#[cfg(test)] extern crate substrate_runtime_balances as balances; -#[cfg(test)] extern crate substrate_runtime_session as session; -#[cfg(test)] extern crate substrate_runtime_staking as staking; -#[cfg(test)] extern crate substrate_runtime_system as system; -#[cfg(test)] extern crate substrate_runtime_consensus as consensus; -#[cfg(test)] extern crate substrate_runtime_timestamp as timestamp; -#[cfg(test)] extern crate substrate_runtime_treasury as treasury; +#[cfg(test)] extern crate sr_primitives as runtime_primitives; +#[cfg(test)] extern crate srml_support as runtime_support; +#[cfg(test)] extern crate srml_balances as balances; +#[cfg(test)] extern crate srml_session as session; +#[cfg(test)] extern crate srml_staking as staking; +#[cfg(test)] extern crate srml_system as system; +#[cfg(test)] extern crate srml_consensus as consensus; +#[cfg(test)] extern crate srml_timestamp as timestamp; +#[cfg(test)] extern crate srml_treasury as treasury; #[cfg(test)] #[macro_use] extern crate hex_literal; pub use substrate_executor::NativeExecutor; -native_executor_instance!(pub Executor, demo_runtime::api::dispatch, demo_runtime::VERSION, include_bytes!("../../runtime/wasm/target/wasm32-unknown-unknown/release/demo_runtime.compact.wasm")); +native_executor_instance!(pub Executor, node_runtime::api::dispatch, node_runtime::VERSION, include_bytes!("../../runtime/wasm/target/wasm32-unknown-unknown/release/node_runtime.compact.wasm")); #[cfg(test)] mod tests { @@ -51,18 +50,17 @@ mod tests { use keyring::Keyring; use runtime_support::{Hashable, StorageValue, StorageMap}; use state_machine::{CodeExecutor, TestExternalities}; - use primitives::{twox_128, Blake2Hasher}; - use demo_primitives::{Hash, BlockNumber, AccountId}; + use primitives::{twox_128, Blake2Hasher, ed25519::{Public, Pair}}; + use node_primitives::{Hash, BlockNumber, AccountId}; use runtime_primitives::traits::Header as HeaderT; use runtime_primitives::{ApplyOutcome, ApplyError, ApplyResult}; use {balances, staking, session, system, consensus, timestamp, treasury}; use system::{EventRecord, Phase}; - use demo_runtime::{Header, Block, UncheckedExtrinsic, CheckedExtrinsic, Call, Runtime, Balances, + use node_runtime::{Header, Block, UncheckedExtrinsic, CheckedExtrinsic, Call, Runtime, Balances, BuildStorage, GenesisConfig, BalancesConfig, SessionConfig, StakingConfig, System, Event}; - use ed25519::{Public, Pair}; - const BLOATY_CODE: &[u8] = include_bytes!("../../runtime/wasm/target/wasm32-unknown-unknown/release/demo_runtime.wasm"); - const COMPACT_CODE: &[u8] = include_bytes!("../../runtime/wasm/target/wasm32-unknown-unknown/release/demo_runtime.compact.wasm"); + const BLOATY_CODE: &[u8] = include_bytes!("../../runtime/wasm/target/wasm32-unknown-unknown/release/node_runtime.wasm"); + const COMPACT_CODE: &[u8] = include_bytes!("../../runtime/wasm/target/wasm32-unknown-unknown/release/node_runtime.compact.wasm"); // TODO: move into own crate. macro_rules! map { @@ -490,7 +488,7 @@ mod tests { twox_128(&>::key_for(0)).to_vec() => vec![0u8; 32] ]; - let foreign_code = include_bytes!("../../runtime/wasm/target/wasm32-unknown-unknown/release/demo_runtime.wasm"); + let foreign_code = include_bytes!("../../runtime/wasm/target/wasm32-unknown-unknown/release/node_runtime.wasm"); let r = WasmExecutor::new().call(&mut t, 8, &foreign_code[..], "initialise_block", &vec![].and(&from_block_number(1u64))); assert!(r.is_ok()); let r = WasmExecutor::new().call(&mut t, 8, &foreign_code[..], "apply_extrinsic", &vec![].and(&xt())).unwrap(); @@ -511,7 +509,7 @@ mod tests { twox_128(&>::key_for(0)).to_vec() => vec![0u8; 32] ]; - let foreign_code = include_bytes!("../../runtime/wasm/target/wasm32-unknown-unknown/release/demo_runtime.compact.wasm"); + let foreign_code = include_bytes!("../../runtime/wasm/target/wasm32-unknown-unknown/release/node_runtime.compact.wasm"); let r = WasmExecutor::new().call(&mut t, 8, &foreign_code[..], "initialise_block", &vec![].and(&from_block_number(1u64))); assert!(r.is_ok()); let r = WasmExecutor::new().call(&mut t, 8, &foreign_code[..], "apply_extrinsic", &vec![].and(&xt())).unwrap(); diff --git a/node/network/Cargo.toml b/node/network/Cargo.toml new file mode 100644 index 0000000000000..645edcfc42b77 --- /dev/null +++ b/node/network/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "node-network" +version = "0.1.0" +authors = ["Parity Technologies "] +description = "Substrate node networking protocol" + +[dependencies] +node-api = { path = "../api" } +node-consensus = { path = "../consensus" } +node-primitives = { path = "../primitives" } +substrate-bft = { path = "../../core/bft" } +substrate-network = { path = "../../core/network" } +substrate-primitives = { path = "../../core/primitives" } +futures = "0.1" +tokio = "0.1.7" +log = "0.4" +rhododendron = "0.3" diff --git a/demo/network/src/consensus.rs b/node/network/src/consensus.rs similarity index 93% rename from demo/network/src/consensus.rs rename to node/network/src/consensus.rs index d7c5fd92c570a..63ed119afec0d 100644 --- a/demo/network/src/consensus.rs +++ b/node/network/src/consensus.rs @@ -1,30 +1,30 @@ // Copyright 2018 Parity Technologies (UK) Ltd. -// This file is part of Substrate Demo. +// This file is part of Substrate. -// Substrate Demo is free software: you can redistribute it and/or modify +// Substrate 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. -// Substrate Demo is distributed in the hope that it will be useful, +// Substrate 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 Substrate Demo. If not, see . +// along with Substrate. If not, see . //! The "consensus" networking code built on top of the base network service. -//! This fulfills the `demo_consensus::Network` trait, providing a hook to be called +//! This fulfills the `node_consensus::Network` trait, providing a hook to be called //! each time consensus begins on a new chain head. use bft; -use ed25519; +use substrate_primitives::ed25519; use substrate_network::{self as net, generic_message as msg}; use substrate_network::consensus_gossip::ConsensusMessage; -use demo_api::Api; -use demo_consensus::Network; -use demo_primitives::{Block, Hash, SessionKey}; +use node_api::Api; +use node_consensus::Network; +use node_primitives::{Block, Hash, SessionKey}; use rhododendron; use futures::prelude::*; @@ -200,7 +200,7 @@ impl Future for MessageProcessTask { Ok(Async::Ready(None)) => return Ok(Async::Ready(())), Ok(Async::NotReady) => return Ok(Async::NotReady), Err(e) => { - debug!(target: "demo-network", "Error getting consensus message: {:?}", e); + debug!(target: "node-network", "Error getting consensus message: {:?}", e); return Err(e); }, } @@ -215,7 +215,7 @@ pub struct InputAdapter { impl Stream for InputAdapter { type Item = bft::Communication; - type Error = ::demo_consensus::Error; + type Error = ::node_consensus::Error; fn poll(&mut self) -> Poll, Self::Error> { match self.input.poll() { @@ -253,7 +253,7 @@ impl Network for ConsensusNetwork

{ type Input = InputAdapter; /// The output sink of BFT messages. Messages sent here should eventually pass to all /// current validators. - type Output = BftSink<::demo_consensus::Error>; + type Output = BftSink<::node_consensus::Error>; /// Get input and output streams of BFT messages. fn communication_for( @@ -285,7 +285,7 @@ impl Network for ConsensusNetwork

{ match process_task { Some(task) => task_executor.spawn(task), - None => warn!(target: "demo-network", "Cannot process incoming messages: network appears to be down"), + None => warn!(target: "node-network", "Cannot process incoming messages: network appears to be down"), } (InputAdapter { input: bft_recv }, sink) diff --git a/demo/network/src/lib.rs b/node/network/src/lib.rs similarity index 78% rename from demo/network/src/lib.rs rename to node/network/src/lib.rs index f32c039669f3a..a01dae79b4c94 100644 --- a/demo/network/src/lib.rs +++ b/node/network/src/lib.rs @@ -1,20 +1,20 @@ // Copyright 2018 Parity Technologies (UK) Ltd. -// This file is part of Substrate Demo. +// This file is part of Substrate. -// Substrate Demo is free software: you can redistribute it and/or modify +// Substrate 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. -// Substrate Demo is distributed in the hope that it will be useful, +// Substrate 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 Substrate Demo. If not, see . +// along with Substrate. If not, see . -//! Substrate Demo-specific network implementation. +//! Substrate-specific network implementation. //! //! This manages gossip of consensus messages for BFT. @@ -22,12 +22,12 @@ extern crate substrate_bft as bft; extern crate substrate_network; +extern crate substrate_primitives; -extern crate demo_api; -extern crate demo_consensus; -extern crate demo_primitives; +extern crate node_api; +extern crate node_consensus; +extern crate node_primitives; -extern crate ed25519; extern crate futures; extern crate tokio; extern crate rhododendron; @@ -37,7 +37,7 @@ extern crate log; pub mod consensus; -use demo_primitives::{Block, Hash, Header}; +use node_primitives::{Block, Hash, Header}; use substrate_network::{NodeIndex, Context, Severity}; use substrate_network::consensus_gossip::ConsensusGossip; use substrate_network::{message, generic_message}; @@ -49,7 +49,7 @@ pub const PROTOCOL_ID: ::substrate_network::ProtocolId = *b"dot"; type FullStatus = GenericFullStatus; -/// Specialization of the network service for the demo protocol. +/// Specialization of the network service for the node protocol. pub type NetworkService = ::substrate_network::Service; @@ -60,7 +60,7 @@ pub struct Protocol { } impl Protocol { - /// Instantiate a demo protocol handler. + /// Instantiate a node protocol handler. pub fn new() -> Self { Protocol { consensus_gossip: ConsensusGossip::new(), @@ -92,13 +92,13 @@ impl Specialization for Protocol { fn on_message(&mut self, ctx: &mut Context, who: NodeIndex, message: message::Message) { match message { generic_message::Message::BftMessage(msg) => { - trace!(target: "demo-network", "BFT message from {}: {:?}", who, msg); + trace!(target: "node-network", "BFT message from {}: {:?}", who, msg); // TODO: check signature here? what if relevant block is unknown? self.consensus_gossip.on_bft_message(ctx, who, msg) } generic_message::Message::ChainSpecific(_) => { - trace!(target: "demo-network", "Bad message from {}", who); - ctx.report_peer(who, Severity::Bad("Invalid demo protocol message format")); + trace!(target: "node-network", "Bad message from {}", who); + ctx.report_peer(who, Severity::Bad("Invalid node protocol message format")); } _ => {} } diff --git a/node/primitives/Cargo.toml b/node/primitives/Cargo.toml new file mode 100644 index 0000000000000..7d8840da42f0b --- /dev/null +++ b/node/primitives/Cargo.toml @@ -0,0 +1,29 @@ +[package] +name = "node-primitives" +version = "0.1.0" +authors = ["Parity Technologies "] + +[dependencies] +serde = { version = "1.0", default_features = false } +serde_derive = { version = "1.0", optional = true } +parity-codec = { path = "../../codec", default_features = false } +parity-codec-derive = { path = "../../codec/derive", default_features = false } +substrate-primitives = { path = "../../core/primitives", default_features = false } +sr-std = { path = "../../core/sr-std", default_features = false } +sr-primitives = { path = "../../core/sr-primitives", default_features = false } + +[dev-dependencies] +substrate-serializer = { path = "../../core/serializer" } +pretty_assertions = "0.4" + +[features] +default = ["std"] +std = [ + "parity-codec-derive/std", + "parity-codec/std", + "substrate-primitives/std", + "sr-std/std", + "sr-primitives/std", + "serde_derive", + "serde/std", +] diff --git a/demo/primitives/src/lib.rs b/node/primitives/src/lib.rs similarity index 83% rename from demo/primitives/src/lib.rs rename to node/primitives/src/lib.rs index d93b75f3954e4..670e0bdc3d276 100644 --- a/demo/primitives/src/lib.rs +++ b/node/primitives/src/lib.rs @@ -1,20 +1,20 @@ // Copyright 2018 Parity Technologies (UK) Ltd. -// This file is part of Substrate Demo. +// This file is part of Substrate. -// Substrate Demo is free software: you can redistribute it and/or modify +// Substrate 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. -// Substrate Demo is distributed in the hope that it will be useful, +// Substrate 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 Substrate Demo. If not, see . +// along with Substrate. If not, see . -//! Low-level types used throughout the Substrate Demo code. +//! Low-level types used throughout the Substrate code. #![warn(missing_docs)] @@ -29,12 +29,12 @@ extern crate serde; extern crate serde_derive; #[macro_use] -extern crate substrate_codec_derive; +extern crate parity_codec_derive; -extern crate substrate_runtime_std as rstd; -extern crate substrate_runtime_primitives as runtime_primitives; +extern crate sr_std as rstd; +extern crate sr_primitives as runtime_primitives; extern crate substrate_primitives as primitives; -extern crate substrate_codec as codec; +extern crate parity_codec as codec; use rstd::prelude::*; use runtime_primitives::generic; diff --git a/node/runtime/Cargo.toml b/node/runtime/Cargo.toml new file mode 100644 index 0000000000000..a79cd9409bf29 --- /dev/null +++ b/node/runtime/Cargo.toml @@ -0,0 +1,61 @@ +[package] +name = "node-runtime" +version = "0.1.0" +authors = ["Parity Technologies "] + +[dependencies] +rustc-hex = "1.0" +hex-literal = "0.1.0" +log = { version = "0.3", optional = true } +serde = { version = "1.0", default_features = false } +serde_derive = { version = "1.0", optional = true } +safe-mix = { version = "1.0", default_features = false} +parity-codec = { path = "../../codec" } +parity-codec-derive = { path = "../../codec/derive" } +sr-std = { path = "../../core/sr-std" } +sr-io = { path = "../../core/sr-io" } +srml-support = { path = "../../srml/support" } +substrate-primitives = { path = "../../core/primitives" } +substrate-keyring = { path = "../../core/keyring" } +srml-balances = { path = "../../srml/balances" } +srml-consensus = { path = "../../srml/consensus" } +srml-contract = { path = "../../srml/contract" } +srml-council = { path = "../../srml/council" } +srml-democracy = { path = "../../srml/democracy" } +srml-executive = { path = "../../srml/executive" } +sr-primitives = { path = "../../core/sr-primitives" } +srml-session = { path = "../../srml/session" } +srml-staking = { path = "../../srml/staking" } +srml-system = { path = "../../srml/system" } +srml-timestamp = { path = "../../srml/timestamp" } +srml-treasury = { path = "../../srml/treasury" } +sr-version = { path = "../../core/sr-version" } +node-primitives = { path = "../primitives" } + +[features] +default = ["std"] +std = [ + "parity-codec/std", + "substrate-primitives/std", + "sr-std/std", + "sr-io/std", + "srml-support/std", + "srml-balances/std", + "srml-consensus/std", + "srml-contract/std", + "srml-council/std", + "srml-democracy/std", + "srml-executive/std", + "sr-primitives/std", + "srml-session/std", + "srml-staking/std", + "srml-system/std", + "srml-timestamp/std", + "srml-treasury/std", + "sr-version/std", + "node-primitives/std", + "serde_derive", + "serde/std", + "log", + "safe-mix/std" +] diff --git a/demo/runtime/src/checked_block.rs b/node/runtime/src/checked_block.rs similarity index 88% rename from demo/runtime/src/checked_block.rs rename to node/runtime/src/checked_block.rs index 281a9e4136fca..bba748dd15fd4 100644 --- a/demo/runtime/src/checked_block.rs +++ b/node/runtime/src/checked_block.rs @@ -1,18 +1,18 @@ // Copyright 2018 Parity Technologies (UK) Ltd. -// This file is part of Substrate Demo. +// This file is part of Substrate. -// Substrate Demo is free software: you can redistribute it and/or modify +// Substrate 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. -// Substrate Demo is distributed in the hope that it will be useful, +// Substrate 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 Substrate Demo. If not, see . +// along with Substrate. If not, see . //! Typesafe block interaction. @@ -54,7 +54,7 @@ impl CheckedBlock { } /// Extract the timestamp from the block. - pub fn timestamp(&self) -> ::demo_primitives::Timestamp { + pub fn timestamp(&self) -> ::node_primitives::Timestamp { let x = self.inner.extrinsics.get(TIMESTAMP_SET_POSITION as usize).and_then(|xt| match xt.function { Call::Timestamp(TimestampCall::set(x)) => Some(x), _ => None @@ -87,7 +87,7 @@ impl ::std::ops::Deref for CheckedBlock { /// Assert that a block is structurally valid. May lead to panic in the future /// in case it isn't. #[macro_export] -macro_rules! assert_demo_block { +macro_rules! assert_node_block { ($block: expr) => { $crate::CheckedBlock::new_unchecked($block, file!(), line!()) } diff --git a/demo/runtime/src/lib.rs b/node/runtime/src/lib.rs similarity index 86% rename from demo/runtime/src/lib.rs rename to node/runtime/src/lib.rs index 838fb9c3306f7..4eee9a24495cb 100644 --- a/demo/runtime/src/lib.rs +++ b/node/runtime/src/lib.rs @@ -1,31 +1,31 @@ // Copyright 2018 Parity Technologies (UK) Ltd. -// This file is part of Substrate Demo. +// This file is part of Substrate. -// Substrate Demo is free software: you can redistribute it and/or modify +// Substrate 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. -// Substrate Demo is distributed in the hope that it will be useful, +// Substrate 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 Substrate Demo. If not, see . +// along with Substrate. If not, see . -//! The Substrate Demo runtime. This can be compiled with ``#[no_std]`, ready for Wasm. +//! The Substrate runtime. This can be compiled with ``#[no_std]`, ready for Wasm. #![cfg_attr(not(feature = "std"), no_std)] #[macro_use] -extern crate substrate_runtime_io as runtime_io; +extern crate sr_io as runtime_io; #[macro_use] -extern crate substrate_runtime_support; +extern crate srml_support; #[macro_use] -extern crate substrate_runtime_primitives as runtime_primitives; +extern crate sr_primitives as runtime_primitives; #[cfg(feature = "std")] #[macro_use] @@ -34,28 +34,28 @@ extern crate serde_derive; #[cfg(feature = "std")] extern crate serde; -extern crate substrate_codec as codec; +extern crate parity_codec as codec; extern crate substrate_primitives; #[macro_use] -extern crate substrate_codec_derive; +extern crate parity_codec_derive; #[cfg_attr(not(feature = "std"), macro_use)] -extern crate substrate_runtime_std as rstd; -extern crate substrate_runtime_balances as balances; -extern crate substrate_runtime_consensus as consensus; -extern crate substrate_runtime_contract as contract; -extern crate substrate_runtime_council as council; -extern crate substrate_runtime_democracy as democracy; -extern crate substrate_runtime_executive as executive; -extern crate substrate_runtime_session as session; -extern crate substrate_runtime_staking as staking; -extern crate substrate_runtime_system as system; -extern crate substrate_runtime_timestamp as timestamp; -extern crate substrate_runtime_treasury as treasury; +extern crate sr_std as rstd; +extern crate srml_balances as balances; +extern crate srml_consensus as consensus; +extern crate srml_contract as contract; +extern crate srml_council as council; +extern crate srml_democracy as democracy; +extern crate srml_executive as executive; +extern crate srml_session as session; +extern crate srml_staking as staking; +extern crate srml_system as system; +extern crate srml_timestamp as timestamp; +extern crate srml_treasury as treasury; #[macro_use] -extern crate substrate_runtime_version as version; -extern crate demo_primitives; +extern crate sr_version as version; +extern crate node_primitives; #[cfg(feature = "std")] mod checked_block; @@ -63,7 +63,7 @@ mod checked_block; use rstd::prelude::*; use substrate_primitives::u32_trait::{_2, _4}; use codec::{Encode, Decode, Input}; -use demo_primitives::{AccountId, AccountIndex, Balance, BlockNumber, Hash, Index, SessionKey, Signature, InherentData}; +use node_primitives::{AccountId, AccountIndex, Balance, BlockNumber, Hash, Index, SessionKey, Signature, InherentData}; use runtime_primitives::generic; use runtime_primitives::traits::{Convert, BlakeTwo256, DigestItem}; use version::RuntimeVersion; @@ -88,8 +88,8 @@ pub struct Runtime; /// Runtime version. pub const VERSION: RuntimeVersion = RuntimeVersion { - spec_name: ver_str!("demo"), - impl_name: ver_str!("substrate-demo"), + spec_name: ver_str!("node"), + impl_name: ver_str!("substrate-node"), authoring_version: 1, spec_version: 1, impl_version: 0, diff --git a/demo/runtime/wasm/Cargo.lock b/node/runtime/wasm/Cargo.lock similarity index 88% rename from demo/runtime/wasm/Cargo.lock rename to node/runtime/wasm/Cargo.lock index 89017d1a91d4d..37115314320fe 100644 --- a/demo/runtime/wasm/Cargo.lock +++ b/node/runtime/wasm/Cargo.lock @@ -76,59 +76,6 @@ name = "crunchy" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "demo-primitives" -version = "0.1.0" -dependencies = [ - "serde 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-codec 0.1.0", - "substrate-codec-derive 0.1.0", - "substrate-primitives 0.1.0", - "substrate-runtime-primitives 0.1.0", - "substrate-runtime-std 0.1.0", -] - -[[package]] -name = "demo-runtime" -version = "0.1.0" -dependencies = [ - "demo-primitives 0.1.0", - "integer-sqrt 0.1.0 (git+https://github.com/paritytech/integer-sqrt-rs.git)", - "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-codec 0.1.0", - "substrate-codec-derive 0.1.0", - "substrate-primitives 0.1.0", - "substrate-runtime-balances 0.1.0", - "substrate-runtime-consensus 0.1.0", - "substrate-runtime-contract 0.1.0", - "substrate-runtime-council 0.1.0", - "substrate-runtime-democracy 0.1.0", - "substrate-runtime-executive 0.1.0", - "substrate-runtime-io 0.1.0", - "substrate-runtime-primitives 0.1.0", - "substrate-runtime-session 0.1.0", - "substrate-runtime-staking 0.1.0", - "substrate-runtime-std 0.1.0", - "substrate-runtime-support 0.1.0", - "substrate-runtime-system 0.1.0", - "substrate-runtime-timestamp 0.1.0", - "substrate-runtime-treasury 0.1.0", - "substrate-runtime-version 0.1.0", -] - -[[package]] -name = "ed25519" -version = "0.1.0" -dependencies = [ - "base58 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", - "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "ring 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-primitives 0.1.0", - "untrusted 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "elastic-array" version = "0.10.0" @@ -300,6 +247,47 @@ name = "nan-preserving-float" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "node-primitives" +version = "0.1.0" +dependencies = [ + "parity-codec 0.1.0", + "parity-codec-derive 0.1.0", + "serde 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-primitives 0.1.0", + "sr-std 0.1.0", + "substrate-primitives 0.1.0", +] + +[[package]] +name = "node-runtime" +version = "0.1.0" +dependencies = [ + "integer-sqrt 0.1.0 (git+https://github.com/paritytech/integer-sqrt-rs.git)", + "node-primitives 0.1.0", + "parity-codec 0.1.0", + "parity-codec-derive 0.1.0", + "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-io 0.1.0", + "sr-primitives 0.1.0", + "sr-std 0.1.0", + "sr-version 0.1.0", + "srml-balances 0.1.0", + "srml-consensus 0.1.0", + "srml-contract 0.1.0", + "srml-council 0.1.0", + "srml-democracy 0.1.0", + "srml-executive 0.1.0", + "srml-session 0.1.0", + "srml-staking 0.1.0", + "srml-support 0.1.0", + "srml-system 0.1.0", + "srml-timestamp 0.1.0", + "srml-treasury 0.1.0", + "substrate-primitives 0.1.0", +] + [[package]] name = "nodrop" version = "0.1.12" @@ -331,6 +319,22 @@ name = "parity-bytes" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "parity-codec" +version = "0.1.0" +dependencies = [ + "arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "parity-codec-derive" +version = "0.1.0" +dependencies = [ + "proc-macro2 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "parity-wasm" version = "0.31.0" @@ -561,347 +565,339 @@ dependencies = [ ] [[package]] -name = "stable_deref_trait" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" +name = "sr-io" +version = "0.1.0" +dependencies = [ + "environmental 0.1.0", + "hashdb 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 0.1.0", + "rlp 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc_version 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-std 0.1.0", + "substrate-primitives 0.1.0", + "substrate-state-machine 0.1.0", + "triehash 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] -name = "substrate-codec" +name = "sr-primitives" version = "0.1.0" dependencies = [ - "arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "integer-sqrt 0.1.0 (git+https://github.com/paritytech/integer-sqrt-rs.git)", + "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 0.1.0", + "parity-codec-derive 0.1.0", + "serde 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-io 0.1.0", + "sr-std 0.1.0", + "substrate-primitives 0.1.0", ] [[package]] -name = "substrate-codec-derive" +name = "sr-sandbox" version = "0.1.0" dependencies = [ - "proc-macro2 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 0.1.0", + "rustc_version 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-io 0.1.0", + "sr-std 0.1.0", + "substrate-primitives 0.1.0", + "wasmi 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "substrate-keyring" +name = "sr-std" version = "0.1.0" dependencies = [ - "ed25519 0.1.0", - "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "pwasm-alloc 0.1.0", + "pwasm-libc 0.1.0", + "rustc_version 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "substrate-primitives" +name = "sr-version" version = "0.1.0" dependencies = [ - "blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", - "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "elastic-array 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", - "fixed-hash 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "hashdb 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "patricia-trie 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "plain_hasher 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-hex 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 0.1.0", + "parity-codec-derive 0.1.0", "serde 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-codec 0.1.0", - "substrate-codec-derive 0.1.0", - "substrate-runtime-std 0.1.0", - "twox-hash 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "uint 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "wasmi 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-std 0.1.0", ] [[package]] -name = "substrate-runtime-balances" +name = "srml-balances" version = "0.1.0" dependencies = [ "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 0.1.0", + "parity-codec-derive 0.1.0", "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-codec 0.1.0", - "substrate-codec-derive 0.1.0", + "sr-io 0.1.0", + "sr-primitives 0.1.0", + "sr-std 0.1.0", + "srml-support 0.1.0", + "srml-system 0.1.0", "substrate-keyring 0.1.0", "substrate-primitives 0.1.0", - "substrate-runtime-io 0.1.0", - "substrate-runtime-primitives 0.1.0", - "substrate-runtime-std 0.1.0", - "substrate-runtime-support 0.1.0", - "substrate-runtime-system 0.1.0", ] [[package]] -name = "substrate-runtime-consensus" +name = "srml-consensus" version = "0.1.0" dependencies = [ "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 0.1.0", + "parity-codec-derive 0.1.0", "serde 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-codec 0.1.0", - "substrate-codec-derive 0.1.0", + "sr-io 0.1.0", + "sr-primitives 0.1.0", + "sr-std 0.1.0", + "srml-support 0.1.0", + "srml-system 0.1.0", "substrate-primitives 0.1.0", - "substrate-runtime-io 0.1.0", - "substrate-runtime-primitives 0.1.0", - "substrate-runtime-std 0.1.0", - "substrate-runtime-support 0.1.0", - "substrate-runtime-system 0.1.0", ] [[package]] -name = "substrate-runtime-contract" +name = "srml-contract" version = "0.1.0" dependencies = [ + "parity-codec 0.1.0", "parity-wasm 0.31.0 (registry+https://github.com/rust-lang/crates.io-index)", "pwasm-utils 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-codec 0.1.0", + "sr-io 0.1.0", + "sr-primitives 0.1.0", + "sr-sandbox 0.1.0", + "sr-std 0.1.0", + "srml-balances 0.1.0", + "srml-support 0.1.0", + "srml-system 0.1.0", "substrate-primitives 0.1.0", - "substrate-runtime-balances 0.1.0", - "substrate-runtime-io 0.1.0", - "substrate-runtime-primitives 0.1.0", - "substrate-runtime-sandbox 0.1.0", - "substrate-runtime-std 0.1.0", - "substrate-runtime-support 0.1.0", - "substrate-runtime-system 0.1.0", ] [[package]] -name = "substrate-runtime-council" +name = "srml-council" version = "0.1.0" dependencies = [ "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "integer-sqrt 0.1.0 (git+https://github.com/paritytech/integer-sqrt-rs.git)", + "parity-codec 0.1.0", + "parity-codec-derive 0.1.0", "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-codec 0.1.0", - "substrate-codec-derive 0.1.0", + "sr-io 0.1.0", + "sr-primitives 0.1.0", + "sr-std 0.1.0", + "srml-balances 0.1.0", + "srml-consensus 0.1.0", + "srml-democracy 0.1.0", + "srml-support 0.1.0", + "srml-system 0.1.0", "substrate-keyring 0.1.0", "substrate-primitives 0.1.0", - "substrate-runtime-balances 0.1.0", - "substrate-runtime-consensus 0.1.0", - "substrate-runtime-democracy 0.1.0", - "substrate-runtime-io 0.1.0", - "substrate-runtime-primitives 0.1.0", - "substrate-runtime-std 0.1.0", - "substrate-runtime-support 0.1.0", - "substrate-runtime-system 0.1.0", ] [[package]] -name = "substrate-runtime-democracy" +name = "srml-democracy" version = "0.1.0" dependencies = [ "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 0.1.0", + "parity-codec-derive 0.1.0", "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-codec 0.1.0", - "substrate-codec-derive 0.1.0", + "sr-io 0.1.0", + "sr-primitives 0.1.0", + "sr-std 0.1.0", + "srml-balances 0.1.0", + "srml-consensus 0.1.0", + "srml-support 0.1.0", + "srml-system 0.1.0", "substrate-primitives 0.1.0", - "substrate-runtime-balances 0.1.0", - "substrate-runtime-consensus 0.1.0", - "substrate-runtime-io 0.1.0", - "substrate-runtime-primitives 0.1.0", - "substrate-runtime-std 0.1.0", - "substrate-runtime-support 0.1.0", - "substrate-runtime-system 0.1.0", ] [[package]] -name = "substrate-runtime-executive" +name = "srml-executive" version = "0.1.0" dependencies = [ "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 0.1.0", "serde 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-codec 0.1.0", - "substrate-runtime-io 0.1.0", - "substrate-runtime-primitives 0.1.0", - "substrate-runtime-std 0.1.0", - "substrate-runtime-support 0.1.0", - "substrate-runtime-system 0.1.0", -] - -[[package]] -name = "substrate-runtime-io" -version = "0.1.0" -dependencies = [ - "ed25519 0.1.0", - "environmental 0.1.0", - "hashdb 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc_version 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-codec 0.1.0", - "substrate-primitives 0.1.0", - "substrate-runtime-std 0.1.0", - "substrate-state-machine 0.1.0", - "triehash 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-io 0.1.0", + "sr-primitives 0.1.0", + "sr-std 0.1.0", + "srml-support 0.1.0", + "srml-system 0.1.0", ] [[package]] -name = "substrate-runtime-primitives" +name = "srml-session" version = "0.1.0" dependencies = [ - "integer-sqrt 0.1.0 (git+https://github.com/paritytech/integer-sqrt-rs.git)", - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 0.1.0", + "parity-codec-derive 0.1.0", + "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-codec 0.1.0", - "substrate-codec-derive 0.1.0", - "substrate-primitives 0.1.0", - "substrate-runtime-io 0.1.0", - "substrate-runtime-std 0.1.0", - "substrate-runtime-support 0.1.0", -] - -[[package]] -name = "substrate-runtime-sandbox" -version = "0.1.0" -dependencies = [ - "rustc_version 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-codec 0.1.0", + "sr-io 0.1.0", + "sr-primitives 0.1.0", + "sr-std 0.1.0", + "srml-consensus 0.1.0", + "srml-support 0.1.0", + "srml-system 0.1.0", + "srml-timestamp 0.1.0", + "substrate-keyring 0.1.0", "substrate-primitives 0.1.0", - "substrate-runtime-io 0.1.0", - "substrate-runtime-std 0.1.0", - "wasmi 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "substrate-runtime-session" +name = "srml-staking" version = "0.1.0" dependencies = [ "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 0.1.0", + "parity-codec-derive 0.1.0", "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-codec 0.1.0", - "substrate-codec-derive 0.1.0", + "sr-io 0.1.0", + "sr-primitives 0.1.0", + "sr-sandbox 0.1.0", + "sr-std 0.1.0", + "srml-balances 0.1.0", + "srml-consensus 0.1.0", + "srml-session 0.1.0", + "srml-support 0.1.0", + "srml-system 0.1.0", + "srml-timestamp 0.1.0", "substrate-keyring 0.1.0", "substrate-primitives 0.1.0", - "substrate-runtime-consensus 0.1.0", - "substrate-runtime-io 0.1.0", - "substrate-runtime-primitives 0.1.0", - "substrate-runtime-std 0.1.0", - "substrate-runtime-support 0.1.0", - "substrate-runtime-system 0.1.0", - "substrate-runtime-timestamp 0.1.0", ] [[package]] -name = "substrate-runtime-staking" +name = "srml-support" version = "0.1.0" dependencies = [ "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 0.1.0", "serde 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-codec 0.1.0", - "substrate-codec-derive 0.1.0", - "substrate-keyring 0.1.0", + "sr-io 0.1.0", + "sr-std 0.1.0", + "substrate-metadata 0.1.0", "substrate-primitives 0.1.0", - "substrate-runtime-balances 0.1.0", - "substrate-runtime-consensus 0.1.0", - "substrate-runtime-io 0.1.0", - "substrate-runtime-primitives 0.1.0", - "substrate-runtime-sandbox 0.1.0", - "substrate-runtime-session 0.1.0", - "substrate-runtime-std 0.1.0", - "substrate-runtime-support 0.1.0", - "substrate-runtime-system 0.1.0", - "substrate-runtime-timestamp 0.1.0", ] [[package]] -name = "substrate-runtime-std" +name = "srml-system" version = "0.1.0" dependencies = [ - "pwasm-alloc 0.1.0", - "pwasm-libc 0.1.0", - "rustc_version 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 0.1.0", + "parity-codec-derive 0.1.0", + "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)", + "sr-io 0.1.0", + "sr-primitives 0.1.0", + "sr-std 0.1.0", + "srml-support 0.1.0", + "substrate-primitives 0.1.0", ] [[package]] -name = "substrate-runtime-support" +name = "srml-timestamp" version = "0.1.0" dependencies = [ - "ed25519 0.1.0", "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 0.1.0", "serde 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-codec 0.1.0", + "sr-io 0.1.0", + "sr-primitives 0.1.0", + "sr-std 0.1.0", + "srml-consensus 0.1.0", + "srml-support 0.1.0", + "srml-system 0.1.0", "substrate-primitives 0.1.0", - "substrate-runtime-io 0.1.0", - "substrate-runtime-std 0.1.0", ] [[package]] -name = "substrate-runtime-system" +name = "srml-treasury" version = "0.1.0" dependencies = [ "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 0.1.0", + "parity-codec-derive 0.1.0", "serde 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-codec 0.1.0", - "substrate-codec-derive 0.1.0", + "sr-io 0.1.0", + "sr-primitives 0.1.0", + "sr-std 0.1.0", + "srml-balances 0.1.0", + "srml-support 0.1.0", + "srml-system 0.1.0", "substrate-primitives 0.1.0", - "substrate-runtime-io 0.1.0", - "substrate-runtime-primitives 0.1.0", - "substrate-runtime-std 0.1.0", - "substrate-runtime-support 0.1.0", ] [[package]] -name = "substrate-runtime-timestamp" +name = "stable_deref_trait" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "substrate-keyring" version = "0.1.0" dependencies = [ "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-codec 0.1.0", + "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "substrate-primitives 0.1.0", - "substrate-runtime-consensus 0.1.0", - "substrate-runtime-io 0.1.0", - "substrate-runtime-primitives 0.1.0", - "substrate-runtime-std 0.1.0", - "substrate-runtime-support 0.1.0", - "substrate-runtime-system 0.1.0", ] [[package]] -name = "substrate-runtime-treasury" +name = "substrate-metadata" version = "0.1.0" dependencies = [ - "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-codec 0.1.0", - "substrate-codec-derive 0.1.0", - "substrate-primitives 0.1.0", - "substrate-runtime-balances 0.1.0", - "substrate-runtime-io 0.1.0", - "substrate-runtime-primitives 0.1.0", - "substrate-runtime-std 0.1.0", - "substrate-runtime-support 0.1.0", - "substrate-runtime-system 0.1.0", + "parity-codec 0.1.0", ] [[package]] -name = "substrate-runtime-version" +name = "substrate-primitives" version = "0.1.0" dependencies = [ + "base58 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "elastic-array 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", + "fixed-hash 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "hashdb 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 0.1.0", + "parity-codec-derive 0.1.0", + "patricia-trie 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "plain_hasher 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ring 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rlp 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-hex 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-codec 0.1.0", - "substrate-codec-derive 0.1.0", - "substrate-runtime-std 0.1.0", - "substrate-runtime-support 0.1.0", + "sr-std 0.1.0", + "twox-hash 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "uint 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "untrusted 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "wasmi 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -914,10 +910,10 @@ dependencies = [ "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "memorydb 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec 0.1.0", "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "patricia-trie 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-codec 0.1.0", "substrate-primitives 0.1.0", "triehash 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", ] diff --git a/node/runtime/wasm/Cargo.toml b/node/runtime/wasm/Cargo.toml new file mode 100644 index 0000000000000..ec718c477ef76 --- /dev/null +++ b/node/runtime/wasm/Cargo.toml @@ -0,0 +1,63 @@ +[package] +name = "node-runtime" +version = "0.1.0" +authors = ["Parity Technologies "] + +[lib] +crate-type = ["cdylib"] + +[dependencies] +integer-sqrt = { git = "https://github.com/paritytech/integer-sqrt-rs.git", branch = "master" } +safe-mix = { version = "1.0", default_features = false} +parity-codec-derive = { path = "../../../codec/derive" } +parity-codec = { path = "../../../codec", default-features = false } +substrate-primitives = { path = "../../../core/primitives", default-features = false } +sr-std = { path = "../../../core/sr-std", default-features = false } +sr-io = { path = "../../../core/sr-io", default-features = false } +srml-support = { path = "../../../srml/support", default-features = false } +srml-balances = { path = "../../../srml/balances", default-features = false } +srml-consensus = { path = "../../../srml/consensus", default-features = false } +srml-contract = { path = "../../../srml/contract", default-features = false } +srml-council = { path = "../../../srml/council", default-features = false } +srml-democracy = { path = "../../../srml/democracy", default-features = false } +srml-executive = { path = "../../../srml/executive", default-features = false } +sr-primitives = { path = "../../../core/sr-primitives", default-features = false } +srml-session = { path = "../../../srml/session", default-features = false } +srml-staking = { path = "../../../srml/staking", default-features = false } +srml-system = { path = "../../../srml/system", default-features = false } +srml-timestamp = { path = "../../../srml/timestamp", default-features = false } +srml-treasury = { path = "../../../srml/treasury", default-features = false } +sr-version = { path = "../../../core/sr-version", default-features = false } +node-primitives = { path = "../../primitives", default-features = false } + +[features] +default = [] +std = [ + "safe-mix/std", + "parity-codec/std", + "substrate-primitives/std", + "sr-std/std", + "sr-io/std", + "srml-support/std", + "srml-balances/std", + "srml-consensus/std", + "srml-contract/std", + "srml-council/std", + "srml-democracy/std", + "srml-executive/std", + "sr-primitives/std", + "srml-session/std", + "srml-staking/std", + "srml-system/std", + "srml-timestamp/std", + "srml-treasury/std", + "sr-version/std", + "node-primitives/std", +] + +[profile.release] +panic = "abort" +lto = true + +[workspace] +members = [] diff --git a/demo/runtime/wasm/build.sh b/node/runtime/wasm/build.sh similarity index 90% rename from demo/runtime/wasm/build.sh rename to node/runtime/wasm/build.sh index 0769faeba9b3e..9fe3f0ca10d68 100755 --- a/demo/runtime/wasm/build.sh +++ b/node/runtime/wasm/build.sh @@ -2,7 +2,7 @@ set -e cargo +nightly build --target=wasm32-unknown-unknown --release -for i in demo_runtime +for i in node_runtime do wasm-gc target/wasm32-unknown-unknown/release/$i.wasm target/wasm32-unknown-unknown/release/$i.compact.wasm done diff --git a/substrate/test-runtime/wasm/src b/node/runtime/wasm/src similarity index 100% rename from substrate/test-runtime/wasm/src rename to node/runtime/wasm/src diff --git a/node/service/Cargo.toml b/node/service/Cargo.toml new file mode 100644 index 0000000000000..045b8c8286d1b --- /dev/null +++ b/node/service/Cargo.toml @@ -0,0 +1,26 @@ +[package] +name = "node-service" +version = "0.1.0" +authors = ["Parity Technologies "] + +[dependencies] +parking_lot = "0.4" +error-chain = "0.12" +lazy_static = "1.0" +log = "0.3" +slog = "^2" +tokio = "0.1.7" +hex-literal = "0.1" +node-api = { path = "../api" } +node-primitives = { path = "../primitives" } +node-runtime = { path = "../runtime" } +node-executor = { path = "../executor" } +node-consensus = { path = "../consensus" } +node-network = { path = "../network" } +node-transaction-pool = { path = "../transaction-pool" } +sr-io = { path = "../../core/sr-io" } +substrate-primitives = { path = "../../core/primitives" } +substrate-network = { path = "../../core/network" } +substrate-client = { path = "../../core/client" } +substrate-service = { path = "../../core/service" } +substrate-telemetry = { path = "../../core/telemetry" } diff --git a/demo/service/src/chain_spec.rs b/node/service/src/chain_spec.rs similarity index 92% rename from demo/service/src/chain_spec.rs rename to node/service/src/chain_spec.rs index 84d0084da8850..bf502cdbd1284 100644 --- a/demo/service/src/chain_spec.rs +++ b/node/service/src/chain_spec.rs @@ -1,24 +1,23 @@ // Copyright 2018 Parity Technologies (UK) Ltd. -// This file is part of Substrate Demo. +// This file is part of Substrate. -// Substrate Demo is free software: you can redistribute it and/or modify +// Substrate 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. -// Substrate Demo is distributed in the hope that it will be useful, +// Substrate 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 Substrate Demo. If not, see . +// along with Substrate. If not, see . -//! Substrate Demo chain configurations. +//! Substrate chain configurations. -use ed25519; -use primitives::AuthorityId; -use demo_runtime::{GenesisConfig, ConsensusConfig, CouncilConfig, DemocracyConfig, +use primitives::{AuthorityId, ed25519}; +use node_runtime::{GenesisConfig, ConsensusConfig, CouncilConfig, DemocracyConfig, SessionConfig, StakingConfig, TimestampConfig, BalancesConfig, TreasuryConfig, ContractConfig, Permill}; use service::ChainSpec; @@ -26,7 +25,7 @@ use service::ChainSpec; const STAGING_TELEMETRY_URL: &str = "wss://telemetry.polkadot.io/submit/"; pub fn testnet_config() -> Result, String> { - //ChainSpec::from_embedded(include_bytes!("../res/demo.json")) + //ChainSpec::from_embedded(include_bytes!("../res/node.json")) Ok(staging_testnet_config()) } @@ -42,7 +41,7 @@ fn staging_testnet_config_genesis() -> GenesisConfig { ]; GenesisConfig { consensus: Some(ConsensusConfig { - code: include_bytes!("../../runtime/wasm/target/wasm32-unknown-unknown/release/demo_runtime.compact.wasm").to_vec(), // TODO change + code: include_bytes!("../../runtime/wasm/target/wasm32-unknown-unknown/release/node_runtime.compact.wasm").to_vec(), // TODO change authorities: initial_authorities.clone(), }), system: None, @@ -133,7 +132,7 @@ fn testnet_genesis(initial_authorities: Vec) -> GenesisConfig { ]; GenesisConfig { consensus: Some(ConsensusConfig { - code: include_bytes!("../../runtime/wasm/target/wasm32-unknown-unknown/release/demo_runtime.compact.wasm").to_vec(), + code: include_bytes!("../../runtime/wasm/target/wasm32-unknown-unknown/release/node_runtime.compact.wasm").to_vec(), authorities: initial_authorities.clone(), }), system: None, diff --git a/demo/service/src/lib.rs b/node/service/src/lib.rs similarity index 87% rename from demo/service/src/lib.rs rename to node/service/src/lib.rs index 3f761b7542bc4..469349d1c4ab2 100644 --- a/demo/service/src/lib.rs +++ b/node/service/src/lib.rs @@ -1,31 +1,30 @@ // Copyright 2018 Parity Technologies (UK) Ltd. -// This file is part of Substrate Demo. +// This file is part of Substrate. -// Substrate Demo is free software: you can redistribute it and/or modify +// Substrate 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. -// Substrate Demo is distributed in the hope that it will be useful, +// Substrate 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 Substrate Demo. If not, see . +// along with Substrate. If not, see . #![warn(unused_extern_crates)] -//! Substrate Demo service. Specialized wrapper over substrate service. +//! Substrate service. Specialized wrapper over substrate service. -extern crate ed25519; -extern crate demo_api; -extern crate demo_primitives; -extern crate demo_runtime; -extern crate demo_executor; -extern crate demo_network; -extern crate demo_transaction_pool as transaction_pool; -extern crate demo_consensus as consensus; +extern crate node_api; +extern crate node_primitives; +extern crate node_runtime; +extern crate node_executor; +extern crate node_network; +extern crate node_transaction_pool as transaction_pool; +extern crate node_consensus as consensus; extern crate substrate_primitives as primitives; extern crate substrate_network as network; extern crate substrate_client as client; @@ -42,11 +41,11 @@ pub mod chain_spec; use std::sync::Arc; use transaction_pool::TransactionPool; -use demo_api::Api; -use demo_primitives::{Block, Hash}; -use demo_runtime::GenesisConfig; +use node_api::Api; +use node_primitives::{Block, Hash}; +use node_runtime::GenesisConfig; use client::Client; -use demo_network::{Protocol as DemoProtocol, consensus::ConsensusNetwork}; +use node_network::{Protocol as DemoProtocol, consensus::ConsensusNetwork}; use tokio::runtime::TaskExecutor; use service::FactoryFullConfiguration; use primitives::{Blake2Hasher, RlpCodec}; @@ -97,13 +96,13 @@ impl service::ServiceFactory for Factory { type Block = Block; type ExtrinsicHash = Hash; type NetworkProtocol = DemoProtocol; - type RuntimeDispatch = demo_executor::Executor; + type RuntimeDispatch = node_executor::Executor; type FullExtrinsicPoolApi = transaction_pool::ChainApi>; type LightExtrinsicPoolApi = transaction_pool::ChainApi>; type Genesis = GenesisConfig; type Configuration = CustomConfiguration; - const NETWORK_PROTOCOL_ID: network::ProtocolId = ::demo_network::PROTOCOL_ID; + const NETWORK_PROTOCOL_ID: network::ProtocolId = ::node_network::PROTOCOL_ID; fn build_full_extrinsic_pool(config: ExtrinsicPoolOptions, client: Arc>) -> Result>, Error> diff --git a/demo/src/main.rs b/node/src/main.rs similarity index 84% rename from demo/src/main.rs rename to node/src/main.rs index 7b219728c38c7..dca5e5ed90967 100644 --- a/demo/src/main.rs +++ b/node/src/main.rs @@ -1,24 +1,24 @@ // Copyright 2018 Parity Technologies (UK) Ltd. -// This file is part of Substrate Demo. +// This file is part of Substrate. -// Substrate Demo is free software: you can redistribute it and/or modify +// Substrate 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. -// Substrate Demo is distributed in the hope that it will be useful, +// Substrate 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 Substrate Demo. If not, see . +// along with Substrate. If not, see . -//! Substrate Demo CLI +//! Substrate CLI #![warn(missing_docs)] -extern crate demo_cli as cli; +extern crate node_cli as cli; extern crate ctrlc; extern crate futures; diff --git a/node/transaction-pool/Cargo.toml b/node/transaction-pool/Cargo.toml new file mode 100644 index 0000000000000..45455bcfd6230 --- /dev/null +++ b/node/transaction-pool/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "node-transaction-pool" +version = "0.1.0" +authors = ["Parity Technologies "] + +[dependencies] +log = "0.3.0" +error-chain = "0.12" +parking_lot = "0.4" +node-api = { path = "../api" } +node-primitives = { path = "../primitives" } +node-runtime = { path = "../runtime" } +substrate-client = { path = "../../core/client" } +parity-codec = { path = "../../codec" } +substrate-keyring = { path = "../../core/keyring" } +substrate-extrinsic-pool = { path = "../../core/extrinsic-pool" } +substrate-primitives = { path = "../../core/primitives" } +sr-primitives = { path = "../../core/sr-primitives" } diff --git a/demo/transaction-pool/src/error.rs b/node/transaction-pool/src/error.rs similarity index 87% rename from demo/transaction-pool/src/error.rs rename to node/transaction-pool/src/error.rs index 2303372084e13..7d1712a55ac2c 100644 --- a/demo/transaction-pool/src/error.rs +++ b/node/transaction-pool/src/error.rs @@ -1,28 +1,28 @@ // Copyright 2018 Parity Technologies (UK) Ltd. -// This file is part of Substrate Demo. +// This file is part of Substrate. -// Substrate Demo is free software: you can redistribute it and/or modify +// Substrate 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. -// Substrate Demo is distributed in the hope that it will be useful, +// Substrate 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 Substrate Demo. If not, see . +// along with Substrate. If not, see . use extrinsic_pool; -use demo_api; +use node_api; use primitives::Hash; use runtime::{Address, UncheckedExtrinsic}; error_chain! { links { Pool(extrinsic_pool::Error, extrinsic_pool::ErrorKind); - Api(demo_api::Error, demo_api::ErrorKind); + Api(node_api::Error, node_api::ErrorKind); } errors { /// Unexpected extrinsic format submitted diff --git a/demo/transaction-pool/src/lib.rs b/node/transaction-pool/src/lib.rs similarity index 91% rename from demo/transaction-pool/src/lib.rs rename to node/transaction-pool/src/lib.rs index 637356a098fb5..b6dfcd3f25013 100644 --- a/demo/transaction-pool/src/lib.rs +++ b/node/transaction-pool/src/lib.rs @@ -1,28 +1,27 @@ // Copyright 2018 Parity Technologies (UK) Ltd. -// This file is part of Substrate Demo. +// This file is part of Substrate. -// Substrate Demo is free software: you can redistribute it and/or modify +// Substrate 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. -// Substrate Demo is distributed in the hope that it will be useful, +// Substrate 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 Substrate Demo. If not, see . +// along with Substrate. If not, see . -extern crate ed25519; extern crate substrate_client as client; -extern crate substrate_codec as codec; +extern crate parity_codec as codec; extern crate substrate_extrinsic_pool as extrinsic_pool; extern crate substrate_primitives; -extern crate substrate_runtime_primitives; -extern crate demo_runtime as runtime; -extern crate demo_primitives as primitives; -extern crate demo_api; +extern crate sr_primitives; +extern crate node_runtime as runtime; +extern crate node_primitives as primitives; +extern crate node_api; extern crate parking_lot; #[cfg(test)] @@ -44,10 +43,10 @@ use std::{ use codec::{Decode, Encode}; use extrinsic_pool::{Readiness, scoring::{Change, Choice}, VerifiedFor, ExtrinsicFor}; -use demo_api::Api; +use node_api::Api; use primitives::{AccountId, BlockId, Block, Hash, Index}; use runtime::{Address, UncheckedExtrinsic, RawAddress}; -use substrate_runtime_primitives::traits::{Bounded, Checkable, Hash as HashT, BlakeTwo256}; +use sr_primitives::traits::{Bounded, Checkable, Hash as HashT, BlakeTwo256}; pub use extrinsic_pool::{Options, Status, LightStatus, VerifiedTransaction as VerifiedTransactionOps}; pub use error::{Error, ErrorKind, Result}; diff --git a/substrate/pwasm-alloc/Cargo.toml b/pwasm-alloc/Cargo.toml similarity index 100% rename from substrate/pwasm-alloc/Cargo.toml rename to pwasm-alloc/Cargo.toml diff --git a/substrate/pwasm-alloc/README.adoc b/pwasm-alloc/README.adoc similarity index 100% rename from substrate/pwasm-alloc/README.adoc rename to pwasm-alloc/README.adoc diff --git a/substrate/runtime-sandbox/build.rs b/pwasm-alloc/build.rs old mode 100755 new mode 100644 similarity index 100% rename from substrate/runtime-sandbox/build.rs rename to pwasm-alloc/build.rs diff --git a/substrate/pwasm-alloc/src/lib.rs b/pwasm-alloc/src/lib.rs similarity index 100% rename from substrate/pwasm-alloc/src/lib.rs rename to pwasm-alloc/src/lib.rs diff --git a/substrate/pwasm-libc/Cargo.toml b/pwasm-libc/Cargo.toml similarity index 100% rename from substrate/pwasm-libc/Cargo.toml rename to pwasm-libc/Cargo.toml diff --git a/substrate/pwasm-libc/README.adoc b/pwasm-libc/README.adoc similarity index 100% rename from substrate/pwasm-libc/README.adoc rename to pwasm-libc/README.adoc diff --git a/substrate/pwasm-libc/src/lib.rs b/pwasm-libc/src/lib.rs similarity index 100% rename from substrate/pwasm-libc/src/lib.rs rename to pwasm-libc/src/lib.rs diff --git a/scripts/build-demos.sh b/scripts/build-demos.sh deleted file mode 100755 index 285da143c17d8..0000000000000 --- a/scripts/build-demos.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env bash - -# This script assumes that all pre-requisites are installed. - -set -e - -PROJECT_ROOT=`git rev-parse --show-toplevel` -source `dirname "$0"`/common.sh - -export CARGO_INCREMENTAL=0 - -# Save current directory. -pushd . - -cd $ROOT - -for DEMO in "${DEMOS[@]}" -do - echo "*** Building wasm binaries in $DEMO" - cd "$PROJECT_ROOT/$DEMO" - - ./build.sh - - cd - >> /dev/null -done - -# Restore initial directory. -popd diff --git a/scripts/common.sh b/scripts/common.sh index a75be8e406e80..c7629f2d9e918 100644 --- a/scripts/common.sh +++ b/scripts/common.sh @@ -4,12 +4,9 @@ ROOT=`dirname "$0"` # A list of directories which contain wasm projects. SRCS=( - "substrate/executor/wasm" -) - -DEMOS=( - "demo/runtime/wasm" - "substrate/test-runtime/wasm" + "core/executor/wasm" + "node/runtime/wasm" + "core/test-runtime/wasm" ) # Make pushd/popd silent. diff --git a/substrate/runtime/README.adoc b/srml/README.adoc similarity index 100% rename from substrate/runtime/README.adoc rename to srml/README.adoc diff --git a/srml/balances/Cargo.toml b/srml/balances/Cargo.toml new file mode 100644 index 0000000000000..28059c34093f6 --- /dev/null +++ b/srml/balances/Cargo.toml @@ -0,0 +1,36 @@ +[package] +name = "srml-balances" +version = "0.1.0" +authors = ["Parity Technologies "] + +[dependencies] +hex-literal = "0.1.0" +serde = { version = "1.0", default_features = false } +serde_derive = { version = "1.0", optional = true } +safe-mix = { version = "1.0", default_features = false} +parity-codec = { path = "../../codec", default_features = false } +parity-codec-derive = { path = "../../codec/derive", default_features = false } +substrate-keyring = { path = "../../core/keyring", optional = true } +substrate-primitives = { path = "../../core/primitives", default_features = false } +sr-std = { path = "../../core/sr-std", default_features = false } +sr-io = { path = "../../core/sr-io", default_features = false } +sr-primitives = { path = "../../core/sr-primitives", default_features = false } +srml-support = { path = "../support", default_features = false } +srml-system = { path = "../system", default_features = false } + +[features] +default = ["std"] +std = [ + "serde/std", + "serde_derive", + "safe-mix/std", + "substrate-keyring", + "parity-codec/std", + "parity-codec-derive/std", + "substrate-primitives/std", + "sr-std/std", + "sr-io/std", + "srml-support/std", + "sr-primitives/std", + "srml-system/std", +] diff --git a/substrate/runtime/balances/src/address.rs b/srml/balances/src/address.rs similarity index 100% rename from substrate/runtime/balances/src/address.rs rename to srml/balances/src/address.rs diff --git a/substrate/runtime/balances/src/genesis_config.rs b/srml/balances/src/genesis_config.rs similarity index 100% rename from substrate/runtime/balances/src/genesis_config.rs rename to srml/balances/src/genesis_config.rs diff --git a/substrate/runtime/balances/src/lib.rs b/srml/balances/src/lib.rs similarity index 98% rename from substrate/runtime/balances/src/lib.rs rename to srml/balances/src/lib.rs index 3451b55f6aa47..c14cd6235787d 100644 --- a/substrate/runtime/balances/src/lib.rs +++ b/srml/balances/src/lib.rs @@ -26,19 +26,19 @@ extern crate serde; extern crate serde_derive; #[macro_use] -extern crate substrate_runtime_support as runtime_support; +extern crate srml_support as runtime_support; #[cfg_attr(feature = "std", macro_use)] -extern crate substrate_runtime_std as rstd; +extern crate sr_std as rstd; #[macro_use] -extern crate substrate_codec_derive; +extern crate parity_codec_derive; -extern crate substrate_codec as codec; +extern crate parity_codec as codec; extern crate substrate_primitives; -extern crate substrate_runtime_io as runtime_io; -extern crate substrate_runtime_primitives as primitives; -extern crate substrate_runtime_system as system; +extern crate sr_io as runtime_io; +extern crate sr_primitives as primitives; +extern crate srml_system as system; use rstd::prelude::*; use rstd::{cmp, result}; diff --git a/substrate/runtime/balances/src/mock.rs b/srml/balances/src/mock.rs similarity index 100% rename from substrate/runtime/balances/src/mock.rs rename to srml/balances/src/mock.rs diff --git a/substrate/runtime/balances/src/tests.rs b/srml/balances/src/tests.rs similarity index 100% rename from substrate/runtime/balances/src/tests.rs rename to srml/balances/src/tests.rs diff --git a/srml/consensus/Cargo.toml b/srml/consensus/Cargo.toml new file mode 100644 index 0000000000000..e6945f15bdd83 --- /dev/null +++ b/srml/consensus/Cargo.toml @@ -0,0 +1,32 @@ +[package] +name = "srml-consensus" +version = "0.1.0" +authors = ["Parity Technologies "] + +[dependencies] +hex-literal = "0.1.0" +serde = { version = "1.0", default_features = false } +serde_derive = { version = "1.0", optional = true } +parity-codec = { path = "../../codec", default_features = false } +parity-codec-derive = { path = "../../codec/derive", default_features = false } +substrate-primitives = { path = "../../core/primitives", default_features = false } +sr-std = { path = "../../core/sr-std", default_features = false } +sr-io = { path = "../../core/sr-io", default_features = false } +sr-primitives = { path = "../../core/sr-primitives", default_features = false } +srml-support = { path = "../support", default_features = false } +srml-system = { path = "../system", default_features = false } + +[features] +default = ["std"] +std = [ + "serde/std", + "serde_derive", + "parity-codec/std", + "parity-codec-derive/std", + "substrate-primitives/std", + "sr-std/std", + "sr-io/std", + "srml-support/std", + "sr-primitives/std", + "srml-system/std", +] diff --git a/substrate/runtime/consensus/src/lib.rs b/srml/consensus/src/lib.rs similarity index 95% rename from substrate/runtime/consensus/src/lib.rs rename to srml/consensus/src/lib.rs index 07ff10d0714b6..40da2f25af0fb 100644 --- a/substrate/runtime/consensus/src/lib.rs +++ b/srml/consensus/src/lib.rs @@ -20,10 +20,10 @@ #[allow(unused_imports)] #[macro_use] -extern crate substrate_runtime_std as rstd; +extern crate sr_std as rstd; #[macro_use] -extern crate substrate_runtime_support as runtime_support; +extern crate srml_support as runtime_support; #[cfg(feature = "std")] extern crate serde; @@ -33,12 +33,12 @@ extern crate serde; extern crate serde_derive; #[macro_use] -extern crate substrate_codec_derive; +extern crate parity_codec_derive; -extern crate substrate_runtime_io as runtime_io; -extern crate substrate_runtime_primitives as primitives; -extern crate substrate_codec as codec; -extern crate substrate_runtime_system as system; +extern crate sr_io as runtime_io; +extern crate sr_primitives as primitives; +extern crate parity_codec as codec; +extern crate srml_system as system; extern crate substrate_primitives; use rstd::prelude::*; diff --git a/srml/contract/Cargo.toml b/srml/contract/Cargo.toml new file mode 100644 index 0000000000000..2e83124092797 --- /dev/null +++ b/srml/contract/Cargo.toml @@ -0,0 +1,41 @@ +[package] +name = "srml-contract" +version = "0.1.0" +authors = ["Parity Technologies "] + +[dependencies] +serde = { version = "1.0", default_features = false } +serde_derive = { version = "1.0", optional = true } +pwasm-utils = { version = "0.3", default_features = false } +parity-codec = { path = "../../codec", default_features = false } +parity-wasm = { version = "0.31", default_features = false } +substrate-primitives = { path = "../../core/primitives", default_features = false } +sr-primitives = { path = "../../core/sr-primitives", default_features = false } +sr-io = { path = "../../core/sr-io", default_features = false } +sr-std = { path = "../../core/sr-std", default_features = false } +sr-sandbox = { path = "../../core/sr-sandbox", default_features = false } +srml-support = { path = "../support", default_features = false } +srml-system = { path = "../system", default_features = false } +srml-balances = { path = "../balances", default_features = false } + +[dev-dependencies] +wabt = "0.4" +assert_matches = "1.1" + +[features] +default = ["std"] +std = [ + "serde_derive", + "serde/std", + "parity-codec/std", + "substrate-primitives/std", + "sr-primitives/std", + "sr-io/std", + "sr-std/std", + "srml-balances/std", + "sr-sandbox/std", + "srml-support/std", + "srml-system/std", + "parity-wasm/std", + "pwasm-utils/std", +] diff --git a/substrate/runtime/contract/src/account_db.rs b/srml/contract/src/account_db.rs similarity index 100% rename from substrate/runtime/contract/src/account_db.rs rename to srml/contract/src/account_db.rs diff --git a/substrate/runtime/contract/src/double_map.rs b/srml/contract/src/double_map.rs similarity index 100% rename from substrate/runtime/contract/src/double_map.rs rename to srml/contract/src/double_map.rs diff --git a/substrate/runtime/contract/src/exec.rs b/srml/contract/src/exec.rs similarity index 100% rename from substrate/runtime/contract/src/exec.rs rename to srml/contract/src/exec.rs diff --git a/substrate/runtime/contract/src/gas.rs b/srml/contract/src/gas.rs similarity index 100% rename from substrate/runtime/contract/src/gas.rs rename to srml/contract/src/gas.rs diff --git a/substrate/runtime/contract/src/genesis_config.rs b/srml/contract/src/genesis_config.rs similarity index 100% rename from substrate/runtime/contract/src/genesis_config.rs rename to srml/contract/src/genesis_config.rs diff --git a/substrate/runtime/contract/src/lib.rs b/srml/contract/src/lib.rs similarity index 95% rename from substrate/runtime/contract/src/lib.rs rename to srml/contract/src/lib.rs index 34acb7dcc0505..f20e8ceb54a4e 100644 --- a/substrate/runtime/contract/src/lib.rs +++ b/srml/contract/src/lib.rs @@ -62,20 +62,20 @@ extern crate serde; extern crate parity_wasm; extern crate pwasm_utils; -extern crate substrate_codec as codec; -extern crate substrate_runtime_io as runtime_io; -extern crate substrate_runtime_sandbox as sandbox; +extern crate parity_codec as codec; +extern crate sr_io as runtime_io; +extern crate sr_sandbox as sandbox; #[macro_use] -extern crate substrate_runtime_std as rstd; +extern crate sr_std as rstd; -extern crate substrate_runtime_balances as balances; -extern crate substrate_runtime_system as system; +extern crate srml_balances as balances; +extern crate srml_system as system; #[macro_use] -extern crate substrate_runtime_support as runtime_support; +extern crate srml_support as runtime_support; -extern crate substrate_runtime_primitives as runtime_primitives; +extern crate sr_primitives as runtime_primitives; extern crate substrate_primitives; #[cfg(test)] diff --git a/substrate/runtime/contract/src/tests.rs b/srml/contract/src/tests.rs similarity index 100% rename from substrate/runtime/contract/src/tests.rs rename to srml/contract/src/tests.rs diff --git a/substrate/runtime/contract/src/vm/env_def/macros.rs b/srml/contract/src/vm/env_def/macros.rs similarity index 100% rename from substrate/runtime/contract/src/vm/env_def/macros.rs rename to srml/contract/src/vm/env_def/macros.rs diff --git a/substrate/runtime/contract/src/vm/env_def/mod.rs b/srml/contract/src/vm/env_def/mod.rs similarity index 100% rename from substrate/runtime/contract/src/vm/env_def/mod.rs rename to srml/contract/src/vm/env_def/mod.rs diff --git a/substrate/runtime/contract/src/vm/mod.rs b/srml/contract/src/vm/mod.rs similarity index 100% rename from substrate/runtime/contract/src/vm/mod.rs rename to srml/contract/src/vm/mod.rs diff --git a/substrate/runtime/contract/src/vm/prepare.rs b/srml/contract/src/vm/prepare.rs similarity index 100% rename from substrate/runtime/contract/src/vm/prepare.rs rename to srml/contract/src/vm/prepare.rs diff --git a/srml/council/Cargo.toml b/srml/council/Cargo.toml new file mode 100644 index 0000000000000..7f546dd2773d4 --- /dev/null +++ b/srml/council/Cargo.toml @@ -0,0 +1,43 @@ +[package] +name = "srml-council" +version = "0.1.0" +authors = ["Parity Technologies "] + +[dependencies] +hex-literal = "0.1.0" +integer-sqrt = { git = "https://github.com/paritytech/integer-sqrt-rs.git", branch = "master" } +serde = { version = "1.0", default_features = false } +serde_derive = { version = "1.0", optional = true } +safe-mix = { version = "1.0", default_features = false} +parity-codec = { path = "../../codec", default_features = false } +parity-codec-derive = { path = "../../codec/derive", default_features = false } +substrate-keyring = { path = "../../core/keyring", optional = true } +substrate-primitives = { path = "../../core/primitives", default_features = false } +sr-std = { path = "../../core/sr-std", default_features = false } +sr-io = { path = "../../core/sr-io", default_features = false } +sr-primitives = { path = "../../core/sr-primitives", default_features = false } +srml-support = { path = "../support", default_features = false } +srml-consensus = { path = "../consensus", default_features = false } +srml-balances = { path = "../balances", default_features = false } +srml-democracy = { path = "../democracy", default_features = false } +srml-system = { path = "../system", default_features = false } + +[features] +default = ["std"] +std = [ + "serde/std", + "serde_derive", + "safe-mix/std", + "substrate-keyring", + "parity-codec/std", + "parity-codec-derive/std", + "substrate-primitives/std", + "sr-std/std", + "sr-io/std", + "srml-support/std", + "sr-primitives/std", + "srml-consensus/std", + "srml-balances/std", + "srml-democracy/std", + "srml-system/std", +] diff --git a/substrate/runtime/council/src/lib.rs b/srml/council/src/lib.rs similarity index 93% rename from substrate/runtime/council/src/lib.rs rename to srml/council/src/lib.rs index 1c0883877fcba..1ca42835748eb 100644 --- a/substrate/runtime/council/src/lib.rs +++ b/srml/council/src/lib.rs @@ -30,17 +30,17 @@ extern crate serde_derive; extern crate hex_literal; extern crate integer_sqrt; -extern crate substrate_codec as codec; -#[macro_use] extern crate substrate_codec_derive; +extern crate parity_codec as codec; +#[macro_use] extern crate parity_codec_derive; extern crate substrate_primitives; #[cfg(feature = "std")] extern crate substrate_keyring as keyring; -#[macro_use] extern crate substrate_runtime_std as rstd; -extern crate substrate_runtime_io as runtime_io; -#[macro_use] extern crate substrate_runtime_support; -extern crate substrate_runtime_primitives as primitives; -extern crate substrate_runtime_balances as balances; -extern crate substrate_runtime_democracy as democracy; -extern crate substrate_runtime_system as system; +#[macro_use] extern crate sr_std as rstd; +extern crate sr_io as runtime_io; +#[macro_use] extern crate srml_support; +extern crate sr_primitives as primitives; +extern crate srml_balances as balances; +extern crate srml_democracy as democracy; +extern crate srml_system as system; #[cfg(feature = "std")] use rstd::prelude::*; @@ -49,7 +49,7 @@ use std::collections::HashMap; #[cfg(feature = "std")] use primitives::traits::As; #[cfg(feature = "std")] -use substrate_runtime_support::StorageValue; +use srml_support::StorageValue; pub mod voting; pub mod motions; diff --git a/substrate/runtime/council/src/motions.rs b/srml/council/src/motions.rs similarity index 98% rename from substrate/runtime/council/src/motions.rs rename to srml/council/src/motions.rs index b9b26df00f015..babbec78347b9 100644 --- a/substrate/runtime/council/src/motions.rs +++ b/srml/council/src/motions.rs @@ -20,8 +20,8 @@ use rstd::prelude::*; use rstd::result; use substrate_primitives::u32_trait::Value as U32; use primitives::traits::{Hash, EnsureOrigin, MaybeSerializeDebug, OnFinalise}; -use substrate_runtime_support::dispatch::{Result, Dispatchable, Parameter}; -use substrate_runtime_support::{StorageValue, StorageMap}; +use srml_support::dispatch::{Result, Dispatchable, Parameter}; +use srml_support::{StorageValue, StorageMap}; use super::{Trait as CouncilTrait, Module as Council}; use system::{self, ensure_signed}; @@ -221,7 +221,7 @@ mod tests { use super::RawEvent; use ::tests::*; use ::tests::{Call, Origin, Event as OuterEvent}; - use substrate_runtime_support::Hashable; + use srml_support::Hashable; use system::{EventRecord, Phase}; #[test] diff --git a/substrate/runtime/council/src/seats.rs b/srml/council/src/seats.rs similarity index 99% rename from substrate/runtime/council/src/seats.rs rename to srml/council/src/seats.rs index 294035a25a941..8941dbeccb919 100644 --- a/substrate/runtime/council/src/seats.rs +++ b/srml/council/src/seats.rs @@ -19,7 +19,7 @@ use rstd::prelude::*; use primitives::traits::{Zero, One, As, Lookup, OnFinalise}; use runtime_io::print; -use substrate_runtime_support::{StorageValue, StorageMap, dispatch::Result}; +use srml_support::{StorageValue, StorageMap, dispatch::Result}; use democracy; use balances::{self, address::Address}; use system::{self, ensure_signed, ensure_root}; diff --git a/substrate/runtime/council/src/voting.rs b/srml/council/src/voting.rs similarity index 99% rename from substrate/runtime/council/src/voting.rs rename to srml/council/src/voting.rs index 450eb034f12cc..886adfc7bf664 100644 --- a/substrate/runtime/council/src/voting.rs +++ b/srml/council/src/voting.rs @@ -20,8 +20,8 @@ use rstd::prelude::*; use rstd::borrow::Borrow; use primitives::traits::{OnFinalise, Hash}; use runtime_io::print; -use substrate_runtime_support::dispatch::Result; -use substrate_runtime_support::{StorageValue, StorageMap, IsSubType}; +use srml_support::dispatch::Result; +use srml_support::{StorageValue, StorageMap, IsSubType}; use {system, democracy}; use super::{Trait as CouncilTrait, Module as Council}; use system::{ensure_signed, ensure_root}; @@ -244,7 +244,7 @@ mod tests { use super::*; use ::tests::*; use ::tests::{Call, Origin}; - use substrate_runtime_support::Hashable; + use srml_support::Hashable; use democracy::VoteThreshold; #[test] diff --git a/srml/democracy/Cargo.toml b/srml/democracy/Cargo.toml new file mode 100644 index 0000000000000..5a523d5f5c31d --- /dev/null +++ b/srml/democracy/Cargo.toml @@ -0,0 +1,37 @@ +[package] +name = "srml-democracy" +version = "0.1.0" +authors = ["Parity Technologies "] + +[dependencies] +hex-literal = "0.1.0" +serde = { version = "1.0", default_features = false } +serde_derive = { version = "1.0", optional = true } +safe-mix = { version = "1.0", default_features = false} +parity-codec = { path = "../../codec", default_features = false } +parity-codec-derive = { path = "../../codec/derive", default_features = false } +substrate-primitives = { path = "../../core/primitives", default_features = false } +sr-std = { path = "../../core/sr-std", default_features = false } +sr-io = { path = "../../core/sr-io", default_features = false } +sr-primitives = { path = "../../core/sr-primitives", default_features = false } +srml-support = { path = "../support", default_features = false } +srml-balances = { path = "../balances", default_features = false } +srml-consensus = { path = "../consensus", default_features = false } +srml-system = { path = "../system", default_features = false } + +[features] +default = ["std"] +std = [ + "serde/std", + "serde_derive", + "safe-mix/std", + "parity-codec/std", + "substrate-primitives/std", + "sr-std/std", + "sr-io/std", + "srml-support/std", + "sr-primitives/std", + "srml-consensus/std", + "srml-balances/std", + "srml-system/std", +] diff --git a/substrate/runtime/democracy/src/lib.rs b/srml/democracy/src/lib.rs similarity index 97% rename from substrate/runtime/democracy/src/lib.rs rename to srml/democracy/src/lib.rs index 12f2e7e7aa402..f74f37094d8ae 100644 --- a/substrate/runtime/democracy/src/lib.rs +++ b/srml/democracy/src/lib.rs @@ -29,23 +29,23 @@ extern crate substrate_primitives; extern crate serde_derive; #[macro_use] -extern crate substrate_codec_derive; +extern crate parity_codec_derive; #[macro_use] -extern crate substrate_runtime_std as rstd; +extern crate sr_std as rstd; #[macro_use] -extern crate substrate_runtime_support; +extern crate srml_support; -extern crate substrate_codec as codec; -extern crate substrate_runtime_io as runtime_io; -extern crate substrate_runtime_primitives as primitives; -extern crate substrate_runtime_balances as balances; -extern crate substrate_runtime_system as system; +extern crate parity_codec as codec; +extern crate sr_io as runtime_io; +extern crate sr_primitives as primitives; +extern crate srml_balances as balances; +extern crate srml_system as system; use rstd::prelude::*; use rstd::result; use primitives::traits::{Zero, OnFinalise, As, MaybeSerializeDebug}; -use substrate_runtime_support::{StorageValue, StorageMap, Parameter, Dispatchable, IsSubType}; -use substrate_runtime_support::dispatch::Result; +use srml_support::{StorageValue, StorageMap, Parameter, Dispatchable, IsSubType}; +use srml_support::dispatch::Result; use system::{ensure_signed, ensure_root}; #[cfg(any(feature = "std", test))] diff --git a/substrate/runtime/democracy/src/vote_threshold.rs b/srml/democracy/src/vote_threshold.rs similarity index 100% rename from substrate/runtime/democracy/src/vote_threshold.rs rename to srml/democracy/src/vote_threshold.rs diff --git a/srml/example/Cargo.toml b/srml/example/Cargo.toml new file mode 100644 index 0000000000000..cb173c08960e2 --- /dev/null +++ b/srml/example/Cargo.toml @@ -0,0 +1,34 @@ +[package] +name = "srml-example" +version = "0.1.0" +authors = ["Parity Technologies "] + +[dependencies] +hex-literal = "0.1.0" +serde = { version = "1.0", default_features = false } +serde_derive = { version = "1.0", optional = true } +parity-codec = { path = "../../codec", default_features = false } +parity-codec-derive = { path = "../../codec/derive", default_features = false } +substrate-primitives = { path = "../../core/primitives", default_features = false } +sr-std = { path = "../../core/sr-std", default_features = false } +sr-io = { path = "../../core/sr-io", default_features = false } +sr-primitives = { path = "../../core/sr-primitives", default_features = false } +srml-support = { path = "../support", default_features = false } +srml-system = { path = "../system", default_features = false } +srml-balances = { path = "../balances", default_features = false } + +[features] +default = ["std"] +std = [ + "sr-std/std", + "sr-io/std", + "srml-support/std", + "sr-primitives/std", + "srml-balances/std", + "serde/std", + "serde_derive", + "parity-codec/std", + "parity-codec-derive/std", + "substrate-primitives/std", + "srml-system/std", +] diff --git a/substrate/runtime/example/src/lib.rs b/srml/example/src/lib.rs similarity index 97% rename from substrate/runtime/example/src/lib.rs rename to srml/example/src/lib.rs index 8247106e38466..77e77ef1ad4df 100644 --- a/substrate/runtime/example/src/lib.rs +++ b/srml/example/src/lib.rs @@ -22,11 +22,11 @@ // Assert macros used in tests. #[cfg_attr(feature = "std", macro_use)] -extern crate substrate_runtime_std; +extern crate sr_std; // Needed for tests (`with_externalities`). #[cfg(test)] -extern crate substrate_runtime_io as runtime_io; +extern crate sr_io as runtime_io; // Needed for the set of mock primitives used in our tests. #[cfg(test)] @@ -41,22 +41,22 @@ extern crate serde_derive; // Needed for deriving `Encode` and `Decode` for `RawEvent`. #[macro_use] -extern crate substrate_codec_derive; -extern crate substrate_codec as codec; +extern crate parity_codec_derive; +extern crate parity_codec as codec; // Needed for type-safe access to storage DB. #[macro_use] -extern crate substrate_runtime_support as runtime_support; +extern crate srml_support as runtime_support; // Needed for various traits. In our case, `OnFinalise`. -extern crate substrate_runtime_primitives as runtime_primitives; +extern crate sr_primitives as runtime_primitives; // `system` module provides us with all sorts of useful stuff and macros // depend on it being around. -extern crate substrate_runtime_system as system; +extern crate srml_system as system; // `balances` module is needed for our little example. It's not required in // general (though if you want your module to be able to work with tokens, then you // might find it useful). -extern crate substrate_runtime_balances as balances; +extern crate srml_balances as balances; use runtime_primitives::traits::OnFinalise; use runtime_support::{StorageValue, dispatch::Result}; diff --git a/srml/executive/Cargo.toml b/srml/executive/Cargo.toml new file mode 100644 index 0000000000000..113a7d307a71e --- /dev/null +++ b/srml/executive/Cargo.toml @@ -0,0 +1,33 @@ +[package] +name = "srml-executive" +version = "0.1.0" +authors = ["Parity Technologies "] + +[dependencies] +hex-literal = "0.1.0" +serde = { version = "1.0", default_features = false } +serde_derive = { version = "1.0", optional = true } +parity-codec = { path = "../../codec", default_features = false } +sr-std = { path = "../../core/sr-std", default_features = false } +sr-io = { path = "../../core/sr-io", default_features = false } +sr-primitives = { path = "../../core/sr-primitives", default_features = false } +srml-support = { path = "../support", default_features = false } +srml-system = { path = "../system", default_features = false } + +[dev-dependencies] +parity-codec-derive = { path = "../../codec/derive" } +substrate-primitives = { path = "../../core/primitives" } +srml-balances = { path = "../balances" } + +[features] +default = ["std"] +std = [ + "sr-std/std", + "srml-support/std", + "serde/std", + "serde_derive", + "parity-codec/std", + "sr-primitives/std", + "sr-io/std", + "srml-system/std", +] diff --git a/substrate/runtime/executive/src/lib.rs b/srml/executive/src/lib.rs similarity index 93% rename from substrate/runtime/executive/src/lib.rs rename to srml/executive/src/lib.rs index 9b7e736f6d934..a1086e0881534 100644 --- a/substrate/runtime/executive/src/lib.rs +++ b/srml/executive/src/lib.rs @@ -26,16 +26,16 @@ extern crate serde_derive; #[cfg(test)] #[macro_use] -extern crate substrate_codec_derive; +extern crate parity_codec_derive; #[cfg_attr(test, macro_use)] -extern crate substrate_runtime_support as runtime_support; +extern crate srml_support as runtime_support; -extern crate substrate_runtime_std as rstd; -extern crate substrate_runtime_io as runtime_io; -extern crate substrate_codec as codec; -extern crate substrate_runtime_primitives as primitives; -extern crate substrate_runtime_system as system; +extern crate sr_std as rstd; +extern crate sr_io as runtime_io; +extern crate parity_codec as codec; +extern crate sr_primitives as primitives; +extern crate srml_system as system; #[cfg(test)] #[macro_use] @@ -45,13 +45,14 @@ extern crate hex_literal; extern crate substrate_primitives; #[cfg(test)] -extern crate substrate_runtime_balances as balances; +extern crate srml_balances as balances; use rstd::prelude::*; use rstd::marker::PhantomData; use rstd::result; use primitives::traits::{self, Header, Zero, One, Checkable, Applyable, CheckEqual, OnFinalise, MakePayment, Hash}; +use runtime_support::Dispatchable; use codec::{Codec, Encode}; use system::extrinsics_root; use primitives::{ApplyOutcome, ApplyError}; @@ -87,7 +88,9 @@ impl< Finalisation: OnFinalise, > Executive where Block::Extrinsic: Checkable Result> + Codec, - Result>>::Checked: Applyable + Result>>::Checked: Applyable, + < Result>>::Checked as Applyable>::Call: Dispatchable, + << Result>>::Checked as Applyable>::Call as Dispatchable>::Origin: From> { /// Start the execution of a particular block. pub fn initialise_block(header: &System::Header) { @@ -191,8 +194,8 @@ impl< } // decode parameters and dispatch - let r = xt.apply(); - + let (f, s) = xt.deconstruct(); + let r = f.dispatch(s.into()); >::note_applied_extrinsic(&r); r.map(|_| internal::ApplyOutcome::Success).or_else(|e| Ok(internal::ApplyOutcome::Fail(e))) diff --git a/srml/session/Cargo.toml b/srml/session/Cargo.toml new file mode 100644 index 0000000000000..5e2e29ab05e72 --- /dev/null +++ b/srml/session/Cargo.toml @@ -0,0 +1,40 @@ +[package] +name = "srml-session" +version = "0.1.0" +authors = ["Parity Technologies "] + +[dependencies] +hex-literal = "0.1.0" +serde = { version = "1.0", default_features = false } +serde_derive = { version = "1.0", optional = true } +safe-mix = { version = "1.0", default_features = false} +substrate-keyring = { path = "../../core/keyring", optional = true } +substrate-primitives = { path = "../../core/primitives", default_features = false } +parity-codec = { path = "../../codec", default_features = false } +parity-codec-derive = { path = "../../codec/derive", default_features = false } +sr-std = { path = "../../core/sr-std", default_features = false } +sr-io = { path = "../../core/sr-io", default_features = false } +sr-primitives = { path = "../../core/sr-primitives", default_features = false } +srml-support = { path = "../support", default_features = false } +srml-consensus = { path = "../consensus", default_features = false } +srml-system = { path = "../system", default_features = false } +srml-timestamp = { path = "../timestamp", default_features = false } + +[features] +default = ["std"] +std = [ + "serde/std", + "serde_derive", + "safe-mix/std", + "substrate-keyring", + "parity-codec/std", + "parity-codec-derive/std", + "substrate-primitives/std", + "sr-std/std", + "sr-io/std", + "srml-support/std", + "sr-primitives/std", + "srml-consensus/std", + "srml-system/std", + "srml-timestamp/std" +] diff --git a/substrate/runtime/session/src/lib.rs b/srml/session/src/lib.rs similarity index 97% rename from substrate/runtime/session/src/lib.rs rename to srml/session/src/lib.rs index 007dd43729f7c..61cf47a095717 100644 --- a/substrate/runtime/session/src/lib.rs +++ b/srml/session/src/lib.rs @@ -33,20 +33,20 @@ extern crate substrate_keyring as keyring; extern crate substrate_primitives; #[cfg_attr(feature = "std", macro_use)] -extern crate substrate_runtime_std as rstd; +extern crate sr_std as rstd; #[macro_use] -extern crate substrate_runtime_support as runtime_support; +extern crate srml_support as runtime_support; #[macro_use] -extern crate substrate_codec_derive; - -extern crate substrate_runtime_io as runtime_io; -extern crate substrate_codec as codec; -extern crate substrate_runtime_primitives as primitives; -extern crate substrate_runtime_consensus as consensus; -extern crate substrate_runtime_system as system; -extern crate substrate_runtime_timestamp as timestamp; +extern crate parity_codec_derive; + +extern crate sr_io as runtime_io; +extern crate parity_codec as codec; +extern crate sr_primitives as primitives; +extern crate srml_consensus as consensus; +extern crate srml_system as system; +extern crate srml_timestamp as timestamp; use rstd::prelude::*; use primitives::traits::{Zero, One, OnFinalise, Convert, As}; diff --git a/srml/staking/Cargo.toml b/srml/staking/Cargo.toml new file mode 100644 index 0000000000000..6fa892e5c6698 --- /dev/null +++ b/srml/staking/Cargo.toml @@ -0,0 +1,45 @@ +[package] +name = "srml-staking" +version = "0.1.0" +authors = ["Parity Technologies "] + +[dependencies] +hex-literal = "0.1.0" +serde = { version = "1.0", default_features = false } +serde_derive = { version = "1.0", optional = true } +safe-mix = { version = "1.0", default_features = false} +parity-codec = { path = "../../codec", default_features = false } +parity-codec-derive = { path = "../../codec/derive", default_features = false } +substrate-keyring = { path = "../../core/keyring", optional = true } +substrate-primitives = { path = "../../core/primitives", default_features = false } +sr-std = { path = "../../core/sr-std", default_features = false } +sr-io = { path = "../../core/sr-io", default_features = false } +sr-sandbox = { path = "../../core/sr-sandbox", default_features = false } +sr-primitives = { path = "../../core/sr-primitives", default_features = false } +srml-support = { path = "../support", default_features = false } +srml-balances = { path = "../balances", default_features = false } +srml-consensus = { path = "../consensus", default_features = false } +srml-system = { path = "../system", default_features = false } +srml-session = { path = "../session", default_features = false } +srml-timestamp = { path = "../timestamp", default_features = false } + +[features] +default = ["std"] +std = [ + "serde/std", + "serde_derive", + "safe-mix/std", + "substrate-keyring", + "parity-codec/std", + "parity-codec-derive/std", + "substrate-primitives/std", + "sr-std/std", + "sr-io/std", + "sr-sandbox/std", + "srml-support/std", + "sr-primitives/std", + "srml-balances/std", + "srml-session/std", + "srml-system/std", + "srml-timestamp/std" +] diff --git a/substrate/runtime/staking/src/genesis_config.rs b/srml/staking/src/genesis_config.rs similarity index 100% rename from substrate/runtime/staking/src/genesis_config.rs rename to srml/staking/src/genesis_config.rs diff --git a/substrate/runtime/staking/src/lib.rs b/srml/staking/src/lib.rs similarity index 97% rename from substrate/runtime/staking/src/lib.rs rename to srml/staking/src/lib.rs index f9737d6a3c26a..1e0ec4b7b2078 100644 --- a/substrate/runtime/staking/src/lib.rs +++ b/srml/staking/src/lib.rs @@ -28,24 +28,24 @@ extern crate serde; extern crate serde_derive; #[macro_use] -extern crate substrate_runtime_support as runtime_support; +extern crate srml_support as runtime_support; #[cfg_attr(feature = "std", macro_use)] -extern crate substrate_runtime_std as rstd; +extern crate sr_std as rstd; #[macro_use] -extern crate substrate_codec_derive; +extern crate parity_codec_derive; -extern crate substrate_codec as codec; +extern crate parity_codec as codec; extern crate substrate_primitives; -extern crate substrate_runtime_io as runtime_io; -extern crate substrate_runtime_primitives as primitives; -extern crate substrate_runtime_balances as balances; -extern crate substrate_runtime_consensus as consensus; -extern crate substrate_runtime_sandbox as sandbox; -extern crate substrate_runtime_session as session; -extern crate substrate_runtime_system as system; -extern crate substrate_runtime_timestamp as timestamp; +extern crate sr_io as runtime_io; +extern crate sr_primitives as primitives; +extern crate srml_balances as balances; +extern crate srml_consensus as consensus; +extern crate sr_sandbox as sandbox; +extern crate srml_session as session; +extern crate srml_system as system; +extern crate srml_timestamp as timestamp; use rstd::prelude::*; use runtime_support::{Parameter, StorageValue, StorageMap}; diff --git a/substrate/runtime/staking/src/mock.rs b/srml/staking/src/mock.rs similarity index 100% rename from substrate/runtime/staking/src/mock.rs rename to srml/staking/src/mock.rs diff --git a/substrate/runtime/staking/src/tests.rs b/srml/staking/src/tests.rs similarity index 100% rename from substrate/runtime/staking/src/tests.rs rename to srml/staking/src/tests.rs diff --git a/srml/support/Cargo.toml b/srml/support/Cargo.toml new file mode 100644 index 0000000000000..3f6d4e9e45779 --- /dev/null +++ b/srml/support/Cargo.toml @@ -0,0 +1,34 @@ +[package] +name = "srml-support" +version = "0.1.0" +authors = ["Parity Technologies "] + +[dependencies] +hex-literal = { version = "0.1.0", optional = true } +serde = { version = "1.0", default_features = false } +serde_derive = { version = "1.0", optional = true } +parity-codec = { path = "../../codec", default_features = false } +substrate-primitives = { path = "../../core/primitives", default_features = false } +substrate-metadata = { path = "../../core/metadata", default_features = false } +sr-std = { path = "../../core/sr-std", default_features = false } +sr-io = { path = "../../core/sr-io", default_features = false } + +[dev-dependencies] +pretty_assertions = "0.5.1" +serde_json = { version = "1.0" } +parity-codec-derive = { path = "../../codec/derive" } + +[features] +default = ["std"] +std = [ + "hex-literal", + "serde/std", + "serde_derive", + "substrate-primitives/std", + "sr-io/std", + "parity-codec/std", + "sr-std/std", + "substrate-metadata/std", +] +nightly = [] +strict = [] diff --git a/substrate/runtime-support/README.adoc b/srml/support/README.adoc similarity index 100% rename from substrate/runtime-support/README.adoc rename to srml/support/README.adoc diff --git a/substrate/runtime-support/src/dispatch.rs b/srml/support/src/dispatch.rs similarity index 99% rename from substrate/runtime-support/src/dispatch.rs rename to srml/support/src/dispatch.rs index 90f6fd7a6d4ff..092f1560903ba 100644 --- a/substrate/runtime-support/src/dispatch.rs +++ b/srml/support/src/dispatch.rs @@ -78,7 +78,7 @@ macro_rules! decl_module { #[cfg_attr(feature = "std", derive(Debug, Serialize, Deserialize))] // TODO: switching based on std feature is because of an issue in // serde-derive for when we attempt to derive `Deserialize` on these types, - // in a situation where we've imported `substrate_runtime_support` as another name. + // in a situation where we've imported `srml_support` as another name. #[cfg(feature = "std")] pub struct $mod_type<$trait_instance: $trait_name>(::std::marker::PhantomData<$trait_instance>); diff --git a/substrate/runtime-support/src/event.rs b/srml/support/src/event.rs similarity index 100% rename from substrate/runtime-support/src/event.rs rename to srml/support/src/event.rs diff --git a/substrate/runtime-support/src/hashable.rs b/srml/support/src/hashable.rs similarity index 100% rename from substrate/runtime-support/src/hashable.rs rename to srml/support/src/hashable.rs diff --git a/substrate/runtime-support/src/lib.rs b/srml/support/src/lib.rs similarity index 96% rename from substrate/runtime-support/src/lib.rs rename to srml/support/src/lib.rs index 73099360dad47..e467dc06795de 100644 --- a/substrate/runtime-support/src/lib.rs +++ b/srml/support/src/lib.rs @@ -27,9 +27,10 @@ extern crate alloc; #[cfg(feature = "std")] extern crate serde; -extern crate substrate_runtime_std as rstd; -extern crate substrate_runtime_io as runtime_io; +extern crate sr_std as rstd; +extern crate sr_io as runtime_io; extern crate substrate_primitives as primitives; +extern crate substrate_metadata; #[cfg(test)] #[macro_use] @@ -41,10 +42,10 @@ extern crate serde_derive; extern crate serde_json; #[cfg(test)] #[macro_use] -extern crate substrate_codec_derive; +extern crate parity_codec_derive; #[doc(hidden)] -pub extern crate substrate_codec as codec; +pub extern crate parity_codec as codec; pub use self::storage::generator::Storage as GenericStorage; #[cfg(feature = "std")] diff --git a/substrate/runtime-support/src/metadata.rs b/srml/support/src/metadata.rs similarity index 53% rename from substrate/runtime-support/src/metadata.rs rename to srml/support/src/metadata.rs index 12953871d324a..5fc57636c3f7a 100644 --- a/substrate/runtime-support/src/metadata.rs +++ b/srml/support/src/metadata.rs @@ -14,10 +14,8 @@ // You should have received a copy of the GNU General Public License // along with Substrate. If not, see . -use codec::{Encode, Output}; -#[cfg(feature = "std")] -use codec::{Decode, Input}; use alloc; +pub use substrate_metadata::JsonMetadata; /// Make Box available on `std` and `no_std`. pub type Box = alloc::boxed::Box; @@ -39,10 +37,10 @@ macro_rules! impl_json_metadata { $( $rest:tt )* ) => { impl $runtime { - pub fn json_metadata() -> $crate::metadata::Vec<$crate::metadata::JSONMetadata> { + pub fn json_metadata() -> $crate::metadata::Vec<$crate::metadata::JsonMetadata> { let events = Self::outer_event_json_metadata(); __impl_json_metadata!($runtime; - $crate::metadata::JSONMetadata::Events { + $crate::metadata::JsonMetadata::Events { name: events.0, events: events.1, }; @@ -53,167 +51,6 @@ macro_rules! impl_json_metadata { } } -/// The metadata of a runtime encoded as JSON. -#[derive(Eq)] -#[cfg_attr(feature = "std", derive(Debug))] -pub enum JSONMetadata { - Events { name: &'static str, events: &'static [(&'static str, fn() -> &'static str)] }, - Module { module: &'static str, prefix: &'static str }, - ModuleWithStorage { module: &'static str, prefix: &'static str, storage: &'static str } -} - -impl Encode for JSONMetadata { - fn encode_to(&self, dest: &mut W) { - match self { - JSONMetadata::Events { name, events } => { - 0i8.encode_to(dest); - name.encode_to(dest); - events.iter().fold(0u32, |count, _| count + 1).encode_to(dest); - events - .iter() - .map(|(module, data)| (module, data())) - .for_each(|val| val.encode_to(dest)); - }, - JSONMetadata::Module { module, prefix } => { - 1i8.encode_to(dest); - prefix.encode_to(dest); - module.encode_to(dest); - }, - JSONMetadata::ModuleWithStorage { module, prefix, storage } => { - 2i8.encode_to(dest); - prefix.encode_to(dest); - module.encode_to(dest); - storage.encode_to(dest); - } - } - } -} - -impl PartialEq for JSONMetadata { - fn eq(&self, other: &JSONMetadata) -> bool { - match (self, other) { - ( - JSONMetadata::Events { name: lname, events: left }, - JSONMetadata::Events { name: rname, events: right } - ) => { - lname == rname && left.iter().zip(right.iter()).fold(true, |res, (l, r)| { - res && l.0 == r.0 && l.1() == r.1() - }) - }, - ( - JSONMetadata::Module { prefix: lpre, module: lmod }, - JSONMetadata::Module { prefix: rpre, module: rmod } - ) => { - lpre == rpre && lmod == rmod - }, - ( - JSONMetadata::ModuleWithStorage { prefix: lpre, module: lmod, storage: lstore }, - JSONMetadata::ModuleWithStorage { prefix: rpre, module: rmod, storage: rstore } - ) => { - lpre == rpre && lmod == rmod && lstore == rstore - }, - _ => false, - } - } -} - -/// Utility struct for making `JSONMetadata` decodeable. -#[derive(Eq, PartialEq, Debug)] -#[cfg(feature = "std")] -pub enum JSONMetadataDecodable { - Events { name: String, events: Vec<(String, String)> }, - Module { module: String, prefix: String }, - ModuleWithStorage { module: String, prefix: String, storage: String } -} - -#[cfg(feature = "std")] -impl JSONMetadataDecodable { - /// Returns the instance as JSON string. - /// The first value of the tuple is the name of the metadata type and the second in the JSON string. - pub fn into_json_string(self) -> (&'static str, String) { - match self { - JSONMetadataDecodable::Events { name, events } => { - ( - "events", - format!( - r#"{{ "name": "{}", "events": {{ {} }} }}"#, name, - events.iter().enumerate() - .fold(String::from(""), |mut json, (i, (name, data))| { - if i > 0 { - json.push_str(", "); - } - json.push_str(&format!(r#""{}": {}"#, name, data)); - json - }) - ) - ) - }, - JSONMetadataDecodable::Module { prefix, module } => { - ("module", format!(r#"{{ "prefix": "{}", "module": {} }}"#, prefix, module)) - }, - JSONMetadataDecodable::ModuleWithStorage { prefix, module, storage } => { - ( - "moduleWithStorage", - format!( - r#"{{ "prefix": "{}", "module": {}, "storage": {} }}"#, - prefix, module, storage - ) - ) - } - } - } -} - -#[cfg(feature = "std")] -impl Decode for JSONMetadataDecodable { - fn decode(input: &mut I) -> Option { - i8::decode(input).and_then(|variant| { - match variant { - 0 => String::decode(input) - .and_then(|name| Vec::<(String, String)>::decode(input).map(|events| (name, events))) - .and_then(|(name, events)| Some(JSONMetadataDecodable::Events { name, events })), - 1 => String::decode(input) - .and_then(|prefix| String::decode(input).map(|v| (prefix, v))) - .and_then(|(prefix, module)| Some(JSONMetadataDecodable::Module { prefix, module })), - 2 => String::decode(input) - .and_then(|prefix| String::decode(input).map(|v| (prefix, v))) - .and_then(|(prefix, module)| String::decode(input).map(|v| (prefix, module, v))) - .and_then(|(prefix, module, storage)| Some(JSONMetadataDecodable::ModuleWithStorage { prefix, module, storage })), - _ => None, - } - }) - } -} - -#[cfg(test)] -impl PartialEq for JSONMetadataDecodable { - fn eq(&self, other: &JSONMetadata) -> bool { - match (self, other) { - ( - JSONMetadataDecodable::Events { name: lname, events: left }, - JSONMetadata::Events { name: rname, events: right } - ) => { - lname == rname && left.iter().zip(right.iter()).fold(true, |res, (l, r)| { - res && l.0 == r.0 && l.1 == r.1() - }) - }, - ( - JSONMetadataDecodable::Module { prefix: lpre, module: lmod }, - JSONMetadata::Module { prefix: rpre, module: rmod } - ) => { - lpre == rpre && lmod == rmod - }, - ( - JSONMetadataDecodable::ModuleWithStorage { prefix: lpre, module: lmod, storage: lstore }, - JSONMetadata::ModuleWithStorage { prefix: rpre, module: rmod, storage: rstore } - ) => { - lpre == rpre && lmod == rmod && lstore == rstore - }, - _ => false, - } - } -} - #[macro_export] #[doc(hidden)] macro_rules! __impl_json_metadata { @@ -225,7 +62,7 @@ macro_rules! __impl_json_metadata { ) => { __impl_json_metadata!( $runtime; - $( $metadata, )* $crate::metadata::JSONMetadata::Module { + $( $metadata, )* $crate::metadata::JsonMetadata::Module { module: $mod::$module::<$runtime>::json_metadata(), prefix: stringify!($mod) }; $( $rest )* @@ -238,7 +75,7 @@ macro_rules! __impl_json_metadata { ) => { __impl_json_metadata!( $runtime; - $( $metadata, )* $crate::metadata::JSONMetadata::Module { + $( $metadata, )* $crate::metadata::JsonMetadata::Module { module: $mod::$module::<$runtime>::json_metadata(), prefix: stringify!($mod) }; ) @@ -251,7 +88,7 @@ macro_rules! __impl_json_metadata { ) => { __impl_json_metadata!( $runtime; - $( $metadata, )* $crate::metadata::JSONMetadata::ModuleWithStorage { + $( $metadata, )* $crate::metadata::JsonMetadata::ModuleWithStorage { module: $mod::$module::<$runtime>::json_metadata(), prefix: stringify!($mod), storage: $mod::$module::<$runtime>::store_json_metadata() }; @@ -265,7 +102,7 @@ macro_rules! __impl_json_metadata { ) => { __impl_json_metadata!( $runtime; - $( $metadata, )* $crate::metadata::JSONMetadata::ModuleWithStorage { + $( $metadata, )* $crate::metadata::JsonMetadata::ModuleWithStorage { module: $mod::$module::<$runtime>::json_metadata(), prefix: stringify!($mod), storage: $mod::$module::<$runtime>::store_json_metadata() }; @@ -286,6 +123,8 @@ mod tests { use super::*; use serde; use serde_json; + use substrate_metadata::JsonMetadataDecodable; + use codec::{Decode, Encode}; mod system { pub trait Trait { @@ -381,12 +220,6 @@ mod tests { type Origin = u32; } - impl_json_metadata!( - for TestRuntime with modules - event_module::Module, - event_module2::ModuleWithStorage with Storage - ); - fn system_event_json() -> &'static str { r#"{ "SystemEvent": { "params": null, "description": [ ] } }"# } @@ -399,8 +232,14 @@ mod tests { r#"{ "TestEvent": { "params": [ "Balance" ], "description": [ ] } }"# } - const EXPECTED_METADATA: &[JSONMetadata] = &[ - JSONMetadata::Events { + impl_json_metadata!( + for TestRuntime with modules + event_module::Module, + event_module2::ModuleWithStorage with Storage + ); + + const EXPECTED_METADATA: &[JsonMetadata] = &[ + JsonMetadata::Events { name: "TestEvent", events: &[ ("system", system_event_json), @@ -408,7 +247,7 @@ mod tests { ("event_module2", event_module2_event_json), ] }, - JSONMetadata::Module { + JsonMetadata::Module { module: concat!( r#"{ "name": "Module", "call": "#, r#"{ "name": "Call", "functions": "#, @@ -418,7 +257,7 @@ mod tests { ), prefix: "event_module" }, - JSONMetadata::ModuleWithStorage { + JsonMetadata::ModuleWithStorage { module: r#"{ "name": "ModuleWithStorage", "call": { "name": "Call", "functions": { } } }"#, prefix: "event_module2", storage: concat!( @@ -439,7 +278,7 @@ mod tests { fn json_metadata_encode_and_decode() { let metadata = TestRuntime::json_metadata(); let metadata_encoded = metadata.encode(); - let metadata_decoded = Vec::::decode(&mut &metadata_encoded[..]); + let metadata_decoded = Vec::::decode(&mut &metadata_encoded[..]); assert_eq!(&metadata_decoded.unwrap()[..], &metadata[..]); } @@ -448,7 +287,7 @@ mod tests { fn into_json_string_is_valid_json() { let metadata = TestRuntime::json_metadata(); let metadata_encoded = metadata.encode(); - let metadata_decoded = Vec::::decode(&mut &metadata_encoded[..]); + let metadata_decoded = Vec::::decode(&mut &metadata_encoded[..]); for mdata in metadata_decoded.unwrap().into_iter() { let json = mdata.into_json_string(); diff --git a/substrate/runtime-support/src/storage/generator.rs b/srml/support/src/storage/generator.rs similarity index 99% rename from substrate/runtime-support/src/storage/generator.rs rename to srml/support/src/storage/generator.rs index 7c820cc5ccecf..1ff9731cf1c15 100644 --- a/substrate/runtime-support/src/storage/generator.rs +++ b/srml/support/src/storage/generator.rs @@ -28,7 +28,7 @@ //! //! ```rust //! #[macro_use] -//! extern crate substrate_runtime_support; +//! extern crate srml_support; //! //! type AuthorityId = [u8; 32]; //! type Balance = u64; diff --git a/substrate/runtime-support/src/storage/mod.rs b/srml/support/src/storage/mod.rs similarity index 100% rename from substrate/runtime-support/src/storage/mod.rs rename to srml/support/src/storage/mod.rs diff --git a/srml/system/Cargo.toml b/srml/system/Cargo.toml new file mode 100644 index 0000000000000..ce3f148fe4f8c --- /dev/null +++ b/srml/system/Cargo.toml @@ -0,0 +1,32 @@ +[package] +name = "srml-system" +version = "0.1.0" +authors = ["Parity Technologies "] + +[dependencies] +hex-literal = "0.1.0" +serde = { version = "1.0", default_features = false } +serde_derive = { version = "1.0", optional = true } +safe-mix = { version = "1.0", default_features = false} +parity-codec = { path = "../../codec", default_features = false } +parity-codec-derive = { path = "../../codec/derive", default_features = false } +substrate-primitives = { path = "../../core/primitives", default_features = false } +sr-std = { path = "../../core/sr-std", default_features = false } +sr-io = { path = "../../core/sr-io", default_features = false } +sr-primitives = { path = "../../core/sr-primitives", default_features = false } +srml-support = { path = "../support", default_features = false } + +[features] +default = ["std"] +std = [ + "serde/std", + "serde_derive", + "safe-mix/std", + "parity-codec/std", + "parity-codec-derive/std", + "substrate-primitives/std", + "sr-std/std", + "sr-io/std", + "srml-support/std", + "sr-primitives/std", +] diff --git a/substrate/runtime/system/src/lib.rs b/srml/system/src/lib.rs similarity index 98% rename from substrate/runtime/system/src/lib.rs rename to srml/system/src/lib.rs index ae8ceff6a6047..39b2e2b0c19a2 100644 --- a/substrate/runtime/system/src/lib.rs +++ b/srml/system/src/lib.rs @@ -23,10 +23,10 @@ extern crate substrate_primitives; #[cfg_attr(any(feature = "std", test), macro_use)] -extern crate substrate_runtime_std as rstd; +extern crate sr_std as rstd; #[macro_use] -extern crate substrate_runtime_support as runtime_support; +extern crate srml_support as runtime_support; #[cfg(feature = "std")] extern crate serde; @@ -36,11 +36,11 @@ extern crate serde; extern crate serde_derive; #[macro_use] -extern crate substrate_codec_derive; +extern crate parity_codec_derive; -extern crate substrate_codec as codec; -extern crate substrate_runtime_io as runtime_io; -extern crate substrate_runtime_primitives as primitives; +extern crate parity_codec as codec; +extern crate sr_io as runtime_io; +extern crate sr_primitives as primitives; extern crate safe_mix; use rstd::prelude::*; diff --git a/srml/timestamp/Cargo.toml b/srml/timestamp/Cargo.toml new file mode 100644 index 0000000000000..dd610998504b4 --- /dev/null +++ b/srml/timestamp/Cargo.toml @@ -0,0 +1,35 @@ +[package] +name = "srml-timestamp" +version = "0.1.0" +authors = ["Parity Technologies "] + +[dependencies] +hex-literal = "0.1.0" +serde = { version = "1.0", default_features = false } +serde_derive = { version = "1.0", optional = true } +parity-codec = { path = "../../codec", default_features = false } +substrate-primitives = { path = "../../core/primitives", default_features = false } +sr-std = { path = "../../core/sr-std", default_features = false } +sr-io = { path = "../../core/sr-io", default_features = false } +sr-primitives = { path = "../../core/sr-primitives", default_features = false } +srml-support = { path = "../support", default_features = false } +srml-system = { path = "../system", default_features = false } +srml-consensus = { path = "../consensus", default_features = false } + +[dev-dependencies] +sr-io = { path = "../../core/sr-io", default_features = true } + +[features] +default = ["std"] +std = [ + "sr-std/std", + "sr-io/std", + "srml-support/std", + "sr-primitives/std", + "srml-consensus/std", + "serde/std", + "serde_derive", + "parity-codec/std", + "substrate-primitives/std", + "srml-system/std", +] diff --git a/substrate/runtime/timestamp/src/lib.rs b/srml/timestamp/src/lib.rs similarity index 95% rename from substrate/runtime/timestamp/src/lib.rs rename to srml/timestamp/src/lib.rs index bf7000e60bd4b..2556b3211c741 100644 --- a/substrate/runtime/timestamp/src/lib.rs +++ b/srml/timestamp/src/lib.rs @@ -34,13 +34,13 @@ #![cfg_attr(not(feature = "std"), no_std)] #[cfg_attr(any(feature = "std", test), macro_use)] -extern crate substrate_runtime_std as rstd; +extern crate sr_std as rstd; #[macro_use] -extern crate substrate_runtime_support as runtime_support; +extern crate srml_support as runtime_support; #[cfg(any(feature = "std", test))] -extern crate substrate_runtime_io as runtime_io; +extern crate sr_io as runtime_io; #[cfg(feature = "std")] #[macro_use] @@ -48,10 +48,10 @@ extern crate serde_derive; #[cfg(test)] extern crate substrate_primitives; -extern crate substrate_runtime_primitives as runtime_primitives; -extern crate substrate_runtime_system as system; -extern crate substrate_runtime_consensus as consensus; -extern crate substrate_codec as codec; +extern crate sr_primitives as runtime_primitives; +extern crate srml_system as system; +extern crate srml_consensus as consensus; +extern crate parity_codec as codec; use runtime_support::{StorageValue, Parameter}; use runtime_support::dispatch::Result; diff --git a/srml/treasury/Cargo.toml b/srml/treasury/Cargo.toml new file mode 100644 index 0000000000000..01166c04320e3 --- /dev/null +++ b/srml/treasury/Cargo.toml @@ -0,0 +1,34 @@ +[package] +name = "srml-treasury" +version = "0.1.0" +authors = ["Parity Technologies "] + +[dependencies] +hex-literal = "0.1.0" +serde = { version = "1.0", default_features = false } +serde_derive = { version = "1.0", optional = true } +parity-codec = { path = "../../codec", default_features = false } +parity-codec-derive = { path = "../../codec/derive", default_features = false } +substrate-primitives = { path = "../../core/primitives", default_features = false } +sr-std = { path = "../../core/sr-std", default_features = false } +sr-io = { path = "../../core/sr-io", default_features = false } +sr-primitives = { path = "../../core/sr-primitives", default_features = false } +srml-support = { path = "../support", default_features = false } +srml-system = { path = "../system", default_features = false } +srml-balances = { path = "../balances", default_features = false } + +[features] +default = ["std"] +std = [ + "serde/std", + "serde_derive", + "parity-codec/std", + "parity-codec-derive/std", + "substrate-primitives/std", + "sr-std/std", + "sr-io/std", + "sr-primitives/std", + "srml-support/std", + "srml-system/std", + "srml-balances/std", +] diff --git a/substrate/runtime/treasury/src/lib.rs b/srml/treasury/src/lib.rs similarity index 97% rename from substrate/runtime/treasury/src/lib.rs rename to srml/treasury/src/lib.rs index 1edf33a563066..867cd631bcace 100644 --- a/substrate/runtime/treasury/src/lib.rs +++ b/srml/treasury/src/lib.rs @@ -19,27 +19,27 @@ #![cfg_attr(not(feature = "std"), no_std)] #[cfg_attr(feature = "std", macro_use)] -extern crate substrate_runtime_std as rstd; +extern crate sr_std as rstd; #[macro_use] -extern crate substrate_runtime_support as runtime_support; +extern crate srml_support as runtime_support; #[cfg(feature = "std")] -extern crate substrate_runtime_io as runtime_io; +extern crate sr_io as runtime_io; #[cfg(feature = "std")] #[macro_use] extern crate serde_derive; #[macro_use] -extern crate substrate_codec_derive; +extern crate parity_codec_derive; -extern crate substrate_codec as codec; +extern crate parity_codec as codec; #[cfg(test)] extern crate substrate_primitives; -extern crate substrate_runtime_primitives as runtime_primitives; -extern crate substrate_runtime_system as system; -extern crate substrate_runtime_balances as balances; +extern crate sr_primitives as runtime_primitives; +extern crate srml_system as system; +extern crate srml_balances as balances; use rstd::prelude::*; use runtime_support::{StorageValue, StorageMap}; diff --git a/subkey/Cargo.toml b/subkey/Cargo.toml index c9bb23962dea4..171c5163b2631 100644 --- a/subkey/Cargo.toml +++ b/subkey/Cargo.toml @@ -4,8 +4,7 @@ version = "0.1.0" authors = ["Parity Technologies "] [dependencies] -ed25519 = { version = "*", path = "../substrate/ed25519" } -substrate-primitives = { version = "*", path = "../substrate/primitives" } +substrate-primitives = { version = "*", path = "../core/primitives" } rand = "0.4" [features] diff --git a/subkey/src/main.rs b/subkey/src/main.rs index aa4cf48585049..2b824664a86c5 100644 --- a/subkey/src/main.rs +++ b/subkey/src/main.rs @@ -1,14 +1,12 @@ #![cfg_attr(feature = "bench", feature(test))] #[cfg(feature = "bench")] extern crate test; -extern crate ed25519; extern crate substrate_primitives; extern crate rand; use rand::{OsRng, Rng}; use std::env::args; -use ed25519::Pair; -use substrate_primitives::hexdisplay::HexDisplay; +use substrate_primitives::{ed25519::Pair, hexdisplay::HexDisplay}; use std::cmp; fn good_waypoint(done: u64) -> u64 { diff --git a/substrate/client/db/Cargo.toml b/substrate/client/db/Cargo.toml deleted file mode 100644 index c88e338970e39..0000000000000 --- a/substrate/client/db/Cargo.toml +++ /dev/null @@ -1,24 +0,0 @@ -[package] -name = "substrate-client-db" -version = "0.1.0" -authors = ["Parity Technologies "] - -[dependencies] -parking_lot = "0.4" -log = "0.3" -kvdb = "0.1" -kvdb-rocksdb = "0.1.3" -hashdb = "0.2.1" -memorydb = "0.2.1" -substrate-primitives = { path = "../../../substrate/primitives" } -substrate-runtime-primitives = { path = "../../../substrate/runtime/primitives" } -substrate-client = { path = "../../../substrate/client" } -substrate-state-machine = { path = "../../../substrate/state-machine" } -substrate-runtime-support = { path = "../../../substrate/runtime-support" } -substrate-codec = { path = "../../../substrate/codec" } -substrate-codec-derive = { path = "../../../substrate/codec/derive" } -substrate-executor = { path = "../../../substrate/executor" } -substrate-state-db = { path = "../../../substrate/state-db" } - -[dev-dependencies] -kvdb-memorydb = "0.1" diff --git a/substrate/ed25519/Cargo.toml b/substrate/ed25519/Cargo.toml deleted file mode 100644 index 34494fc8be9b0..0000000000000 --- a/substrate/ed25519/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "ed25519" -version = "0.1.0" -authors = ["Parity Technologies "] - -[dependencies] -ring = "0.12" -untrusted = "0.5" -substrate-primitives = { version = "0.1", path = "../primitives" } -hex-literal = "0.1" -base58 = "0.1" -blake2-rfc = "0.2" diff --git a/substrate/executor/wasm/target/wasm32-unknown-unknown/release/runtime_test.compact.wasm b/substrate/executor/wasm/target/wasm32-unknown-unknown/release/runtime_test.compact.wasm deleted file mode 100644 index 9feda33fa2347..0000000000000 Binary files a/substrate/executor/wasm/target/wasm32-unknown-unknown/release/runtime_test.compact.wasm and /dev/null differ diff --git a/substrate/executor/wasm/target/wasm32-unknown-unknown/release/runtime_test.wasm b/substrate/executor/wasm/target/wasm32-unknown-unknown/release/runtime_test.wasm deleted file mode 100755 index 2e44e7cbb6624..0000000000000 Binary files a/substrate/executor/wasm/target/wasm32-unknown-unknown/release/runtime_test.wasm and /dev/null differ diff --git a/substrate/network/Cargo.toml b/substrate/network/Cargo.toml deleted file mode 100644 index 17b16e74d3558..0000000000000 --- a/substrate/network/Cargo.toml +++ /dev/null @@ -1,30 +0,0 @@ -[package] -description = "Polkadot network protocol" -name = "substrate-network" -version = "0.1.0" -license = "GPL-3.0" -authors = ["Parity Technologies "] - -[lib] - -[dependencies] -log = "0.3" -parking_lot = "0.4" -error-chain = "0.12" -bitflags = "1.0" -futures = "0.1.17" -linked-hash-map = "0.5" -rustc-hex = "1.0" -ethcore-io = { git = "https://github.com/paritytech/parity.git" } -ed25519 = { path = "../../substrate/ed25519" } -substrate-primitives = { path = "../../substrate/primitives" } -substrate-client = { path = "../../substrate/client" } -substrate-runtime-primitives = { path = "../../substrate/runtime/primitives" } -substrate-codec = { path = "../../substrate/codec" } -substrate-codec-derive = { path = "../../substrate/codec/derive" } -substrate-network-libp2p = { path = "../../substrate/network-libp2p" } - -[dev-dependencies] -env_logger = "0.4" -substrate-keyring = { path = "../../substrate/keyring" } -substrate-test-client = { path = "../../substrate/test-client" } diff --git a/substrate/runtime-support/Cargo.toml b/substrate/runtime-support/Cargo.toml deleted file mode 100644 index ee8e524cf7133..0000000000000 --- a/substrate/runtime-support/Cargo.toml +++ /dev/null @@ -1,34 +0,0 @@ -[package] -name = "substrate-runtime-support" -version = "0.1.0" -authors = ["Parity Technologies "] - -[dependencies] -ed25519 = { path = "../ed25519", optional = true } -hex-literal = { version = "0.1.0", optional = true } -serde = { version = "1.0", default_features = false } -serde_derive = { version = "1.0", optional = true } -substrate-runtime-std = { path = "../runtime-std", default_features = false } -substrate-runtime-io = { path = "../runtime-io", default_features = false } -substrate-primitives = { path = "../primitives", default_features = false } -substrate-codec = { path = "../codec", default_features = false } - -[dev-dependencies] -pretty_assertions = "0.5.1" -serde_json = { version = "1.0" } -substrate-codec-derive = { path = "../../substrate/codec/derive" } - -[features] -default = ["std"] -std = [ - "ed25519", - "hex-literal", - "serde/std", - "serde_derive", - "substrate-primitives/std", - "substrate-runtime-io/std", - "substrate-codec/std", - "substrate-runtime-std/std", -] -nightly = [] -strict = [] diff --git a/substrate/runtime/balances/Cargo.toml b/substrate/runtime/balances/Cargo.toml deleted file mode 100644 index 5a86a99c11f30..0000000000000 --- a/substrate/runtime/balances/Cargo.toml +++ /dev/null @@ -1,36 +0,0 @@ -[package] -name = "substrate-runtime-balances" -version = "0.1.0" -authors = ["Parity Technologies "] - -[dependencies] -hex-literal = "0.1.0" -serde = { version = "1.0", default_features = false } -serde_derive = { version = "1.0", optional = true } -safe-mix = { version = "1.0", default_features = false} -substrate-keyring = { path = "../../keyring", optional = true } -substrate-codec = { path = "../../codec", default_features = false } -substrate-codec-derive = { path = "../../codec/derive", default_features = false } -substrate-primitives = { path = "../../primitives", default_features = false } -substrate-runtime-std = { path = "../../runtime-std", default_features = false } -substrate-runtime-io = { path = "../../runtime-io", default_features = false } -substrate-runtime-support = { path = "../../runtime-support", default_features = false } -substrate-runtime-primitives = { path = "../primitives", default_features = false } -substrate-runtime-system = { path = "../system", default_features = false } - -[features] -default = ["std"] -std = [ - "serde/std", - "serde_derive", - "safe-mix/std", - "substrate-keyring", - "substrate-codec/std", - "substrate-codec-derive/std", - "substrate-primitives/std", - "substrate-runtime-std/std", - "substrate-runtime-io/std", - "substrate-runtime-support/std", - "substrate-runtime-primitives/std", - "substrate-runtime-system/std", -] diff --git a/substrate/runtime/consensus/Cargo.toml b/substrate/runtime/consensus/Cargo.toml deleted file mode 100644 index dfdebbddc118f..0000000000000 --- a/substrate/runtime/consensus/Cargo.toml +++ /dev/null @@ -1,32 +0,0 @@ -[package] -name = "substrate-runtime-consensus" -version = "0.1.0" -authors = ["Parity Technologies "] - -[dependencies] -hex-literal = "0.1.0" -serde = { version = "1.0", default_features = false } -serde_derive = { version = "1.0", optional = true } -substrate-codec = { path = "../../codec", default_features = false } -substrate-codec-derive = { path = "../../codec/derive", default_features = false } -substrate-primitives = { path = "../../primitives", default_features = false } -substrate-runtime-std = { path = "../../runtime-std", default_features = false } -substrate-runtime-io = { path = "../../runtime-io", default_features = false } -substrate-runtime-support = { path = "../../runtime-support", default_features = false } -substrate-runtime-primitives = { path = "../primitives", default_features = false } -substrate-runtime-system = { path = "../system", default_features = false } - -[features] -default = ["std"] -std = [ - "serde/std", - "serde_derive", - "substrate-codec/std", - "substrate-codec-derive/std", - "substrate-primitives/std", - "substrate-runtime-std/std", - "substrate-runtime-io/std", - "substrate-runtime-support/std", - "substrate-runtime-primitives/std", - "substrate-runtime-system/std", -] diff --git a/substrate/runtime/contract/Cargo.toml b/substrate/runtime/contract/Cargo.toml deleted file mode 100644 index a53cb5e886c6b..0000000000000 --- a/substrate/runtime/contract/Cargo.toml +++ /dev/null @@ -1,41 +0,0 @@ -[package] -name = "substrate-runtime-contract" -version = "0.1.0" -authors = ["Parity Technologies "] - -[dependencies] -serde = { version = "1.0", default_features = false } -serde_derive = { version = "1.0", optional = true } -substrate-codec = { path = "../../codec", default_features = false } -substrate-primitives = { path = "../../primitives", default_features = false } -substrate-runtime-primitives = { path = "../../runtime/primitives", default_features = false } -substrate-runtime-io = { path = "../../runtime-io", default_features = false } -substrate-runtime-std = { path = "../../runtime-std", default_features = false } -substrate-runtime-sandbox = { path = "../../runtime-sandbox", default_features = false } -substrate-runtime-support = { path = "../../runtime-support", default_features = false } -substrate-runtime-system = { path = "../../runtime/system", default_features = false } -substrate-runtime-balances = { path = "../balances", default_features = false } -parity-wasm = { version = "0.31", default_features = false } -pwasm-utils = { version = "0.3", default_features = false } - -[dev-dependencies] -wabt = "0.4" -assert_matches = "1.1" - -[features] -default = ["std"] -std = [ - "serde_derive", - "serde/std", - "substrate-codec/std", - "substrate-primitives/std", - "substrate-runtime-primitives/std", - "substrate-runtime-io/std", - "substrate-runtime-std/std", - "substrate-runtime-balances/std", - "substrate-runtime-sandbox/std", - "substrate-runtime-support/std", - "substrate-runtime-system/std", - "parity-wasm/std", - "pwasm-utils/std", -] diff --git a/substrate/runtime/council/Cargo.toml b/substrate/runtime/council/Cargo.toml deleted file mode 100644 index aa1bbd0bdf079..0000000000000 --- a/substrate/runtime/council/Cargo.toml +++ /dev/null @@ -1,43 +0,0 @@ -[package] -name = "substrate-runtime-council" -version = "0.1.0" -authors = ["Parity Technologies "] - -[dependencies] -hex-literal = "0.1.0" -integer-sqrt = { git = "https://github.com/paritytech/integer-sqrt-rs.git", branch = "master" } -serde = { version = "1.0", default_features = false } -serde_derive = { version = "1.0", optional = true } -safe-mix = { version = "1.0", default_features = false} -substrate-keyring = { path = "../../keyring", optional = true } -substrate-codec = { path = "../../codec", default_features = false } -substrate-codec-derive = { path = "../../codec/derive", default_features = false } -substrate-primitives = { path = "../../primitives", default_features = false } -substrate-runtime-std = { path = "../../runtime-std", default_features = false } -substrate-runtime-io = { path = "../../runtime-io", default_features = false } -substrate-runtime-support = { path = "../../runtime-support", default_features = false } -substrate-runtime-primitives = { path = "../primitives", default_features = false } -substrate-runtime-consensus = { path = "../consensus", default_features = false } -substrate-runtime-balances = { path = "../balances", default_features = false } -substrate-runtime-democracy = { path = "../democracy", default_features = false } -substrate-runtime-system = { path = "../system", default_features = false } - -[features] -default = ["std"] -std = [ - "serde/std", - "serde_derive", - "safe-mix/std", - "substrate-keyring", - "substrate-codec/std", - "substrate-codec-derive/std", - "substrate-primitives/std", - "substrate-runtime-std/std", - "substrate-runtime-io/std", - "substrate-runtime-support/std", - "substrate-runtime-primitives/std", - "substrate-runtime-consensus/std", - "substrate-runtime-balances/std", - "substrate-runtime-democracy/std", - "substrate-runtime-system/std", -] diff --git a/substrate/runtime/democracy/Cargo.toml b/substrate/runtime/democracy/Cargo.toml deleted file mode 100644 index 4667e22be3781..0000000000000 --- a/substrate/runtime/democracy/Cargo.toml +++ /dev/null @@ -1,37 +0,0 @@ -[package] -name = "substrate-runtime-democracy" -version = "0.1.0" -authors = ["Parity Technologies "] - -[dependencies] -hex-literal = "0.1.0" -serde = { version = "1.0", default_features = false } -serde_derive = { version = "1.0", optional = true } -safe-mix = { version = "1.0", default_features = false} -substrate-codec = { path = "../../codec", default_features = false } -substrate-codec-derive = { path = "../../codec/derive", default_features = false } -substrate-primitives = { path = "../../primitives", default_features = false } -substrate-runtime-std = { path = "../../runtime-std", default_features = false } -substrate-runtime-io = { path = "../../runtime-io", default_features = false } -substrate-runtime-support = { path = "../../runtime-support", default_features = false } -substrate-runtime-primitives = { path = "../primitives", default_features = false } -substrate-runtime-balances = { path = "../balances", default_features = false } -substrate-runtime-consensus = { path = "../consensus", default_features = false } -substrate-runtime-system = { path = "../system", default_features = false } - -[features] -default = ["std"] -std = [ - "serde/std", - "serde_derive", - "safe-mix/std", - "substrate-codec/std", - "substrate-primitives/std", - "substrate-runtime-std/std", - "substrate-runtime-io/std", - "substrate-runtime-support/std", - "substrate-runtime-primitives/std", - "substrate-runtime-consensus/std", - "substrate-runtime-balances/std", - "substrate-runtime-system/std", -] diff --git a/substrate/runtime/example/Cargo.toml b/substrate/runtime/example/Cargo.toml deleted file mode 100644 index 92c0d887e7f3a..0000000000000 --- a/substrate/runtime/example/Cargo.toml +++ /dev/null @@ -1,34 +0,0 @@ -[package] -name = "substrate-runtime-example" -version = "0.1.0" -authors = ["Parity Technologies "] - -[dependencies] -hex-literal = "0.1.0" -serde = { version = "1.0", default_features = false } -serde_derive = { version = "1.0", optional = true } -substrate-runtime-std = { path = "../../runtime-std", default_features = false } -substrate-runtime-io = { path = "../../runtime-io", default_features = false } -substrate-runtime-support = { path = "../../runtime-support", default_features = false } -substrate-runtime-primitives = { path = "../primitives", default_features = false } -substrate-codec = { path = "../../codec", default_features = false } -substrate-codec-derive = { path = "../../codec/derive", default_features = false } -substrate-primitives = { path = "../../primitives", default_features = false } -substrate-runtime-system = { path = "../system", default_features = false } -substrate-runtime-balances = { path = "../balances", default_features = false } - -[features] -default = ["std"] -std = [ - "substrate-runtime-std/std", - "substrate-runtime-io/std", - "substrate-runtime-support/std", - "substrate-runtime-primitives/std", - "substrate-runtime-balances/std", - "serde/std", - "serde_derive", - "substrate-codec/std", - "substrate-codec-derive/std", - "substrate-primitives/std", - "substrate-runtime-system/std", -] diff --git a/substrate/runtime/executive/Cargo.toml b/substrate/runtime/executive/Cargo.toml deleted file mode 100644 index 965bbe2a1e2c1..0000000000000 --- a/substrate/runtime/executive/Cargo.toml +++ /dev/null @@ -1,33 +0,0 @@ -[package] -name = "substrate-runtime-executive" -version = "0.1.0" -authors = ["Parity Technologies "] - -[dependencies] -hex-literal = "0.1.0" -serde = { version = "1.0", default_features = false } -serde_derive = { version = "1.0", optional = true } -substrate-codec = { path = "../../codec", default_features = false } -substrate-runtime-std = { path = "../../runtime-std", default_features = false } -substrate-runtime-io = { path = "../../runtime-io", default_features = false } -substrate-runtime-support = { path = "../../runtime-support", default_features = false } -substrate-runtime-primitives = { path = "../primitives", default_features = false } -substrate-runtime-system = { path = "../system", default_features = false } - -[dev-dependencies] -substrate-primitives = { path = "../../primitives" } -substrate-runtime-balances = { path = "../balances" } -substrate-codec-derive = { path = "../../codec/derive" } - -[features] -default = ["std"] -std = [ - "substrate-runtime-std/std", - "substrate-runtime-support/std", - "serde/std", - "serde_derive", - "substrate-codec/std", - "substrate-runtime-primitives/std", - "substrate-runtime-io/std", - "substrate-runtime-system/std", -] diff --git a/substrate/runtime/primitives/Cargo.toml b/substrate/runtime/primitives/Cargo.toml deleted file mode 100644 index e7adc094d6789..0000000000000 --- a/substrate/runtime/primitives/Cargo.toml +++ /dev/null @@ -1,34 +0,0 @@ -[package] -name = "substrate-runtime-primitives" -version = "0.1.0" -authors = ["Parity Technologies "] - -[dependencies] -num-traits = { version = "0.2", default_features = false } -integer-sqrt = { git = "https://github.com/paritytech/integer-sqrt-rs.git", branch = "master" } -serde = { version = "1.0", optional = true } -serde_derive = { version = "1.0", optional = true } -substrate-codec = { path = "../../codec", default_features = false } -substrate-codec-derive = { path = "../../codec/derive", default_features = false } -substrate-primitives = { path = "../../primitives", default_features = false } -substrate-runtime-std = { path = "../../runtime-std", default_features = false } -substrate-runtime-io = { path = "../../runtime-io", default_features = false } -substrate-runtime-support = { path = "../../runtime-support", default_features = false } -log = {version = "0.3", optional = true } - -[dev-dependencies] -serde_json = "1.0" - -[features] -default = ["std"] -std = [ - "num-traits/std", - "serde", - "serde_derive", - "log", - "substrate-runtime-std/std", - "substrate-runtime-io/std", - "substrate-runtime-support/std", - "substrate-codec/std", - "substrate-primitives/std", -] diff --git a/substrate/runtime/session/Cargo.toml b/substrate/runtime/session/Cargo.toml deleted file mode 100644 index c2acfc1de2638..0000000000000 --- a/substrate/runtime/session/Cargo.toml +++ /dev/null @@ -1,40 +0,0 @@ -[package] -name = "substrate-runtime-session" -version = "0.1.0" -authors = ["Parity Technologies "] - -[dependencies] -hex-literal = "0.1.0" -serde = { version = "1.0", default_features = false } -serde_derive = { version = "1.0", optional = true } -safe-mix = { version = "1.0", default_features = false} -substrate-keyring = { path = "../../keyring", optional = true } -substrate-codec = { path = "../../codec", default_features = false } -substrate-codec-derive = { path = "../../codec/derive", default_features = false } -substrate-primitives = { path = "../../primitives", default_features = false } -substrate-runtime-std = { path = "../../runtime-std", default_features = false } -substrate-runtime-io = { path = "../../runtime-io", default_features = false } -substrate-runtime-support = { path = "../../runtime-support", default_features = false } -substrate-runtime-primitives = { path = "../primitives", default_features = false } -substrate-runtime-consensus = { path = "../consensus", default_features = false } -substrate-runtime-system = { path = "../system", default_features = false } -substrate-runtime-timestamp = { path = "../timestamp", default_features = false } - -[features] -default = ["std"] -std = [ - "serde/std", - "serde_derive", - "safe-mix/std", - "substrate-keyring", - "substrate-codec/std", - "substrate-codec-derive/std", - "substrate-primitives/std", - "substrate-runtime-std/std", - "substrate-runtime-io/std", - "substrate-runtime-support/std", - "substrate-runtime-primitives/std", - "substrate-runtime-consensus/std", - "substrate-runtime-system/std", - "substrate-runtime-timestamp/std" -] diff --git a/substrate/runtime/staking/Cargo.toml b/substrate/runtime/staking/Cargo.toml deleted file mode 100644 index 78ea8b2958e95..0000000000000 --- a/substrate/runtime/staking/Cargo.toml +++ /dev/null @@ -1,45 +0,0 @@ -[package] -name = "substrate-runtime-staking" -version = "0.1.0" -authors = ["Parity Technologies "] - -[dependencies] -hex-literal = "0.1.0" -serde = { version = "1.0", default_features = false } -serde_derive = { version = "1.0", optional = true } -safe-mix = { version = "1.0", default_features = false} -substrate-keyring = { path = "../../keyring", optional = true } -substrate-codec = { path = "../../codec", default_features = false } -substrate-codec-derive = { path = "../../codec/derive", default_features = false } -substrate-primitives = { path = "../../primitives", default_features = false } -substrate-runtime-std = { path = "../../runtime-std", default_features = false } -substrate-runtime-io = { path = "../../runtime-io", default_features = false } -substrate-runtime-sandbox = { path = "../../runtime-sandbox", default_features = false } -substrate-runtime-support = { path = "../../runtime-support", default_features = false } -substrate-runtime-primitives = { path = "../primitives", default_features = false } -substrate-runtime-balances = { path = "../balances", default_features = false } -substrate-runtime-consensus = { path = "../consensus", default_features = false } -substrate-runtime-system = { path = "../system", default_features = false } -substrate-runtime-session = { path = "../session", default_features = false } -substrate-runtime-timestamp = { path = "../timestamp", default_features = false } - -[features] -default = ["std"] -std = [ - "serde/std", - "serde_derive", - "safe-mix/std", - "substrate-keyring", - "substrate-codec/std", - "substrate-codec-derive/std", - "substrate-primitives/std", - "substrate-runtime-std/std", - "substrate-runtime-io/std", - "substrate-runtime-sandbox/std", - "substrate-runtime-support/std", - "substrate-runtime-primitives/std", - "substrate-runtime-balances/std", - "substrate-runtime-session/std", - "substrate-runtime-system/std", - "substrate-runtime-timestamp/std" -] diff --git a/substrate/runtime/system/Cargo.toml b/substrate/runtime/system/Cargo.toml deleted file mode 100644 index 28388bd5390f9..0000000000000 --- a/substrate/runtime/system/Cargo.toml +++ /dev/null @@ -1,32 +0,0 @@ -[package] -name = "substrate-runtime-system" -version = "0.1.0" -authors = ["Parity Technologies "] - -[dependencies] -hex-literal = "0.1.0" -serde = { version = "1.0", default_features = false } -serde_derive = { version = "1.0", optional = true } -safe-mix = { version = "1.0", default_features = false} -substrate-codec = { path = "../../codec", default_features = false } -substrate-codec-derive = { path = "../../codec/derive", default_features = false } -substrate-primitives = { path = "../../primitives", default_features = false } -substrate-runtime-std = { path = "../../runtime-std", default_features = false } -substrate-runtime-io = { path = "../../runtime-io", default_features = false } -substrate-runtime-support = { path = "../../runtime-support", default_features = false } -substrate-runtime-primitives = { path = "../primitives", default_features = false } - -[features] -default = ["std"] -std = [ - "serde/std", - "serde_derive", - "safe-mix/std", - "substrate-codec/std", - "substrate-codec-derive/std", - "substrate-primitives/std", - "substrate-runtime-std/std", - "substrate-runtime-io/std", - "substrate-runtime-support/std", - "substrate-runtime-primitives/std", -] diff --git a/substrate/runtime/timestamp/Cargo.toml b/substrate/runtime/timestamp/Cargo.toml deleted file mode 100644 index c87da900bfe19..0000000000000 --- a/substrate/runtime/timestamp/Cargo.toml +++ /dev/null @@ -1,35 +0,0 @@ -[package] -name = "substrate-runtime-timestamp" -version = "0.1.0" -authors = ["Parity Technologies "] - -[dependencies] -hex-literal = "0.1.0" -serde = { version = "1.0", default_features = false } -serde_derive = { version = "1.0", optional = true } -substrate-runtime-std = { path = "../../runtime-std", default_features = false } -substrate-runtime-io = { path = "../../runtime-io", default_features = false } -substrate-runtime-support = { path = "../../runtime-support", default_features = false } -substrate-runtime-primitives = { path = "../primitives", default_features = false } -substrate-codec = { path = "../../codec", default_features = false } -substrate-primitives = { path = "../../primitives", default_features = false } -substrate-runtime-system = { path = "../system", default_features = false } -substrate-runtime-consensus = { path = "../consensus", default_features = false } - -[dev-dependencies] -substrate-runtime-io = { path = "../../runtime-io", default_features = true } - -[features] -default = ["std"] -std = [ - "substrate-runtime-std/std", - "substrate-runtime-io/std", - "substrate-runtime-support/std", - "substrate-runtime-primitives/std", - "substrate-runtime-consensus/std", - "serde/std", - "serde_derive", - "substrate-codec/std", - "substrate-primitives/std", - "substrate-runtime-system/std", -] diff --git a/substrate/runtime/treasury/Cargo.toml b/substrate/runtime/treasury/Cargo.toml deleted file mode 100644 index 0c76961434c2c..0000000000000 --- a/substrate/runtime/treasury/Cargo.toml +++ /dev/null @@ -1,34 +0,0 @@ -[package] -name = "substrate-runtime-treasury" -version = "0.1.0" -authors = ["Parity Technologies "] - -[dependencies] -hex-literal = "0.1.0" -serde = { version = "1.0", default_features = false } -serde_derive = { version = "1.0", optional = true } -substrate-runtime-std = { path = "../../runtime-std", default_features = false } -substrate-runtime-io = { path = "../../runtime-io", default_features = false } -substrate-runtime-support = { path = "../../runtime-support", default_features = false } -substrate-runtime-primitives = { path = "../primitives", default_features = false } -substrate-codec = { path = "../../codec", default_features = false } -substrate-codec-derive = { path = "../../codec/derive", default_features = false } -substrate-primitives = { path = "../../primitives", default_features = false } -substrate-runtime-system = { path = "../system", default_features = false } -substrate-runtime-balances = { path = "../balances", default_features = false } - -[features] -default = ["std"] -std = [ - "substrate-runtime-std/std", - "substrate-runtime-io/std", - "substrate-runtime-support/std", - "substrate-runtime-primitives/std", - "substrate-runtime-balances/std", - "serde/std", - "serde_derive", - "substrate-codec/std", - "substrate-codec-derive/std", - "substrate-primitives/std", - "substrate-runtime-system/std", -] diff --git a/substrate/runtime/version/Cargo.toml b/substrate/runtime/version/Cargo.toml deleted file mode 100644 index 2f471fe6ed085..0000000000000 --- a/substrate/runtime/version/Cargo.toml +++ /dev/null @@ -1,22 +0,0 @@ -[package] -name = "substrate-runtime-version" -version = "0.1.0" -authors = ["Parity Technologies "] - -[dependencies] -serde = { version = "1.0", default_features = false } -serde_derive = { version = "1.0", optional = true } -substrate-codec = { path = "../../codec", default_features = false } -substrate-codec-derive = { path = "../../codec/derive", default_features = false } -substrate-runtime-std = { path = "../../runtime-std", default_features = false } -substrate-runtime-support = { path = "../../runtime-support", default_features = false } - -[features] -default = ["std"] -std = [ - "serde/std", - "serde_derive", - "substrate-codec/std", - "substrate-runtime-std/std", - "substrate-runtime-support/std", -] diff --git a/substrate/service/Cargo.toml b/substrate/service/Cargo.toml deleted file mode 100644 index a7e1d65c88425..0000000000000 --- a/substrate/service/Cargo.toml +++ /dev/null @@ -1,31 +0,0 @@ -[package] -name = "substrate-service" -version = "0.3.0" -authors = ["Parity Technologies "] - -[dependencies] -futures = "0.1.17" -parking_lot = "0.4" -error-chain = "0.12" -lazy_static = "1.0" -log = "0.3" -slog = "^2" -tokio = "0.1.7" -exit-future = "0.1" -serde = "1.0" -serde_json = "1.0" -serde_derive = "1.0" -target_info = "0.1" -substrate-keystore = { path = "../../substrate/keystore" } -substrate-runtime-io = { path = "../../substrate/runtime-io" } -substrate-runtime-primitives = { path = "../../substrate/runtime/primitives" } -substrate-primitives = { path = "../../substrate/primitives" } -substrate-network = { path = "../../substrate/network" } -substrate-client = { path = "../../substrate/client" } -substrate-client-db = { path = "../../substrate/client/db" } -substrate-codec = { path = "../../substrate/codec" } -substrate-executor = { path = "../../substrate/executor" } -substrate-extrinsic-pool = { path = "../../substrate/extrinsic-pool" } -substrate-rpc = { path = "../../substrate/rpc" } -substrate-rpc-servers = { path = "../../substrate/rpc-servers" } -substrate-telemetry = { path = "../../substrate/telemetry" } diff --git a/substrate/test-runtime/Cargo.toml b/substrate/test-runtime/Cargo.toml deleted file mode 100644 index 5482936f05733..0000000000000 --- a/substrate/test-runtime/Cargo.toml +++ /dev/null @@ -1,38 +0,0 @@ -[package] -name = "substrate-test-runtime" -version = "0.1.0" -authors = ["Parity Technologies "] - -[dependencies] -log = { version = "0.3", optional = true } -hex-literal = { version = "0.1.0", optional = true } -ed25519 = { path = "../ed25519", optional = true } -serde = { version = "1.0", optional = true } -serde_derive = { version = "1.0", optional = true } -substrate-keyring = { path = "../keyring", optional = true } -substrate-codec = { path = "../codec", default-features = false } -substrate-codec-derive = { path = "../codec/derive", default-features = false } -substrate-runtime-std = { path = "../runtime-std", default-features = false } -substrate-runtime-io = { path = "../runtime-io", default-features = false } -substrate-runtime-support = { path = "../runtime-support", default-features = false } -substrate-primitives = { path = "../primitives", default-features = false } -substrate-runtime-primitives = { path = "../runtime/primitives", default-features = false } -substrate-runtime-version = { path = "../runtime/version", default-features = false } - -[features] -default = ["std"] -std = [ - "log", - "hex-literal", - "ed25519", - "serde", - "serde_derive", - "substrate-keyring", - "substrate-codec/std", - "substrate-runtime-std/std", - "substrate-runtime-io/std", - "substrate-runtime-support/std", - "substrate-primitives/std", - "substrate-runtime-primitives/std", - "substrate-runtime-version/std" -] diff --git a/substrate/test-runtime/wasm/Cargo.toml b/substrate/test-runtime/wasm/Cargo.toml deleted file mode 100644 index 599733e271c17..0000000000000 --- a/substrate/test-runtime/wasm/Cargo.toml +++ /dev/null @@ -1,42 +0,0 @@ -[package] -name = "substrate-test-runtime" -version = "0.1.0" -authors = ["Parity Technologies "] - -[dependencies] -log = { version = "0.3", optional = true } -hex-literal = { version = "0.1.0", optional = true } -ed25519 = { path = "../../ed25519", optional = true } -substrate-codec = { path = "../../codec", default-features = false } -substrate-codec-derive = { path = "../../codec/derive", default-features = false } -substrate-runtime-std = { path = "../../runtime-std", default-features = false } -substrate-runtime-io = { path = "../../runtime-io", default-features = false } -substrate-runtime-support = { path = "../../runtime-support", default-features = false } -substrate-runtime-version = { path = "../../runtime/version", default-features = false } -substrate-primitives = { path = "../../primitives", default-features = false } -substrate-runtime-primitives = { path = "../../runtime/primitives", default-features = false } - -[features] -default = [] -std = [ - "log", - "hex-literal", - "ed25519", - "substrate-codec/std", - "substrate-runtime-std/std", - "substrate-runtime-io/std", - "substrate-runtime-support/std", - "substrate-runtime-version/std", - "substrate-primitives/std", - "substrate-runtime-primitives/std" -] - -[lib] -crate-type = ["cdylib"] - -[profile.release] -panic = "abort" -lto = true - -[workspace] -members = [] diff --git a/substrate/test-runtime/wasm/target/wasm32-unknown-unknown/release/substrate_test_runtime.compact.wasm b/substrate/test-runtime/wasm/target/wasm32-unknown-unknown/release/substrate_test_runtime.compact.wasm deleted file mode 100644 index dc0c4e46cea88..0000000000000 Binary files a/substrate/test-runtime/wasm/target/wasm32-unknown-unknown/release/substrate_test_runtime.compact.wasm and /dev/null differ diff --git a/substrate/test-runtime/wasm/target/wasm32-unknown-unknown/release/substrate_test_runtime.wasm b/substrate/test-runtime/wasm/target/wasm32-unknown-unknown/release/substrate_test_runtime.wasm deleted file mode 100755 index 5b61818cf57b2..0000000000000 Binary files a/substrate/test-runtime/wasm/target/wasm32-unknown-unknown/release/substrate_test_runtime.wasm and /dev/null differ