diff --git a/.gitignore b/.gitignore index 2e0651ba435d1..8058ae508f8eb 100644 --- a/.gitignore +++ b/.gitignore @@ -9,7 +9,7 @@ substrate/pwasm-alloc/target/ substrate/pwasm-libc/target/ substrate/pwasm-alloc/Cargo.lock substrate/pwasm-libc/Cargo.lock -demo/runtime/wasm/target/ +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/Cargo.lock b/Cargo.lock index 14ab7f229bb92..622086c6beeee 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,185 @@ 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", + "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 = "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", + "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 = "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 = [ + "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 = "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", + "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 = "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)", + "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 = "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", + "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 = "nodrop" version = "0.1.12" @@ -2418,7 +2402,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "subkey" 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", ] @@ -2428,9 +2411,9 @@ 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,7 +2421,6 @@ 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)", @@ -2488,7 +2470,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)", @@ -2559,7 +2540,6 @@ 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)", @@ -2601,16 +2581,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)", @@ -2641,7 +2620,6 @@ 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)", @@ -2692,6 +2670,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,9 +2678,11 @@ 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)", "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)", @@ -2712,6 +2693,7 @@ dependencies = [ "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)", ] @@ -2894,7 +2876,6 @@ dependencies = [ 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)", @@ -2996,7 +2977,6 @@ dependencies = [ 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)", @@ -3177,7 +3157,6 @@ 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)", "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/Cargo.toml b/Cargo.toml index a0550303dcccd..a833d41030b6c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,63 +1,63 @@ [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", + "core/bft", + "core/cli", + "core/client", + "core/client/db", + "core/codec", + "core/codec/derive", + "core/environmental", + "core/executor", + "core/extrinsic-pool", + "core/keyring", + "core/misbehavior-check", + "core/network", + "core/primitives", + "core/rpc", + "core/rpc-servers", + "core/runtime-io", + "core/runtime-sandbox", + "core/runtime-std", + "core/serializer", + "core/service", + "core/state-db", + "core/state-machine", + "core/test-runtime", + "core/telemetry", + "core/keystore", + "runtime/support", + "runtime/primitives", + "runtime/version", + "runtime/balances", + "runtime/consensus", + "runtime/contract", + "runtime/council", + "runtime/democracy", + "runtime/example", + "runtime/executive", + "runtime/session", + "runtime/staking", + "runtime/system", + "runtime/timestamp", + "runtime/treasury", + "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", + "core/pwasm-alloc", + "core/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/bft/Cargo.toml b/core/bft/Cargo.toml similarity index 66% rename from substrate/bft/Cargo.toml rename to core/bft/Cargo.toml index f15f24a0d5bd8..609a27088b4de 100644 --- a/substrate/bft/Cargo.toml +++ b/core/bft/Cargo.toml @@ -7,10 +7,10 @@ authors = ["Parity Technologies "] futures = "0.1.17" substrate-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" } +substrate-runtime-support = { path = "../../runtime/support" } +substrate-runtime-primitives = { path = "../../runtime/primitives" } +substrate-runtime-version = { path = "../../runtime/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..e6f2615f0fd53 100644 --- a/substrate/bft/src/lib.rs +++ b/core/bft/src/lib.rs @@ -41,7 +41,6 @@ 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 tokio; extern crate parking_lot; extern crate rhododendron; @@ -59,11 +58,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 +314,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..ef24f7cf2b442 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 = "../client" } +substrate-network = { path = "../network" } +substrate-network-libp2p = { path = "../network-libp2p" } +substrate-runtime-primitives = { path = "../../runtime/primitives" } +substrate-service = { path = "../service" } +substrate-telemetry = { path = "../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 100% rename from substrate/cli/src/lib.rs rename to core/cli/src/lib.rs 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 76% rename from substrate/client/Cargo.toml rename to core/client/Cargo.toml index 5512b0d65832a..886410f74eebd 100644 --- a/substrate/client/Cargo.toml +++ b/core/client/Cargo.toml @@ -11,7 +11,7 @@ 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" } @@ -19,10 +19,10 @@ substrate-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" } +substrate-runtime-support = { path = "../../runtime/support" } +substrate-runtime-primitives = { path = "../../runtime/primitives" } substrate-state-machine = { path = "../state-machine" } -substrate-keyring = { path = "../../substrate/keyring" } +substrate-keyring = { path = "../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..b0a6071d210fc --- /dev/null +++ b/core/client/db/Cargo.toml @@ -0,0 +1,24 @@ +[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 = "../../primitives" } +substrate-client = { path = "../../client" } +substrate-state-machine = { path = "../../state-machine" } +substrate-codec = { path = "../../codec" } +substrate-codec-derive = { path = "../../codec/derive" } +substrate-executor = { path = "../../executor" } +substrate-state-db = { path = "../../state-db" } +substrate-runtime-support = { path = "../../../runtime/support" } +substrate-runtime-primitives = { path = "../../../runtime/primitives" } + +[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 100% rename from substrate/client/db/src/lib.rs rename to core/client/db/src/lib.rs 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 100% rename from substrate/client/src/client.rs rename to core/client/src/client.rs 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/core/client/src/genesis.rs b/core/client/src/genesis.rs new file mode 100644 index 0000000000000..9c7810aedca3d --- /dev/null +++ b/core/client/src/genesis.rs @@ -0,0 +1,202 @@ +// 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 . + +//! Tool for creating the genesis block. + +use runtime_primitives::traits::{Block as BlockT, Header as HeaderT, Hash as HashT, Zero}; +use runtime_primitives::StorageMap; + +/// Create a genesis block, given the initial storage. +pub fn construct_genesis_block< + Block: BlockT +> ( + storage: &StorageMap +) -> Block { + let state_root = <<::Header as HeaderT>::Hashing as HashT>::trie_root(storage.clone().into_iter()); + let extrinsics_root = <<::Header as HeaderT>::Hashing as HashT>::trie_root(::std::iter::empty::<(&[u8], &[u8])>()); + Block::new( + <::Header as HeaderT>::new( + Zero::zero(), + extrinsics_root, + state_root, + Default::default(), + Default::default() + ), + Default::default() + ) +} + +#[cfg(test)] +mod tests { + use super::*; + use codec::{Encode, Decode, Joiner}; + use keyring::Keyring; + use executor::NativeExecutionDispatch; + use state_machine::{execute, OverlayedChanges, ExecutionStrategy}; + use state_machine::backend::InMemory; + 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 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")); + + fn executor() -> ::executor::NativeExecutor { + NativeExecutionDispatch::new() + } + + fn construct_block(backend: &InMemory, number: BlockNumber, parent_hash: Hash, state_root: Hash, txs: Vec) -> (Vec, Hash) { + use triehash::ordered_trie_root; + + let transactions = txs.into_iter().map(|tx| { + let signature = Pair::from(Keyring::from_public(Public::from_raw(tx.from.0)).unwrap()) + .sign(&tx.encode()).into(); + + Extrinsic { transfer: tx, signature } + }).collect::>(); + + let extrinsics_root = ordered_trie_root::(transactions.iter().map(Encode::encode)).into(); + + println!("root before: {:?}", extrinsics_root); + let mut header = Header { + parent_hash, + number, + state_root, + extrinsics_root, + digest: Digest { logs: vec![], }, + }; + let hash = header.hash(); + let mut overlay = OverlayedChanges::default(); + + execute( + backend, + &mut overlay, + &executor(), + "initialise_block", + &header.encode(), + ExecutionStrategy::NativeWhenPossible, + ).unwrap(); + + for tx in transactions.iter() { + execute( + backend, + &mut overlay, + &executor(), + "apply_extrinsic", + &tx.encode(), + ExecutionStrategy::NativeWhenPossible, + ).unwrap(); + } + + let (ret_data, _) = execute( + backend, + &mut overlay, + &executor(), + "finalise_block", + &[], + ExecutionStrategy::NativeWhenPossible, + ).unwrap(); + header = Header::decode(&mut &ret_data[..]).unwrap(); + println!("root after: {:?}", header.extrinsics_root); + + (vec![].and(&Block { header, extrinsics: transactions }), hash) + } + + fn block1(genesis_hash: Hash, backend: &InMemory) -> (Vec, Hash) { + construct_block( + backend, + 1, + genesis_hash, + hex!("25e5b37074063ab75c889326246640729b40d0c86932edc527bc80db0e04fe5c").into(), + vec![Transfer { + from: Keyring::One.to_raw_public().into(), + to: Keyring::Two.to_raw_public().into(), + amount: 69, + nonce: 0, + }] + ) + } + + #[test] + fn construct_genesis_should_work_with_native() { + let mut storage = GenesisConfig::new_simple( + vec![Keyring::One.to_raw_public().into(), Keyring::Two.to_raw_public().into()], 1000 + ).genesis_map(); + let block = construct_genesis_block::(&storage); + let genesis_hash = block.header.hash(); + storage.extend(additional_storage_with_genesis(&block).into_iter()); + + let backend = InMemory::from(storage); + let (b1data, _b1hash) = block1(genesis_hash, &backend); + + let mut overlay = OverlayedChanges::default(); + let _ = execute( + &backend, + &mut overlay, + &executor(), + "execute_block", + &b1data, + ExecutionStrategy::NativeWhenPossible, + ).unwrap(); + } + + #[test] + fn construct_genesis_should_work_with_wasm() { + let mut storage = GenesisConfig::new_simple( + vec![Keyring::One.to_raw_public().into(), Keyring::Two.to_raw_public().into()], 1000 + ).genesis_map(); + let block = construct_genesis_block::(&storage); + let genesis_hash = block.header.hash(); + storage.extend(additional_storage_with_genesis(&block).into_iter()); + + let backend = InMemory::from(storage); + let (b1data, _b1hash) = block1(genesis_hash, &backend); + + let mut overlay = OverlayedChanges::default(); + let _ = execute( + &backend, + &mut overlay, + &executor(), + "execute_block", + &b1data, + ExecutionStrategy::AlwaysWasm, + ).unwrap(); + } + + #[test] + #[should_panic] + fn construct_genesis_with_bad_transaction_should_panic() { + let mut storage = GenesisConfig::new_simple( + vec![Keyring::One.to_raw_public().into(), Keyring::Two.to_raw_public().into()], 68 + ).genesis_map(); + let block = construct_genesis_block::(&storage); + let genesis_hash = block.header.hash(); + storage.extend(additional_storage_with_genesis(&block).into_iter()); + + let backend = InMemory::from(storage); + let (b1data, _b1hash) = block1(genesis_hash, &backend); + + let mut overlay = OverlayedChanges::default(); + let _ = execute( + &backend, + &mut overlay, + &Executor::new(), + "execute_block", + &b1data, + ExecutionStrategy::NativeWhenPossible, + ).unwrap(); + } +} 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 99% rename from substrate/client/src/lib.rs rename to core/client/src/lib.rs index 127aafe848bfb..fd30eaae72e32 100644 --- a/substrate/client/src/lib.rs +++ b/core/client/src/lib.rs @@ -31,7 +31,6 @@ extern crate substrate_state_machine as state_machine; #[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/codec/Cargo.toml b/core/codec/Cargo.toml similarity index 100% rename from substrate/codec/Cargo.toml rename to core/codec/Cargo.toml diff --git a/substrate/codec/README.adoc b/core/codec/README.adoc similarity index 100% rename from substrate/codec/README.adoc rename to core/codec/README.adoc diff --git a/substrate/codec/derive/Cargo.toml b/core/codec/derive/Cargo.toml similarity index 100% rename from substrate/codec/derive/Cargo.toml rename to core/codec/derive/Cargo.toml diff --git a/substrate/codec/derive/src/decode.rs b/core/codec/derive/src/decode.rs similarity index 100% rename from substrate/codec/derive/src/decode.rs rename to core/codec/derive/src/decode.rs diff --git a/substrate/codec/derive/src/encode.rs b/core/codec/derive/src/encode.rs similarity index 100% rename from substrate/codec/derive/src/encode.rs rename to core/codec/derive/src/encode.rs diff --git a/substrate/codec/derive/src/lib.rs b/core/codec/derive/src/lib.rs similarity index 100% rename from substrate/codec/derive/src/lib.rs rename to core/codec/derive/src/lib.rs diff --git a/substrate/codec/derive/tests/mod.rs b/core/codec/derive/tests/mod.rs similarity index 100% rename from substrate/codec/derive/tests/mod.rs rename to core/codec/derive/tests/mod.rs diff --git a/substrate/codec/src/codec.rs b/core/codec/src/codec.rs similarity index 100% rename from substrate/codec/src/codec.rs rename to core/codec/src/codec.rs diff --git a/substrate/codec/src/joiner.rs b/core/codec/src/joiner.rs similarity index 100% rename from substrate/codec/src/joiner.rs rename to core/codec/src/joiner.rs diff --git a/substrate/codec/src/keyedvec.rs b/core/codec/src/keyedvec.rs similarity index 100% rename from substrate/codec/src/keyedvec.rs rename to core/codec/src/keyedvec.rs diff --git a/substrate/codec/src/lib.rs b/core/codec/src/lib.rs similarity index 100% rename from substrate/codec/src/lib.rs rename to core/codec/src/lib.rs diff --git a/substrate/environmental/Cargo.toml b/core/environmental/Cargo.toml similarity index 100% rename from substrate/environmental/Cargo.toml rename to core/environmental/Cargo.toml diff --git a/substrate/environmental/README.adoc b/core/environmental/README.adoc similarity index 100% rename from substrate/environmental/README.adoc rename to core/environmental/README.adoc diff --git a/substrate/environmental/src/lib.rs b/core/environmental/src/lib.rs similarity index 100% rename from substrate/environmental/src/lib.rs rename to core/environmental/src/lib.rs diff --git a/substrate/environmental/with_std.rs b/core/environmental/with_std.rs similarity index 100% rename from substrate/environmental/with_std.rs rename to core/environmental/with_std.rs diff --git a/substrate/environmental/without_std.rs b/core/environmental/without_std.rs similarity index 100% rename from substrate/environmental/without_std.rs rename to core/environmental/without_std.rs diff --git a/substrate/executor/Cargo.toml b/core/executor/Cargo.toml similarity index 87% rename from substrate/executor/Cargo.toml rename to core/executor/Cargo.toml index 0c4e658740517..4c30827dc1b7b 100644 --- a/substrate/executor/Cargo.toml +++ b/core/executor/Cargo.toml @@ -10,8 +10,8 @@ substrate-runtime-io = { path = "../runtime-io" } substrate-primitives = { path = "../primitives" } substrate-serializer = { path = "../serializer" } substrate-state-machine = { path = "../state-machine" } -substrate-runtime-version = { path = "../runtime/version" } -ed25519 = { path = "../ed25519" } +substrate-runtime-version = { path = "../../runtime/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 99% rename from substrate/executor/src/lib.rs rename to core/executor/src/lib.rs index 7898411be47d4..7b9779a9b6467 100644 --- a/substrate/executor/src/lib.rs +++ b/core/executor/src/lib.rs @@ -36,7 +36,6 @@ 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 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 99% rename from substrate/executor/src/wasm_executor.rs rename to core/executor/src/wasm_executor.rs index 50488ac285087..18280c797df65 100644 --- a/substrate/executor/src/wasm_executor.rs +++ b/core/executor/src/wasm_executor.rs @@ -27,10 +27,8 @@ 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::hexdisplay::HexDisplay; +use primitives::{blake2_256, twox_128, twox_256, ed25519, Blake2Hasher, hexdisplay::HexDisplay}; use primitives::sandbox as sandbox_primitives; -use primitives::Blake2Hasher; use triehash::ordered_trie_root; use sandbox; @@ -359,7 +357,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 @@ -684,7 +682,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 100% rename from substrate/executor/wasm/Cargo.lock rename to core/executor/wasm/Cargo.lock diff --git a/substrate/executor/wasm/Cargo.toml b/core/executor/wasm/Cargo.toml similarity index 100% rename from substrate/executor/wasm/Cargo.toml rename to core/executor/wasm/Cargo.toml 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 100% rename from substrate/executor/wasm/src/lib.rs rename to core/executor/wasm/src/lib.rs 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..8fc4f49186556 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" } +substrate-runtime-primitives = { path = "../../runtime/primitives" } [dev-dependencies] -substrate-test-client = { path = "../../substrate/test-client" } -substrate-keyring = { path = "../../substrate/keyring" } -substrate-codec = { path = "../../substrate/codec" } +substrate-test-client = { path = "../test-client" } +substrate-keyring = { path = "../keyring" } +substrate-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 100% rename from substrate/extrinsic-pool/src/lib.rs rename to core/extrinsic-pool/src/lib.rs 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..321ea6c04cf89 100644 --- a/substrate/keyring/src/lib.rs +++ b/core/keyring/src/lib.rs @@ -20,11 +20,11 @@ #[macro_use] extern crate hex_literal; #[macro_use] extern crate lazy_static; -pub extern crate ed25519; +pub extern crate substrate_primitives; use std::collections::HashMap; use std::ops::Deref; -use ed25519::{Pair, Public, Signature}; +use substrate_primitives::ed25519::{Pair, Public, Signature}; /// Set of test accounts. #[derive(Clone, Copy, PartialEq, Eq, Hash)] @@ -165,7 +165,7 @@ impl Deref for Keyring { #[cfg(test)] mod tests { use super::*; - use ed25519::Verifiable; + use substrate_primitives::ed25519::Verifiable; #[test] fn should_work() { 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..a464f7005d6fe 100644 --- a/substrate/keystore/Cargo.toml +++ b/core/keystore/Cargo.toml @@ -6,7 +6,7 @@ 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/substrate/misbehavior-check/Cargo.toml b/core/misbehavior-check/Cargo.toml similarity index 86% rename from substrate/misbehavior-check/Cargo.toml rename to core/misbehavior-check/Cargo.toml index aa726c18b18db..d455a4fc045ad 100644 --- a/substrate/misbehavior-check/Cargo.toml +++ b/core/misbehavior-check/Cargo.toml @@ -6,7 +6,7 @@ authors = ["Parity Technologies "] [dependencies] 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-primitives = { path = "../../runtime/primitives", default-features = false } substrate-runtime-io = { path = "../runtime-io", default-features = false } [dev-dependencies] 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 100% rename from substrate/misbehavior-check/src/lib.rs rename to core/misbehavior-check/src/lib.rs 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 100% rename from substrate/network-libp2p/src/custom_proto.rs rename to core/network-libp2p/src/custom_proto.rs 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 100% rename from substrate/network-libp2p/src/service.rs rename to core/network-libp2p/src/service.rs 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..fdd31aa7d02a0 --- /dev/null +++ b/core/network/Cargo.toml @@ -0,0 +1,30 @@ +[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 = "../primitives" } +substrate-client = { path = "../client" } +substrate-runtime-primitives = { path = "../../runtime/primitives" } +substrate-codec = { path = "../codec" } +substrate-codec-derive = { path = "../codec/derive" } +substrate-network-libp2p = { path = "../network-libp2p" } + +[dev-dependencies] +env_logger = "0.4" +substrate-keyring = { path = "../keyring" } +substrate-test-client = { path = "../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 99% rename from substrate/network/src/lib.rs rename to core/network/src/lib.rs index 14d3d82da5dbc..7f0817653eb59 100644 --- a/substrate/network/src/lib.rs +++ b/core/network/src/lib.rs @@ -31,7 +31,6 @@ extern crate substrate_runtime_primitives as runtime_primitives; extern crate substrate_network_libp2p as network_libp2p; extern crate substrate_codec as codec; extern crate futures; -extern crate ed25519; extern crate rustc_hex; #[macro_use] extern crate log; #[macro_use] extern crate bitflags; 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 86% rename from substrate/primitives/Cargo.toml rename to core/primitives/Cargo.toml index 206bb24c5626a..d14c3a172866a 100644 --- a/substrate/primitives/Cargo.toml +++ b/core/primitives/Cargo.toml @@ -21,8 +21,11 @@ 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 } - blake2-rfc = { version = "0.2.18", optional = true } +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 } [dev-dependencies] substrate-serializer = { path = "../serializer" } @@ -43,6 +46,10 @@ 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 96% rename from substrate/ed25519/src/lib.rs rename to core/primitives/src/ed25519.rs index a7f419f47842c..bc5b691d4d2b0 100644 --- a/substrate/ed25519/src/lib.rs +++ b/core/primitives/src/ed25519.rs @@ -18,14 +18,11 @@ //! 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; +use AuthorityId; use base58::{ToBase58, FromBase58}; #[cfg(test)] @@ -72,11 +69,16 @@ impl ::std::hash::Hash for Public { } } +/// Error with the SS58 encoding. #[derive(Clone, Copy, Eq, PartialEq, Debug)] pub enum PublicError { + /// Bad base-58 encoding. BadBase58, + /// Bad length of key. BadLength, + /// Unknown version identifier. UnknownVersion, + /// Checksum is invalid. InvalidChecksum, } @@ -189,7 +191,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 +263,7 @@ pub fn verify_strong>(sig: &Signature, message: &[u8], pubkey: } } +/// Something that can verify a message against a given public key. pub trait Verifiable { /// Verify something that acts like a signature. fn verify>(&self, message: &[u8], pubkey: P) -> bool; 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 94% rename from substrate/primitives/src/lib.rs rename to core/primitives/src/lib.rs index 5fddf350d811f..e61a96270416c 100644 --- a/substrate/primitives/src/lib.rs +++ b/core/primitives/src/lib.rs @@ -43,6 +43,12 @@ extern crate serde; #[cfg(feature = "std")] extern crate twox_hash; +#[cfg(feature = "std")] +extern crate ring; +#[cfg(feature = "std")] +extern crate base58; +#[cfg(feature = "std")] +extern crate untrusted; #[cfg(feature = "std")] extern crate blake2_rfc; @@ -91,6 +97,8 @@ 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; pub mod hash; 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/core/pwasm-alloc/Cargo.lock b/core/pwasm-alloc/Cargo.lock new file mode 100644 index 0000000000000..56aacd92e4237 --- /dev/null +++ b/core/pwasm-alloc/Cargo.lock @@ -0,0 +1,37 @@ +[[package]] +name = "pwasm-alloc" +version = "0.1.0" +dependencies = [ + "pwasm-libc 0.1.0", + "rustc_version 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "pwasm-libc" +version = "0.1.0" + +[[package]] +name = "rustc_version" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "semver" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "semver-parser" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[metadata] +"checksum rustc_version 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a54aa04a10c68c1c4eacb4337fd883b435997ede17a9385784b990777686b09a" +"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" +"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" diff --git a/substrate/pwasm-alloc/Cargo.toml b/core/pwasm-alloc/Cargo.toml similarity index 100% rename from substrate/pwasm-alloc/Cargo.toml rename to core/pwasm-alloc/Cargo.toml diff --git a/substrate/pwasm-alloc/README.adoc b/core/pwasm-alloc/README.adoc similarity index 100% rename from substrate/pwasm-alloc/README.adoc rename to core/pwasm-alloc/README.adoc diff --git a/substrate/pwasm-alloc/build.rs b/core/pwasm-alloc/build.rs similarity index 100% rename from substrate/pwasm-alloc/build.rs rename to core/pwasm-alloc/build.rs diff --git a/substrate/pwasm-alloc/src/lib.rs b/core/pwasm-alloc/src/lib.rs similarity index 100% rename from substrate/pwasm-alloc/src/lib.rs rename to core/pwasm-alloc/src/lib.rs diff --git a/core/pwasm-libc/Cargo.lock b/core/pwasm-libc/Cargo.lock new file mode 100644 index 0000000000000..6cc9d84c09255 --- /dev/null +++ b/core/pwasm-libc/Cargo.lock @@ -0,0 +1,4 @@ +[[package]] +name = "pwasm-libc" +version = "0.1.0" + diff --git a/substrate/pwasm-libc/Cargo.toml b/core/pwasm-libc/Cargo.toml similarity index 100% rename from substrate/pwasm-libc/Cargo.toml rename to core/pwasm-libc/Cargo.toml diff --git a/substrate/pwasm-libc/README.adoc b/core/pwasm-libc/README.adoc similarity index 100% rename from substrate/pwasm-libc/README.adoc rename to core/pwasm-libc/README.adoc diff --git a/substrate/pwasm-libc/src/lib.rs b/core/pwasm-libc/src/lib.rs similarity index 100% rename from substrate/pwasm-libc/src/lib.rs rename to core/pwasm-libc/src/lib.rs diff --git a/substrate/rpc-servers/Cargo.toml b/core/rpc-servers/Cargo.toml similarity index 87% rename from substrate/rpc-servers/Cargo.toml rename to core/rpc-servers/Cargo.toml index 6b7038d44a628..ffbd900357b9b 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" } +substrate-runtime-primitives = { path = "../../runtime/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 100% rename from substrate/rpc-servers/src/lib.rs rename to core/rpc-servers/src/lib.rs diff --git a/substrate/rpc/Cargo.toml b/core/rpc/Cargo.toml similarity index 86% rename from substrate/rpc/Cargo.toml rename to core/rpc/Cargo.toml index 423a0523b8b69..5460137dc75f0 100644 --- a/substrate/rpc/Cargo.toml +++ b/core/rpc/Cargo.toml @@ -15,8 +15,8 @@ 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" } +substrate-runtime-primitives = { path = "../../runtime/primitives" } +substrate-runtime-version = { path = "../../runtime/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 100% rename from substrate/rpc/src/lib.rs rename to core/rpc/src/lib.rs 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/runtime-io/Cargo.toml b/core/runtime-io/Cargo.toml similarity index 93% rename from substrate/runtime-io/Cargo.toml rename to core/runtime-io/Cargo.toml index cf8a01dcf8731..8bf3c3406f6f7 100644 --- a/substrate/runtime-io/Cargo.toml +++ b/core/runtime-io/Cargo.toml @@ -14,7 +14,6 @@ substrate-state-machine = { path = "../state-machine", optional = true } substrate-primitives = { path = "../primitives", default_features = false } substrate-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 } @@ -27,7 +26,6 @@ std = [ "substrate-primitives/std", "substrate-codec/std", "substrate-runtime-std/std", - "ed25519", "rlp" ] nightly = [] diff --git a/substrate/runtime-io/README.adoc b/core/runtime-io/README.adoc similarity index 100% rename from substrate/runtime-io/README.adoc rename to core/runtime-io/README.adoc diff --git a/substrate/runtime-io/build.rs b/core/runtime-io/build.rs similarity index 100% rename from substrate/runtime-io/build.rs rename to core/runtime-io/build.rs diff --git a/substrate/runtime-io/src/lib.rs b/core/runtime-io/src/lib.rs similarity index 100% rename from substrate/runtime-io/src/lib.rs rename to core/runtime-io/src/lib.rs diff --git a/core/runtime-io/with_std.rs b/core/runtime-io/with_std.rs new file mode 100644 index 0000000000000..3790f925bd4a2 --- /dev/null +++ b/core/runtime-io/with_std.rs @@ -0,0 +1,266 @@ +// 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 . + +#[macro_use] +extern crate environmental; + +#[cfg_attr(test, macro_use)] +extern crate substrate_primitives as primitives; + +extern crate substrate_state_machine; +extern crate triehash; +extern crate hashdb; +extern crate rlp; + +#[doc(hidden)] +pub extern crate substrate_codec as codec; +// re-export hashing functions. +pub use primitives::{blake2_256, twox_128, twox_256, ed25519}; + +pub use primitives::Blake2Hasher; +// Switch to this after PoC-3 +// pub use primitives::BlakeHasher; +pub use substrate_state_machine::{Externalities, TestExternalities}; +use primitives::hexdisplay::HexDisplay; +use primitives::H256; +use hashdb::Hasher; +use rlp::Encodable; + +// TODO: use the real error, not NoError. + +environmental!(ext: trait Externalities); + +/// Get `key` from storage and return a `Vec`, empty if there's a problem. +pub fn storage(key: &[u8]) -> Option> { + ext::with(|ext| ext.storage(key).map(|s| s.to_vec())) + .expect("storage cannot be called outside of an Externalities-provided environment.") +} + +/// Get `key` from storage, placing the value into `value_out` (as much of it as possible) and return +/// the number of bytes that the entry in storage had beyond the offset or None if the storage entry +/// doesn't exist at all. Note that if the buffer is smaller than the storage entry length, the returned +/// number of bytes is not equal to the number of bytes written to the `value_out`. +pub fn read_storage(key: &[u8], value_out: &mut [u8], value_offset: usize) -> Option { + ext::with(|ext| ext.storage(key).map(|value| { + let value = &value[value_offset..]; + let written = ::std::cmp::min(value.len(), value_out.len()); + value_out[0..written].copy_from_slice(&value[0..written]); + value.len() + })).expect("read_storage cannot be called outside of an Externalities-provided environment.") +} + +/// Set the storage of a key to some value. +pub fn set_storage(key: &[u8], value: &[u8]) { + ext::with(|ext| + ext.set_storage(key.to_vec(), value.to_vec()) + ); +} + +/// Clear the storage of a key. +pub fn clear_storage(key: &[u8]) { + ext::with(|ext| + ext.clear_storage(key) + ); +} + +/// Check whether a given `key` exists in storage. +pub fn exists_storage(key: &[u8]) -> bool { + ext::with(|ext| + ext.exists_storage(key) + ).unwrap_or(false) +} + +/// Clear the storage entries with a key that starts with the given prefix. +pub fn clear_prefix(prefix: &[u8]) { + ext::with(|ext| + ext.clear_prefix(prefix) + ); +} + +/// The current relay chain identifier. +pub fn chain_id() -> u64 { + ext::with(|ext| + ext.chain_id() + ).unwrap_or(0) +} + +/// "Commit" all existing operations and compute the resultant storage root. +pub fn storage_root() -> H256 { + ext::with(|ext| + ext.storage_root() + ).unwrap_or(H256::new()) +} + +/// A trie root formed from the enumerated items. +pub fn enumerated_trie_root(serialised_values: &[&[u8]]) -> H::Out +where + H: Hasher, + H::Out: Encodable + Ord, +{ + triehash::ordered_trie_root::(serialised_values.iter().map(|s| s.to_vec())) +} + +/// A trie root formed from the iterated items. +pub fn trie_root(input: I) -> H::Out +where + I: IntoIterator, + A: AsRef<[u8]> + Ord, + B: AsRef<[u8]>, + H: Hasher, + ::Out: Encodable + Ord, +{ + triehash::trie_root::(input) +} + +/// A trie root formed from the enumerated items. +pub fn ordered_trie_root(input: I) -> H::Out +where + I: IntoIterator, + A: AsRef<[u8]>, + H: Hasher, + ::Out: Encodable + Ord, +{ + triehash::ordered_trie_root::(input) +} + +/// Verify a ed25519 signature. +pub fn ed25519_verify>(sig: &[u8; 64], msg: &[u8], pubkey: P) -> bool { + ed25519::verify(sig, msg, pubkey) +} + +/// Execute the given closure with global function available whose functionality routes into the +/// externalities `ext`. Forwards the value that the closure returns. +// NOTE: need a concrete hasher here due to limitations of the `environmental!` macro, otherwise a type param would have been fine I think. +pub fn with_externalities R>(ext: &mut Externalities, f: F) -> R { + ext::using(ext, f) +} + +/// Trait for things which can be printed. +pub trait Printable { + fn print(self); +} + +impl<'a> Printable for &'a [u8] { + fn print(self) { + println!("Runtime: {}", HexDisplay::from(&self)); + } +} + +impl<'a> Printable for &'a str { + fn print(self) { + println!("Runtime: {}", self); + } +} + +impl Printable for u64 { + fn print(self) { + println!("Runtime: {}", self); + } +} + +/// Print a printable value. +pub fn print(value: T) { + value.print(); +} + +#[macro_export] +macro_rules! impl_stubs { + ( $( $new_name:ident $($nodecode:ident)* => $invoke: expr ),*) => { + /// Dispatch logic for the native runtime. + pub fn dispatch(method: &str, data: &[u8]) -> Option> { + match method { + $( + stringify!($new_name) => { impl_stubs!(@METHOD data $new_name $($nodecode)* => $invoke) } + )* + _ => None, + } + } + }; + (@METHOD $data: ident $new_name: ident NO_DECODE => $invoke:expr) => { + Some($invoke($data)) + }; + (@METHOD $data: ident $new_name: ident => $invoke:expr) => {{ + let mut data = $data; + let input = match $crate::codec::Decode::decode(&mut data) { + Some(input) => input, + None => panic!("Bad input data provided to {}", stringify!($new_name)), + }; + + let output = $invoke(input); + Some($crate::codec::Encode::encode(&output)) + }} +} + +#[cfg(test)] +mod std_tests { + use super::*; + + #[test] + fn storage_works() { + let mut t = TestExternalities::::new(); + assert!(with_externalities(&mut t, || { + assert_eq!(storage(b"hello"), None); + set_storage(b"hello", b"world"); + assert_eq!(storage(b"hello"), Some(b"world".to_vec())); + assert_eq!(storage(b"foo"), None); + set_storage(b"foo", &[1, 2, 3][..]); + true + })); + + t = map![b"foo".to_vec() => b"bar".to_vec()]; + + assert!(!with_externalities(&mut t, || { + assert_eq!(storage(b"hello"), None); + assert_eq!(storage(b"foo"), Some(b"bar".to_vec())); + false + })); + } + + #[test] + fn read_storage_works() { + let mut t: TestExternalities = map![ + b":test".to_vec() => b"\x0b\0\0\0Hello world".to_vec() + ]; + + with_externalities(&mut t, || { + let mut v = [0u8; 4]; + assert!(read_storage(b":test", &mut v[..], 0).unwrap() >= 4); + assert_eq!(v, [11u8, 0, 0, 0]); + let mut w = [0u8; 11]; + assert!(read_storage(b":test", &mut w[..], 4).unwrap() >= 11); + assert_eq!(&w, b"Hello world"); + }); + } + + #[test] + fn clear_prefix_works() { + let mut t: TestExternalities = map![ + b":a".to_vec() => b"\x0b\0\0\0Hello world".to_vec(), + b":abcd".to_vec() => b"\x0b\0\0\0Hello world".to_vec(), + b":abc".to_vec() => b"\x0b\0\0\0Hello world".to_vec(), + b":abdd".to_vec() => b"\x0b\0\0\0Hello world".to_vec() + ]; + + with_externalities(&mut t, || { + clear_prefix(b":abc"); + + assert!(storage(b":a").is_some()); + assert!(storage(b":abdd").is_some()); + assert!(storage(b":abcd").is_none()); + assert!(storage(b":abc").is_none()); + }); + } +} diff --git a/substrate/runtime-io/without_std.rs b/core/runtime-io/without_std.rs similarity index 100% rename from substrate/runtime-io/without_std.rs rename to core/runtime-io/without_std.rs diff --git a/substrate/runtime-sandbox/Cargo.toml b/core/runtime-sandbox/Cargo.toml similarity index 100% rename from substrate/runtime-sandbox/Cargo.toml rename to core/runtime-sandbox/Cargo.toml diff --git a/substrate/runtime-sandbox/README.adoc b/core/runtime-sandbox/README.adoc similarity index 100% rename from substrate/runtime-sandbox/README.adoc rename to core/runtime-sandbox/README.adoc diff --git a/substrate/runtime-sandbox/build.rs b/core/runtime-sandbox/build.rs similarity index 100% rename from substrate/runtime-sandbox/build.rs rename to core/runtime-sandbox/build.rs diff --git a/substrate/runtime-sandbox/src/lib.rs b/core/runtime-sandbox/src/lib.rs similarity index 100% rename from substrate/runtime-sandbox/src/lib.rs rename to core/runtime-sandbox/src/lib.rs diff --git a/substrate/runtime-sandbox/with_std.rs b/core/runtime-sandbox/with_std.rs similarity index 100% rename from substrate/runtime-sandbox/with_std.rs rename to core/runtime-sandbox/with_std.rs diff --git a/substrate/runtime-sandbox/without_std.rs b/core/runtime-sandbox/without_std.rs similarity index 100% rename from substrate/runtime-sandbox/without_std.rs rename to core/runtime-sandbox/without_std.rs diff --git a/substrate/runtime-std/Cargo.toml b/core/runtime-std/Cargo.toml similarity index 100% rename from substrate/runtime-std/Cargo.toml rename to core/runtime-std/Cargo.toml diff --git a/substrate/runtime-std/README.adoc b/core/runtime-std/README.adoc similarity index 100% rename from substrate/runtime-std/README.adoc rename to core/runtime-std/README.adoc diff --git a/substrate/runtime-std/build.rs b/core/runtime-std/build.rs similarity index 100% rename from substrate/runtime-std/build.rs rename to core/runtime-std/build.rs diff --git a/substrate/runtime-std/src/lib.rs b/core/runtime-std/src/lib.rs similarity index 100% rename from substrate/runtime-std/src/lib.rs rename to core/runtime-std/src/lib.rs diff --git a/substrate/runtime-std/with_std.rs b/core/runtime-std/with_std.rs similarity index 100% rename from substrate/runtime-std/with_std.rs rename to core/runtime-std/with_std.rs diff --git a/substrate/runtime-std/without_std.rs b/core/runtime-std/without_std.rs similarity index 100% rename from substrate/runtime-std/without_std.rs rename to core/runtime-std/without_std.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..e2ddcb0704bc0 --- /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 = "../keystore" } +substrate-runtime-io = { path = "../runtime-io" } +substrate-runtime-primitives = { path = "../../runtime/primitives" } +substrate-primitives = { path = "../primitives" } +substrate-network = { path = "../network" } +substrate-client = { path = "../client" } +substrate-client-db = { path = "../client/db" } +substrate-codec = { path = "../codec" } +substrate-executor = { path = "../executor" } +substrate-extrinsic-pool = { path = "../extrinsic-pool" } +substrate-rpc = { path = "../rpc" } +substrate-rpc-servers = { path = "../rpc-servers" } +substrate-telemetry = { path = "../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 100% rename from substrate/service/src/lib.rs rename to core/service/src/lib.rs 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..95e4798192218 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 = "../primitives" } +substrate-codec = { path = "../codec" } +substrate-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 100% rename from substrate/state-db/src/lib.rs rename to core/state-db/src/lib.rs 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 100% rename from substrate/state-machine/Cargo.toml rename to core/state-machine/Cargo.toml 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 100% rename from substrate/state-machine/src/lib.rs rename to core/state-machine/src/lib.rs 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 70% rename from substrate/test-client/Cargo.toml rename to core/test-client/Cargo.toml index f36ec382f6028..eae01feafe979 100644 --- a/substrate/test-client/Cargo.toml +++ b/core/test-client/Cargo.toml @@ -9,10 +9,10 @@ substrate-bft = { path = "../bft" } substrate-client = { path = "../client" } substrate-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" } +substrate-runtime-support = { path = "../../runtime/support" } substrate-test-runtime = { path = "../test-runtime" } -substrate-runtime-primitives = { path = "../runtime/primitives" } +substrate-runtime-primitives = { path = "../../runtime/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 100% rename from substrate/test-client/src/lib.rs rename to core/test-client/src/lib.rs diff --git a/substrate/test-runtime/Cargo.toml b/core/test-runtime/Cargo.toml similarity index 76% rename from substrate/test-runtime/Cargo.toml rename to core/test-runtime/Cargo.toml index 5482936f05733..784c7252e277e 100644 --- a/substrate/test-runtime/Cargo.toml +++ b/core/test-runtime/Cargo.toml @@ -6,7 +6,6 @@ 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 } @@ -14,17 +13,16 @@ 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-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 } +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", 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 99% rename from substrate/test-runtime/src/lib.rs rename to core/test-runtime/src/lib.rs index 5f9712aa7167b..f8fe9d0137156 100644 --- a/substrate/test-runtime/src/lib.rs +++ b/core/test-runtime/src/lib.rs @@ -45,8 +45,6 @@ extern crate substrate_runtime_version as runtime_version; #[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; 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 84% rename from substrate/test-runtime/wasm/Cargo.lock rename to core/test-runtime/wasm/Cargo.lock index f42241061f26e..82f7da6df048b 100644 --- a/substrate/test-runtime/wasm/Cargo.lock +++ b/core/test-runtime/wasm/Cargo.lock @@ -96,10 +96,6 @@ dependencies = [ "heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "environmental" -version = "0.1.0" - [[package]] name = "ethbloom" version = "0.5.0" @@ -242,18 +238,6 @@ name = "memory_units" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "memorydb" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "elastic-array 0.10.0 (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)", - "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)", -] - [[package]] name = "nan-preserving-float" version = "0.1.0" @@ -277,14 +261,6 @@ dependencies = [ "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "owning_ref" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "stable_deref_trait 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "parity-bytes" version = "0.1.0" @@ -298,26 +274,6 @@ dependencies = [ "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "parking_lot" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot_core 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "parking_lot_core" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "patricia-trie" version = "0.2.1" @@ -493,19 +449,6 @@ dependencies = [ "syn 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "smallvec" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[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" @@ -550,16 +493,11 @@ dependencies = [ 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]] @@ -567,10 +505,7 @@ 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.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", @@ -592,10 +527,7 @@ dependencies = [ 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)", "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-primitives 0.1.0", "substrate-runtime-io 0.1.0", @@ -607,31 +539,12 @@ name = "substrate-runtime-version" 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-runtime-std 0.1.0", "substrate-runtime-support 0.1.0", ] -[[package]] -name = "substrate-state-machine" -version = "0.1.0" -dependencies = [ - "byteorder 1.2.3 (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)", - "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)", - "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)", -] - [[package]] name = "substrate-test-runtime" version = "0.1.0" @@ -667,16 +580,6 @@ dependencies = [ "crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "triehash" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "elastic-array 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", - "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)", -] - [[package]] name = "twox-hash" version = "1.1.0" @@ -701,24 +604,11 @@ name = "unicode-xid" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "unreachable" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "untrusted" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "void" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "wasmi" version = "0.4.0" @@ -781,16 +671,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "89f010e843f2b1a31dbd316b3b8d443758bc634bed37aabade59c686d644e0a2" "checksum memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0f9dc261e2b62d7a622bf416ea3c5245cdd5d9a7fcc428c0d06804dfce1775b3" "checksum memory_units 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "71d96e3f3c0b6325d8ccd83c33b28acb183edcb6c67938ba104ec546854b0882" -"checksum memorydb 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f72c93304ad51e21230ecbd0d2b58a3f94703bf9339d14aed88c3aaf5e8b7a56" "checksum nan-preserving-float 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "34d4f00fcc2f4c9efa8cc971db0da9e28290e28e97af47585e48691ef10ff31f" "checksum nodrop 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "9a2228dca57108069a5262f2ed8bd2e82496d2e074a06d1ccc7ce1687b6ae0a2" "checksum num-traits 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "775393e285254d2f5004596d69bb8bc1149754570dcc08cf30cabeba67955e28" "checksum num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c51a3322e4bca9d212ad9a158a02abc6934d005490c054a2778df73a70aa0a30" -"checksum owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cdf84f41639e037b484f93433aa3897863b561ed65c6e59c7073d7c561710f37" "checksum parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fa5168b4cf41f3835e4bc6ffb32f51bc9365dc50cb351904595b3931d917fd0c" "checksum parity-wasm 0.31.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e1c91199d14bd5b78ecade323d4a891d094799749c1b9e82d9c590c2e2849a40" -"checksum parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "149d8f5b97f3c1133e3cfcd8886449959e856b557ff281e292b733d7c69e005e" -"checksum parking_lot_core 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "4db1a8ccf734a7bce794cc19b3df06ed87ab2f3907036b693c68f56b4d4537fa" "checksum patricia-trie 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fa27fc4a972a03d64e5170d7facd2c84c6ed425b38ce62ad98dcfee2f7845b3b" "checksum plain_hasher 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "95fa6386b1d34aaf0adb9b7dd2885dbe7c34190e6263785e5a7ec2b19044a90f" "checksum proc-macro-hack 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3ba8d4f9257b85eb6cdf13f055cea3190520aab1409ca2ab43493ea4820c25f0" @@ -811,17 +697,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" "checksum serde 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)" = "fba5be06346c5200249c8c8ca4ccba4a09e8747c71c16e420bd359a0db4d8f91" "checksum serde_derive 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)" = "79e4620ba6fbe051fc7506fab6f84205823564d55da18d55b695160fb3479cd8" -"checksum smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "153ffa32fd170e9944f7e0838edf824a754ec4c1fc64746fcc9fe1f8fa602e5d" -"checksum stable_deref_trait 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "15132e0e364248108c5e2c02e3ab539be8d6f5d52a01ca9bbf27ed657316f02b" "checksum syn 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6dfd71b2be5a58ee30a6f8ea355ba8290d397131c00dfa55c3d34e6e13db5101" "checksum tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e9175261fbdb60781fcd388a4d6cc7e14764a2b629a7ad94abb439aed223a44f" -"checksum triehash 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3da77dc2c88bac48769c53f2c7675d99d522a7fc8130da3fadf29d7c6f94c9ac" "checksum twox-hash 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "475352206e7a290c5fccc27624a163e8d0d115f7bb60ca18a64fc9ce056d7435" "checksum uint 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "754ba11732b9161b94c41798e5197e5e75388d012f760c42adb5000353e98646" "checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" -"checksum unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" "checksum untrusted 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f392d7819dbe58833e26872f5f6f0d68b7bbbe90fc3667e98731c4a15ad9a7ae" -"checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" "checksum wasmi 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "522fe3fdd44a56f25cd5ddcd8ccdb1cf2e982ceb28fcb00f41d8a018ae5245a8" "checksum winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "04e3bd221fcbe8a271359c04f21a76db7d0c6028862d1bb5512d85e1e2eb5bb3" "checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" diff --git a/substrate/test-runtime/wasm/Cargo.toml b/core/test-runtime/wasm/Cargo.toml similarity index 53% rename from substrate/test-runtime/wasm/Cargo.toml rename to core/test-runtime/wasm/Cargo.toml index 599733e271c17..65cf0f29f201f 100644 --- a/substrate/test-runtime/wasm/Cargo.toml +++ b/core/test-runtime/wasm/Cargo.toml @@ -6,30 +6,14 @@ 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" -] +substrate-runtime-support = { path = "../../../runtime/support", default-features = false } +substrate-runtime-version = { path = "../../../runtime/version", default-features = false } +substrate-runtime-primitives = { path = "../../../runtime/primitives", default-features = false } [lib] crate-type = ["cdylib"] 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.lock b/demo/runtime/wasm/Cargo.lock deleted file mode 100644 index 89017d1a91d4d..0000000000000 --- a/demo/runtime/wasm/Cargo.lock +++ /dev/null @@ -1,1103 +0,0 @@ -[[package]] -name = "arrayvec" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "nodrop 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "base58" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "bitflags" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "blake2-rfc" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", - "constant_time_eq 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "byteorder" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "cfg-if" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "constant_time_eq" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "crossbeam-deque" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "crossbeam-epoch 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-utils 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-utils 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "nodrop 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", - "scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "crossbeam-utils" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cfg-if 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -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" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "environmental" -version = "0.1.0" - -[[package]] -name = "ethbloom" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "ethereum-types-serialize 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "fixed-hash 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)", - "tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "ethereum-types" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "ethbloom 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethereum-types-serialize 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "fixed-hash 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)", - "uint 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "ethereum-types-serialize" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "serde 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "fixed-hash" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "fuchsia-zircon" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "fuchsia-zircon-sys" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "gcc" -version = "0.3.54" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "hashdb" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "elastic-array 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "heapsize" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "hex-literal" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "hex-literal-impl 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro-hack 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "hex-literal-impl" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "proc-macro-hack 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "integer-sqrt" -version = "0.1.0" -source = "git+https://github.com/paritytech/integer-sqrt-rs.git#886e9cb983c46498003878afe965d55caa762025" - -[[package]] -name = "lazy_static" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "lazy_static" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "libc" -version = "0.2.41" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "log" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "log" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cfg-if 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "memoffset" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "memory_units" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "memorydb" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "elastic-array 0.10.0 (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)", - "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)", -] - -[[package]] -name = "nan-preserving-float" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "nodrop" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "num-traits" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "num_cpus" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "owning_ref" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "stable_deref_trait 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "parity-bytes" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "parity-wasm" -version = "0.31.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "parking_lot" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot_core 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "parking_lot_core" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "smallvec 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "patricia-trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "elastic-array 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", - "hashdb 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "plain_hasher" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "proc-macro-hack" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "proc-macro-hack-impl 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "proc-macro-hack-impl" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "proc-macro2" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "pwasm-alloc" -version = "0.1.0" -dependencies = [ - "pwasm-libc 0.1.0", - "rustc_version 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "pwasm-libc" -version = "0.1.0" - -[[package]] -name = "pwasm-utils" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-wasm 0.31.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "quote" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "proc-macro2 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "rand" -version = "0.3.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "rand" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "rayon" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "rayon-core 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "rayon-core" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "crossbeam-deque 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "ring" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "gcc 0.3.54 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", - "rayon 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", - "untrusted 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "rlp" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "elastic-array 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-hex 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "rustc-hex" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "rustc-hex" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "rustc_version" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "safe-mix" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "rustc_version 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "scopeguard" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "semver" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "semver-parser" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "serde" -version = "1.0.64" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "serde_derive" -version = "1.0.64" -source = "registry+https://github.com/rust-lang/crates.io-index" -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 = "smallvec" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[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-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)", -] - -[[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-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.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", - "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.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-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 = [ - "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", - "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" -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.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", - "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.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-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" -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-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.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", - "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" -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.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", - "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.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", - "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)", - "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-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.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-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.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-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.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", -] - -[[package]] -name = "substrate-runtime-version" -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-runtime-std 0.1.0", - "substrate-runtime-support 0.1.0", -] - -[[package]] -name = "substrate-state-machine" -version = "0.1.0" -dependencies = [ - "byteorder 1.2.3 (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)", - "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)", - "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)", -] - -[[package]] -name = "syn" -version = "0.14.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -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)", - "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "tiny-keccak" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "triehash" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "elastic-array 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", - "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)", -] - -[[package]] -name = "twox-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "uint" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "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)", - "heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-hex 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "unicode-xid" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "unreachable" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "untrusted" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "void" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "wasmi" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "memory_units 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "nan-preserving-float 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-wasm 0.31.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "winapi" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[metadata] -"checksum arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "a1e964f9e24d588183fcb43503abda40d288c8657dfc27311516ce2f05675aef" -"checksum base58 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5024ee8015f02155eee35c711107ddd9a9bf3cb689cf2a9089c97e79b6e1ae83" -"checksum bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d0c54bb8f454c567f21197eefcdbf5679d0bd99f2ddbe52e84c77061952e6789" -"checksum blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)" = "5d6d530bdd2d52966a6d03b7a964add7ae1a288d25214066fd4b600f0f796400" -"checksum byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "74c0b906e9446b0a2e4f760cdb3fa4b2c48cdc6db8766a845c54b6ff063fd2e9" -"checksum cfg-if 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "405216fd8fe65f718daa7102ea808a946b6ce40c742998fbfd3463645552de18" -"checksum constant_time_eq 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8ff012e225ce166d4422e0e78419d901719760f62ae2b7969ca6b564d1b54a9e" -"checksum crossbeam-deque 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f739f8c5363aca78cfb059edf753d8f0d36908c348f3d8d1503f03d8b75d9cf3" -"checksum crossbeam-epoch 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "927121f5407de9956180ff5e936fe3cf4324279280001cd56b669d28ee7e9150" -"checksum crossbeam-utils 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2760899e32a1d58d5abb31129f8fae5de75220bc2176e77ff7c627ae45c918d9" -"checksum crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "a2f4a431c5c9f662e1200b7c7f02c34e91361150e382089a8f2dec3ba680cbda" -"checksum elastic-array 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "88d4851b005ef16de812ea9acdb7bece2f0a40dd86c07b85631d7dafa54537bb" -"checksum ethbloom 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1a93a43ce2e9f09071449da36bfa7a1b20b950ee344b6904ff23de493b03b386" -"checksum ethereum-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "35b3c5a18bc5e73a32a110ac743ec04b02bbbcd3b71d3118d40a6113d509378a" -"checksum ethereum-types-serialize 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4ac59a21a9ce98e188f3dace9eb67a6c4a3c67ec7fbc7218cb827852679dc002" -"checksum fixed-hash 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0d5ec8112f00ea8a483e04748a85522184418fd1cf02890b626d8fc28683f7de" -"checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" -"checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" -"checksum gcc 0.3.54 (registry+https://github.com/rust-lang/crates.io-index)" = "5e33ec290da0d127825013597dbdfc28bee4964690c7ce1166cbc2a7bd08b1bb" -"checksum hashdb 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f1c71fc577cde89b3345d5f2880fecaf462a32e96c619f431279bdaf1ba5ddb1" -"checksum heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1679e6ea370dee694f91f1dc469bf94cf8f52051d147aec3e1f9497c6fc22461" -"checksum hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4da5f0e01bd8a71a224a4eedecaacfcabda388dbb7a80faf04d3514287572d95" -"checksum hex-literal-impl 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1d340b6514f232f6db1bd16db65302a5278a04fef9ce867cb932e7e5fa21130a" -"checksum integer-sqrt 0.1.0 (git+https://github.com/paritytech/integer-sqrt-rs.git)" = "" -"checksum lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "76f033c7ad61445c5b347c7382dd1237847eb1bce590fe50365dcb33d546be73" -"checksum lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e6412c5e2ad9584b0b8e979393122026cdd6d2a80b933f890dcd694ddbe73739" -"checksum libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)" = "ac8ebf8343a981e2fa97042b14768f02ed3e1d602eac06cae6166df3c8ced206" -"checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" -"checksum log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "89f010e843f2b1a31dbd316b3b8d443758bc634bed37aabade59c686d644e0a2" -"checksum memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0f9dc261e2b62d7a622bf416ea3c5245cdd5d9a7fcc428c0d06804dfce1775b3" -"checksum memory_units 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "71d96e3f3c0b6325d8ccd83c33b28acb183edcb6c67938ba104ec546854b0882" -"checksum memorydb 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f72c93304ad51e21230ecbd0d2b58a3f94703bf9339d14aed88c3aaf5e8b7a56" -"checksum nan-preserving-float 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "34d4f00fcc2f4c9efa8cc971db0da9e28290e28e97af47585e48691ef10ff31f" -"checksum nodrop 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "9a2228dca57108069a5262f2ed8bd2e82496d2e074a06d1ccc7ce1687b6ae0a2" -"checksum num-traits 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "775393e285254d2f5004596d69bb8bc1149754570dcc08cf30cabeba67955e28" -"checksum num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c51a3322e4bca9d212ad9a158a02abc6934d005490c054a2778df73a70aa0a30" -"checksum owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cdf84f41639e037b484f93433aa3897863b561ed65c6e59c7073d7c561710f37" -"checksum parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fa5168b4cf41f3835e4bc6ffb32f51bc9365dc50cb351904595b3931d917fd0c" -"checksum parity-wasm 0.31.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e1c91199d14bd5b78ecade323d4a891d094799749c1b9e82d9c590c2e2849a40" -"checksum parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "149d8f5b97f3c1133e3cfcd8886449959e856b557ff281e292b733d7c69e005e" -"checksum parking_lot_core 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "4db1a8ccf734a7bce794cc19b3df06ed87ab2f3907036b693c68f56b4d4537fa" -"checksum patricia-trie 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fa27fc4a972a03d64e5170d7facd2c84c6ed425b38ce62ad98dcfee2f7845b3b" -"checksum plain_hasher 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "95fa6386b1d34aaf0adb9b7dd2885dbe7c34190e6263785e5a7ec2b19044a90f" -"checksum proc-macro-hack 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3ba8d4f9257b85eb6cdf13f055cea3190520aab1409ca2ab43493ea4820c25f0" -"checksum proc-macro-hack-impl 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d5cb6f960ad471404618e9817c0e5d10b1ae74cfdf01fab89ea0641fe7fb2892" -"checksum proc-macro2 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "1fa93823f53cfd0f5ac117b189aed6cfdfb2cfc0a9d82e956dd7927595ed7d46" -"checksum pwasm-utils 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "efd695333cfae6e9dbe2703a6d040e252b57a6fc3b9a65c712615ac042b2e0c5" -"checksum quote 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e44651a0dc4cdd99f71c83b561e221f714912d11af1a4dff0631f923d53af035" -"checksum rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)" = "15a732abf9d20f0ad8eeb6f909bf6868722d9a06e1e50802b6a70351f40b4eb1" -"checksum rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "eba5f8cb59cc50ed56be8880a5c7b496bfd9bd26394e176bc67884094145c2c5" -"checksum rayon 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b614fe08b6665cb9a231d07ac1364b0ef3cb3698f1239ee0c4c3a88a524f54c8" -"checksum rayon-core 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9d24ad214285a7729b174ed6d3bcfcb80177807f959d95fafd5bfc5c4f201ac8" -"checksum ring 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6f7d28b30a72c01b458428e0ae988d4149c20d902346902be881e3edc4bb325c" -"checksum rlp 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "524c5ad554859785dfc8469df3ed5e0b5784d4d335877ed47c8d90fc0eb238fe" -"checksum rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0ceb8ce7a5e520de349e1fa172baeba4a9e8d5ef06c47471863530bc4972ee1e" -"checksum rustc-hex 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d2b03280c2813907a030785570c577fb27d3deec8da4c18566751ade94de0ace" -"checksum rustc_version 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a54aa04a10c68c1c4eacb4337fd883b435997ede17a9385784b990777686b09a" -"checksum safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7f7bf422d23a88c16d5090d455f182bc99c60af4df6a345c63428acf5129e347" -"checksum scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "94258f53601af11e6a49f722422f6e3425c52b06245a5cf9bc09908b174f5e27" -"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" -"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" -"checksum serde 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)" = "fba5be06346c5200249c8c8ca4ccba4a09e8747c71c16e420bd359a0db4d8f91" -"checksum serde_derive 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)" = "79e4620ba6fbe051fc7506fab6f84205823564d55da18d55b695160fb3479cd8" -"checksum smallvec 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "211a489e65e94b103926d2054ae515a1cdb5d515ea0ef414fee23b7e043ce748" -"checksum stable_deref_trait 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "15132e0e364248108c5e2c02e3ab539be8d6f5d52a01ca9bbf27ed657316f02b" -"checksum syn 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6dfd71b2be5a58ee30a6f8ea355ba8290d397131c00dfa55c3d34e6e13db5101" -"checksum tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e9175261fbdb60781fcd388a4d6cc7e14764a2b629a7ad94abb439aed223a44f" -"checksum triehash 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3da77dc2c88bac48769c53f2c7675d99d522a7fc8130da3fadf29d7c6f94c9ac" -"checksum twox-hash 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "475352206e7a290c5fccc27624a163e8d0d115f7bb60ca18a64fc9ce056d7435" -"checksum uint 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "754ba11732b9161b94c41798e5197e5e75388d012f760c42adb5000353e98646" -"checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" -"checksum unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" -"checksum untrusted 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f392d7819dbe58833e26872f5f6f0d68b7bbbe90fc3667e98731c4a15ad9a7ae" -"checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" -"checksum wasmi 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "522fe3fdd44a56f25cd5ddcd8ccdb1cf2e982ceb28fcb00f41d8a018ae5245a8" -"checksum winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "04e3bd221fcbe8a271359c04f21a76db7d0c6028862d1bb5512d85e1e2eb5bb3" -"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" -"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 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 0561462684fe8..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 d0cf943ec482f..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..e4c80e63c2671 100644 --- a/doc/packages/substrate.adoc +++ b/doc/packages/substrate.adoc @@ -3,64 +3,62 @@ :leveloffset: +3 -include::../../substrate/bft/README.adoc[] +include::../bft/README.adoc[] -include::../../substrate/cli/README.adoc[] +include::../cli/README.adoc[] -include::../../substrate/client/README.adoc[] +include::../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::../executor/README.adoc[] -include::../../substrate/executor/README.adoc[] +include::../extrinsic-pool/README.adoc[] -include::../../substrate/extrinsic-pool/README.adoc[] +include::../keyring/README.adoc[] -include::../../substrate/keyring/README.adoc[] +include::../keystore/README.adoc[] -include::../../substrate/keystore/README.adoc[] +include::../misbehavior-check/README.adoc[] -include::../../substrate/misbehavior-check/README.adoc[] +include::../network/README.adoc[] -include::../../substrate/network/README.adoc[] +include::../network-libp2p/README.adoc[] -include::../../substrate/network-libp2p/README.adoc[] +include::../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::../rpc/README.adoc[] -include::../../substrate/rpc/README.adoc[] +include::../rpc-servers/README.adoc[] -include::../../substrate/rpc-servers/README.adoc[] +include::../runtime/README.adoc[] -include::../../substrate/runtime/README.adoc[] +include::../runtime-io/README.adoc[] -include::../../substrate/runtime-io/README.adoc[] +include::../runtime-sandbox/README.adoc[] -include::../../substrate/runtime-sandbox/README.adoc[] +include::../runtime-std/README.adoc[] -include::../../substrate/runtime-std/README.adoc[] +include::../runtime-support/README.adoc[] -include::../../substrate/runtime-support/README.adoc[] +include::../serializer/README.adoc[] -include::../../substrate/serializer/README.adoc[] +include::../service/README.adoc[] -include::../../substrate/service/README.adoc[] +include::../state-db/README.adoc[] -include::../../substrate/state-db/README.adoc[] +include::../state-machine/README.adoc[] -include::../../substrate/state-machine/README.adoc[] +include::../telemetry/README.adoc[] -include::../../substrate/telemetry/README.adoc[] +include::../test-client/README.adoc[] -include::../../substrate/test-client/README.adoc[] - -include::../../substrate/test-runtime/README.adoc[] +include::../test-runtime/README.adoc[] :leveloffset: -3 diff --git a/framework/client/Cargo.toml b/framework/client/Cargo.toml new file mode 100644 index 0000000000000..886410f74eebd --- /dev/null +++ b/framework/client/Cargo.toml @@ -0,0 +1,32 @@ +[package] +name = "substrate-client" +version = "0.1.0" +authors = ["Parity Technologies "] + +[dependencies] +error-chain = "0.12" +fnv = "1.0" +log = "0.3" +parking_lot = "0.4" +triehash = "0.2" +hex-literal = "0.1" +futures = "0.1.17" + +slog = "^2" +heapsize = "0.4" +substrate-bft = { path = "../bft" } +substrate-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" } +substrate-state-machine = { path = "../state-machine" } +substrate-keyring = { path = "../keyring" } +substrate-telemetry = { path = "../telemetry" } +hashdb = "0.2.1" +patricia-trie = "0.2.1" +rlp = "0.2.4" + +[dev-dependencies] +substrate-test-client = { path = "../test-client" } diff --git a/framework/executor/Cargo.toml b/framework/executor/Cargo.toml new file mode 100644 index 0000000000000..4c30827dc1b7b --- /dev/null +++ b/framework/executor/Cargo.toml @@ -0,0 +1,33 @@ +[package] +name = "substrate-executor" +version = "0.1.0" +authors = ["Parity Technologies "] + +[dependencies] +error-chain = "0.12" +substrate-codec = { path = "../codec" } +substrate-runtime-io = { path = "../runtime-io" } +substrate-primitives = { path = "../primitives" } +substrate-serializer = { path = "../serializer" } +substrate-state-machine = { path = "../state-machine" } +substrate-runtime-version = { path = "../../runtime/version" } + +serde = "1.0" +serde_derive = "1.0" +wasmi = "0.4" +byteorder = "1.1" +triehash = "0.2" +twox-hash = "1.1.0" +lazy_static = "1.0" +parking_lot = "*" +log = "0.3" +hashdb = "0.2.1" + +[dev-dependencies] +assert_matches = "1.1" +wabt = "0.4" +hex-literal = "0.1.0" + +[features] +default = [] +wasm-extern-trace = [] diff --git a/framework/network/Cargo.toml b/framework/network/Cargo.toml new file mode 100644 index 0000000000000..fdd31aa7d02a0 --- /dev/null +++ b/framework/network/Cargo.toml @@ -0,0 +1,30 @@ +[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 = "../primitives" } +substrate-client = { path = "../client" } +substrate-runtime-primitives = { path = "../../runtime/primitives" } +substrate-codec = { path = "../codec" } +substrate-codec-derive = { path = "../codec/derive" } +substrate-network-libp2p = { path = "../network-libp2p" } + +[dev-dependencies] +env_logger = "0.4" +substrate-keyring = { path = "../keyring" } +substrate-test-client = { path = "../test-client" } diff --git a/substrate/runtime-support/Cargo.toml b/framework/runtime-support/Cargo.toml similarity index 87% rename from substrate/runtime-support/Cargo.toml rename to framework/runtime-support/Cargo.toml index ee8e524cf7133..bf7794a0832f0 100644 --- a/substrate/runtime-support/Cargo.toml +++ b/framework/runtime-support/Cargo.toml @@ -4,7 +4,6 @@ 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 } @@ -16,12 +15,11 @@ 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" } +substrate-codec-derive = { path = "../codec/derive" } [features] default = ["std"] std = [ - "ed25519", "hex-literal", "serde/std", "serde_derive", diff --git a/framework/test-runtime/Cargo.toml b/framework/test-runtime/Cargo.toml new file mode 100644 index 0000000000000..784c7252e277e --- /dev/null +++ b/framework/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 } +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", + "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/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 f83a6d228d3c9..81cf7ffae305d 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; 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..e6c6ac741706f --- /dev/null +++ b/node/consensus/Cargo.toml @@ -0,0 +1,26 @@ +[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" } +substrate-codec = { path = "../../core/codec" } +substrate-primitives = { path = "../../core/primitives" } +substrate-runtime-support = { path = "../../runtime/support" } +substrate-client = { path = "../../core/client" } +substrate-runtime-primitives = { path = "../../runtime/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 93% rename from demo/consensus/src/lib.rs rename to node/consensus/src/lib.rs index 7f55bc1e68fef..2135beebd0ce2 100644 --- a/demo/consensus/src/lib.rs +++ b/node/consensus/src/lib.rs @@ -1,27 +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 . //! 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; @@ -48,9 +47,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 +201,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 +362,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 +407,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 +426,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..43b5980ddf1bc 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. @@ -24,10 +24,10 @@ use std::sync::Arc; use bft::{self, BftService}; use client::{BlockchainEvents, ChainHead, BlockBody}; -use ed25519; +use primitives::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..2974a60a943a9 --- /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" +substrate-codec = { path = "../../core/codec" } +substrate-runtime-io = { path = "../../core/runtime-io" } +substrate-runtime-support = { path = "../../runtime/support" } +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" } +substrate-runtime-primitives = { path = "../../runtime/primitives" } +substrate-runtime-balances = { path = "../../runtime/balances" } +substrate-runtime-session = { path = "../../runtime/session" } +substrate-runtime-staking = { path = "../../runtime/staking" } +substrate-runtime-system = { path = "../../runtime/system" } +substrate-runtime-consensus = { path = "../../runtime/consensus" } +substrate-runtime-timestamp = { path = "../../runtime/timestamp" } +substrate-runtime-treasury = { path = "../../runtime/treasury" } diff --git a/demo/executor/src/lib.rs b/node/executor/src/lib.rs similarity index 95% rename from demo/executor/src/lib.rs rename to node/executor/src/lib.rs index 83f64f35169fd..9c92e42d0d828 100644 --- a/demo/executor/src/lib.rs +++ b/node/executor/src/lib.rs @@ -1,30 +1,29 @@ // 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 substrate_state_machine as state_machine; extern crate substrate_runtime_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; @@ -40,7 +39,7 @@ extern crate triehash; #[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 { @@ -489,7 +487,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(); @@ -510,7 +508,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..b44864ef9a90d --- /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-primitives = { path = "../../core/primitives" } +substrate-bft = { path = "../../core/bft" } +substrate-network = { path = "../../core/network" } +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..6a6ab77ca67fe 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 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..5b02f4d8ff5f0 100644 --- a/demo/network/src/lib.rs +++ b/node/network/src/lib.rs @@ -1,33 +1,33 @@ // 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. #![warn(unused_extern_crates)] +extern crate substrate_primitives as primitives; extern crate substrate_bft as bft; extern crate substrate_network; -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..f6a74b058fa74 --- /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 } +substrate-codec = { path = "../../core/codec", default_features = false } +substrate-codec-derive = { path = "../../core/codec/derive", default_features = false } +substrate-primitives = { path = "../../core/primitives", default_features = false } +substrate-runtime-std = { path = "../../core/runtime-std", default_features = false } +substrate-runtime-primitives = { path = "../../runtime/primitives", default_features = false } + +[dev-dependencies] +substrate-serializer = { path = "../../core/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/primitives/src/lib.rs b/node/primitives/src/lib.rs similarity index 89% rename from demo/primitives/src/lib.rs rename to node/primitives/src/lib.rs index d93b75f3954e4..433412eaf3f77 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)] @@ -83,7 +83,7 @@ pub type BlockId = generic::BlockId; #[derive(PartialEq, Eq, Clone, Default, Encode, Decode)] #[cfg_attr(feature = "std", derive(Serialize, Deserialize, Debug))] pub struct UncheckedExtrinsic(#[cfg_attr(feature = "std", serde(with="bytes"))] pub Vec); -/// + /// Inherent data to include in a block. #[derive(Encode, Decode)] pub struct InherentData { diff --git a/node/runtime/Cargo.toml b/node/runtime/Cargo.toml new file mode 100644 index 0000000000000..31db56e360ff6 --- /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} +substrate-codec = { path = "../../core/codec" } +substrate-codec-derive = { path = "../../core/codec/derive" } +substrate-runtime-std = { path = "../../core/runtime-std" } +substrate-runtime-io = { path = "../../core/runtime-io" } +substrate-primitives = { path = "../../core/primitives" } +substrate-keyring = { path = "../../core/keyring" } +substrate-runtime-support = { path = "../../runtime/support" } +substrate-runtime-balances = { path = "../../runtime/balances" } +substrate-runtime-consensus = { path = "../../runtime/consensus" } +substrate-runtime-contract = { path = "../../runtime/contract" } +substrate-runtime-council = { path = "../../runtime/council" } +substrate-runtime-democracy = { path = "../../runtime/democracy" } +substrate-runtime-executive = { path = "../../runtime/executive" } +substrate-runtime-primitives = { path = "../../runtime/primitives" } +substrate-runtime-session = { path = "../../runtime/session" } +substrate-runtime-staking = { path = "../../runtime/staking" } +substrate-runtime-system = { path = "../../runtime/system" } +substrate-runtime-timestamp = { path = "../../runtime/timestamp" } +substrate-runtime-treasury = { path = "../../runtime/treasury" } +substrate-runtime-version = { path = "../../runtime/version" } +node-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", + "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 95% rename from demo/runtime/src/lib.rs rename to node/runtime/src/lib.rs index c0502eed0460f..948507d5b2e07 100644 --- a/demo/runtime/src/lib.rs +++ b/node/runtime/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 . -//! 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)] @@ -55,7 +55,7 @@ extern crate substrate_runtime_timestamp as timestamp; extern crate substrate_runtime_treasury as treasury; #[macro_use] extern crate substrate_runtime_version as version; -extern crate demo_primitives; +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/node/runtime/wasm/Cargo.lock b/node/runtime/wasm/Cargo.lock new file mode 100644 index 0000000000000..78ff2c0cedd66 --- /dev/null +++ b/node/runtime/wasm/Cargo.lock @@ -0,0 +1,568 @@ +[[package]] +name = "arrayvec" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "nodrop 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "byteorder" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "cfg-if" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "crunchy" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "fixed-hash" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "hashdb" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "hex-literal" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "hex-literal-impl 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro-hack 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "hex-literal-impl" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro-hack 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "integer-sqrt" +version = "0.1.0" +source = "git+https://github.com/paritytech/integer-sqrt-rs.git#886e9cb983c46498003878afe965d55caa762025" + +[[package]] +name = "log" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "node-primitives" +version = "0.1.0" +dependencies = [ + "serde 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 = "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", + "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 = "nodrop" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "num-traits" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "parity-wasm" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "plain_hasher" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "proc-macro-hack" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro-hack-impl 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "proc-macro-hack-impl" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "proc-macro2" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "pwasm-alloc" +version = "0.1.0" +dependencies = [ + "pwasm-libc 0.1.0", + "rustc_version 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "pwasm-libc" +version = "0.1.0" + +[[package]] +name = "pwasm-utils" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-wasm 0.31.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "quote" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rustc-hex" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "rustc_version" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "safe-mix" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rustc_version 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "semver" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "semver-parser" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "serde" +version = "1.0.64" +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 = [ + "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)", + "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.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", + "uint 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[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.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-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.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-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 = [ + "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)", + "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", +] + +[[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.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-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.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-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" +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)", + "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 = [ + "hashdb 0.2.1 (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", +] + +[[package]] +name = "substrate-runtime-primitives" +version = "0.1.0" +dependencies = [ + "integer-sqrt 0.1.0 (git+https://github.com/paritytech/integer-sqrt-rs.git)", + "num-traits 0.2.4 (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", + "substrate-primitives 0.1.0", + "substrate-runtime-io 0.1.0", + "substrate-runtime-std 0.1.0", +] + +[[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.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-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.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-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 = [ + "serde 1.0.64 (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-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.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-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.64 (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.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", +] + +[[package]] +name = "substrate-runtime-version" +version = "0.1.0" +dependencies = [ + "serde 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", +] + +[[package]] +name = "syn" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +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)", + "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "uint" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "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)", + "rustc-hex 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "unicode-xid" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[metadata] +"checksum arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "a1e964f9e24d588183fcb43503abda40d288c8657dfc27311516ce2f05675aef" +"checksum byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "74c0b906e9446b0a2e4f760cdb3fa4b2c48cdc6db8766a845c54b6ff063fd2e9" +"checksum cfg-if 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "405216fd8fe65f718daa7102ea808a946b6ce40c742998fbfd3463645552de18" +"checksum crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "a2f4a431c5c9f662e1200b7c7f02c34e91361150e382089a8f2dec3ba680cbda" +"checksum fixed-hash 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0d5ec8112f00ea8a483e04748a85522184418fd1cf02890b626d8fc28683f7de" +"checksum hashdb 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f1c71fc577cde89b3345d5f2880fecaf462a32e96c619f431279bdaf1ba5ddb1" +"checksum hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4da5f0e01bd8a71a224a4eedecaacfcabda388dbb7a80faf04d3514287572d95" +"checksum hex-literal-impl 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1d340b6514f232f6db1bd16db65302a5278a04fef9ce867cb932e7e5fa21130a" +"checksum integer-sqrt 0.1.0 (git+https://github.com/paritytech/integer-sqrt-rs.git)" = "" +"checksum log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "89f010e843f2b1a31dbd316b3b8d443758bc634bed37aabade59c686d644e0a2" +"checksum nodrop 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "9a2228dca57108069a5262f2ed8bd2e82496d2e074a06d1ccc7ce1687b6ae0a2" +"checksum num-traits 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "775393e285254d2f5004596d69bb8bc1149754570dcc08cf30cabeba67955e28" +"checksum parity-wasm 0.31.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e1c91199d14bd5b78ecade323d4a891d094799749c1b9e82d9c590c2e2849a40" +"checksum plain_hasher 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "95fa6386b1d34aaf0adb9b7dd2885dbe7c34190e6263785e5a7ec2b19044a90f" +"checksum proc-macro-hack 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3ba8d4f9257b85eb6cdf13f055cea3190520aab1409ca2ab43493ea4820c25f0" +"checksum proc-macro-hack-impl 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d5cb6f960ad471404618e9817c0e5d10b1ae74cfdf01fab89ea0641fe7fb2892" +"checksum proc-macro2 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "1fa93823f53cfd0f5ac117b189aed6cfdfb2cfc0a9d82e956dd7927595ed7d46" +"checksum pwasm-utils 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "efd695333cfae6e9dbe2703a6d040e252b57a6fc3b9a65c712615ac042b2e0c5" +"checksum quote 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e44651a0dc4cdd99f71c83b561e221f714912d11af1a4dff0631f923d53af035" +"checksum rustc-hex 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d2b03280c2813907a030785570c577fb27d3deec8da4c18566751ade94de0ace" +"checksum rustc_version 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a54aa04a10c68c1c4eacb4337fd883b435997ede17a9385784b990777686b09a" +"checksum safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7f7bf422d23a88c16d5090d455f182bc99c60af4df6a345c63428acf5129e347" +"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" +"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" +"checksum serde 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)" = "fba5be06346c5200249c8c8ca4ccba4a09e8747c71c16e420bd359a0db4d8f91" +"checksum syn 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6dfd71b2be5a58ee30a6f8ea355ba8290d397131c00dfa55c3d34e6e13db5101" +"checksum uint 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "754ba11732b9161b94c41798e5197e5e75388d012f760c42adb5000353e98646" +"checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" diff --git a/node/runtime/wasm/Cargo.toml b/node/runtime/wasm/Cargo.toml new file mode 100644 index 0000000000000..db62ba1d175c8 --- /dev/null +++ b/node/runtime/wasm/Cargo.toml @@ -0,0 +1,38 @@ +[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} +node-primitives = { path = "../../primitives", default-features = false } +substrate-codec-derive = { path = "../../../core/codec/derive" } +substrate-codec = { path = "../../../core/codec", default-features = false } +substrate-primitives = { path = "../../../core/primitives", default-features = false } +substrate-runtime-std = { path = "../../../core/runtime-std", default-features = false } +substrate-runtime-io = { path = "../../../core/runtime-io", default-features = false } +substrate-runtime-support = { path = "../../../runtime/support", default-features = false } +substrate-runtime-balances = { path = "../../../runtime/balances", default-features = false } +substrate-runtime-consensus = { path = "../../../runtime/consensus", default-features = false } +substrate-runtime-contract = { path = "../../../runtime/contract", default-features = false } +substrate-runtime-council = { path = "../../../runtime/council", default-features = false } +substrate-runtime-democracy = { path = "../../../runtime/democracy", default-features = false } +substrate-runtime-executive = { path = "../../../runtime/executive", default-features = false } +substrate-runtime-primitives = { path = "../../../runtime/primitives", default-features = false } +substrate-runtime-session = { path = "../../../runtime/session", default-features = false } +substrate-runtime-staking = { path = "../../../runtime/staking", default-features = false } +substrate-runtime-system = { path = "../../../runtime/system", default-features = false } +substrate-runtime-timestamp = { path = "../../../runtime/timestamp", default-features = false } +substrate-runtime-treasury = { path = "../../../runtime/treasury", default-features = false } +substrate-runtime-version = { path = "../../../runtime/version", default-features = false } + +[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..5890c2ab7456a --- /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" } +substrate-runtime-io = { path = "../../core/runtime-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 bd232ce1a124c..b26de88f75953 100644 --- a/demo/service/src/chain_spec.rs +++ b/node/service/src/chain_spec.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 . -//! 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, Permill}; 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()) } @@ -41,7 +40,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, @@ -124,7 +123,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..0db2796437cf3 --- /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" } +substrate-codec = { path = "../../core/codec" } +substrate-keyring = { path = "../../core/keyring" } +substrate-extrinsic-pool = { path = "../../core/extrinsic-pool" } +substrate-primitives = { path = "../../core/primitives" } +substrate-runtime-primitives = { path = "../../runtime/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 94% rename from demo/transaction-pool/src/lib.rs rename to node/transaction-pool/src/lib.rs index 637356a098fb5..97ef5b59f2fdc 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 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 node_runtime as runtime; +extern crate node_primitives as primitives; +extern crate node_api; extern crate parking_lot; #[cfg(test)] @@ -44,7 +43,7 @@ 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}; diff --git a/substrate/runtime/README.adoc b/runtime/README.adoc similarity index 100% rename from substrate/runtime/README.adoc rename to runtime/README.adoc diff --git a/substrate/runtime/balances/Cargo.toml b/runtime/balances/Cargo.toml similarity index 59% rename from substrate/runtime/balances/Cargo.toml rename to runtime/balances/Cargo.toml index 5a86a99c11f30..8729db0b5d812 100644 --- a/substrate/runtime/balances/Cargo.toml +++ b/runtime/balances/Cargo.toml @@ -8,13 +8,13 @@ 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-keyring = { path = "../../core/keyring", optional = true } +substrate-codec = { path = "../../core/codec", default_features = false } +substrate-codec-derive = { path = "../../core/codec/derive", default_features = false } +substrate-primitives = { path = "../../core/primitives", default_features = false } +substrate-runtime-std = { path = "../../core/runtime-std", default_features = false } +substrate-runtime-io = { path = "../../core/runtime-io", default_features = false } +substrate-runtime-support = { path = "../support", default_features = false } substrate-runtime-primitives = { path = "../primitives", default_features = false } substrate-runtime-system = { path = "../system", default_features = false } diff --git a/substrate/runtime/balances/src/address.rs b/runtime/balances/src/address.rs similarity index 100% rename from substrate/runtime/balances/src/address.rs rename to runtime/balances/src/address.rs diff --git a/substrate/runtime/balances/src/genesis_config.rs b/runtime/balances/src/genesis_config.rs similarity index 100% rename from substrate/runtime/balances/src/genesis_config.rs rename to runtime/balances/src/genesis_config.rs diff --git a/substrate/runtime/balances/src/lib.rs b/runtime/balances/src/lib.rs similarity index 100% rename from substrate/runtime/balances/src/lib.rs rename to runtime/balances/src/lib.rs diff --git a/substrate/runtime/balances/src/mock.rs b/runtime/balances/src/mock.rs similarity index 100% rename from substrate/runtime/balances/src/mock.rs rename to runtime/balances/src/mock.rs diff --git a/substrate/runtime/balances/src/tests.rs b/runtime/balances/src/tests.rs similarity index 100% rename from substrate/runtime/balances/src/tests.rs rename to runtime/balances/src/tests.rs diff --git a/substrate/runtime/consensus/Cargo.toml b/runtime/consensus/Cargo.toml similarity index 59% rename from substrate/runtime/consensus/Cargo.toml rename to runtime/consensus/Cargo.toml index dfdebbddc118f..6b2e11c6c8e5f 100644 --- a/substrate/runtime/consensus/Cargo.toml +++ b/runtime/consensus/Cargo.toml @@ -7,12 +7,12 @@ authors = ["Parity Technologies "] 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-codec = { path = "../../core/codec", default_features = false } +substrate-codec-derive = { path = "../../core/codec/derive", default_features = false } +substrate-primitives = { path = "../../core/primitives", default_features = false } +substrate-runtime-std = { path = "../../core/runtime-std", default_features = false } +substrate-runtime-io = { path = "../../core/runtime-io", default_features = false } +substrate-runtime-support = { path = "../support", default_features = false } substrate-runtime-primitives = { path = "../primitives", default_features = false } substrate-runtime-system = { path = "../system", default_features = false } diff --git a/substrate/runtime/consensus/src/lib.rs b/runtime/consensus/src/lib.rs similarity index 100% rename from substrate/runtime/consensus/src/lib.rs rename to runtime/consensus/src/lib.rs diff --git a/substrate/runtime/contract/Cargo.toml b/runtime/contract/Cargo.toml similarity index 68% rename from substrate/runtime/contract/Cargo.toml rename to runtime/contract/Cargo.toml index a53cb5e886c6b..0eef76fabb6a1 100644 --- a/substrate/runtime/contract/Cargo.toml +++ b/runtime/contract/Cargo.toml @@ -6,17 +6,17 @@ 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 } +parity-wasm = { version = "0.31", default_features = false } +pwasm-utils = { version = "0.3", default_features = false } +substrate-codec = { path = "../../core/codec", default_features = false } +substrate-primitives = { path = "../../core/primitives", default_features = false } +substrate-runtime-sandbox = { path = "../../core/runtime-sandbox", 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-io = { path = "../../core/runtime-io", default_features = false } +substrate-runtime-std = { path = "../../core/runtime-std", default_features = false } +substrate-runtime-support = { path = "../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" diff --git a/substrate/runtime/contract/src/account_db.rs b/runtime/contract/src/account_db.rs similarity index 100% rename from substrate/runtime/contract/src/account_db.rs rename to runtime/contract/src/account_db.rs diff --git a/substrate/runtime/contract/src/double_map.rs b/runtime/contract/src/double_map.rs similarity index 100% rename from substrate/runtime/contract/src/double_map.rs rename to runtime/contract/src/double_map.rs diff --git a/substrate/runtime/contract/src/exec.rs b/runtime/contract/src/exec.rs similarity index 100% rename from substrate/runtime/contract/src/exec.rs rename to runtime/contract/src/exec.rs diff --git a/substrate/runtime/contract/src/gas.rs b/runtime/contract/src/gas.rs similarity index 100% rename from substrate/runtime/contract/src/gas.rs rename to runtime/contract/src/gas.rs diff --git a/substrate/runtime/contract/src/genesis_config.rs b/runtime/contract/src/genesis_config.rs similarity index 100% rename from substrate/runtime/contract/src/genesis_config.rs rename to runtime/contract/src/genesis_config.rs diff --git a/substrate/runtime/contract/src/lib.rs b/runtime/contract/src/lib.rs similarity index 100% rename from substrate/runtime/contract/src/lib.rs rename to runtime/contract/src/lib.rs diff --git a/substrate/runtime/contract/src/tests.rs b/runtime/contract/src/tests.rs similarity index 100% rename from substrate/runtime/contract/src/tests.rs rename to runtime/contract/src/tests.rs diff --git a/substrate/runtime/contract/src/vm/env_def/macros.rs b/runtime/contract/src/vm/env_def/macros.rs similarity index 100% rename from substrate/runtime/contract/src/vm/env_def/macros.rs rename to runtime/contract/src/vm/env_def/macros.rs diff --git a/substrate/runtime/contract/src/vm/env_def/mod.rs b/runtime/contract/src/vm/env_def/mod.rs similarity index 100% rename from substrate/runtime/contract/src/vm/env_def/mod.rs rename to runtime/contract/src/vm/env_def/mod.rs diff --git a/substrate/runtime/contract/src/vm/mod.rs b/runtime/contract/src/vm/mod.rs similarity index 100% rename from substrate/runtime/contract/src/vm/mod.rs rename to runtime/contract/src/vm/mod.rs diff --git a/substrate/runtime/contract/src/vm/prepare.rs b/runtime/contract/src/vm/prepare.rs similarity index 100% rename from substrate/runtime/contract/src/vm/prepare.rs rename to runtime/contract/src/vm/prepare.rs diff --git a/substrate/runtime/council/Cargo.toml b/runtime/council/Cargo.toml similarity index 69% rename from substrate/runtime/council/Cargo.toml rename to runtime/council/Cargo.toml index aa1bbd0bdf079..7d3b6c24d7d94 100644 --- a/substrate/runtime/council/Cargo.toml +++ b/runtime/council/Cargo.toml @@ -9,13 +9,13 @@ integer-sqrt = { git = "https://github.com/paritytech/integer-sqrt-rs.git", bran 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-keyring = { path = "../../core/keyring", optional = true } +substrate-codec = { path = "../../core/codec", default_features = false } +substrate-codec-derive = { path = "../../core/codec/derive", default_features = false } +substrate-primitives = { path = "../../core/primitives", default_features = false } +substrate-runtime-std = { path = "../../core/runtime-std", default_features = false } +substrate-runtime-io = { path = "../../core/runtime-io", default_features = false } +substrate-runtime-support = { path = "../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 } diff --git a/substrate/runtime/council/src/lib.rs b/runtime/council/src/lib.rs similarity index 100% rename from substrate/runtime/council/src/lib.rs rename to runtime/council/src/lib.rs diff --git a/substrate/runtime/council/src/motions.rs b/runtime/council/src/motions.rs similarity index 100% rename from substrate/runtime/council/src/motions.rs rename to runtime/council/src/motions.rs diff --git a/substrate/runtime/council/src/seats.rs b/runtime/council/src/seats.rs similarity index 100% rename from substrate/runtime/council/src/seats.rs rename to runtime/council/src/seats.rs diff --git a/substrate/runtime/council/src/voting.rs b/runtime/council/src/voting.rs similarity index 100% rename from substrate/runtime/council/src/voting.rs rename to runtime/council/src/voting.rs diff --git a/substrate/runtime/democracy/Cargo.toml b/runtime/democracy/Cargo.toml similarity index 67% rename from substrate/runtime/democracy/Cargo.toml rename to runtime/democracy/Cargo.toml index 4667e22be3781..88a94e6ba6ad2 100644 --- a/substrate/runtime/democracy/Cargo.toml +++ b/runtime/democracy/Cargo.toml @@ -8,12 +8,12 @@ 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-codec = { path = "../../core/codec", default_features = false } +substrate-codec-derive = { path = "../../core/codec/derive", default_features = false } +substrate-primitives = { path = "../../core/primitives", default_features = false } +substrate-runtime-std = { path = "../../core/runtime-std", default_features = false } +substrate-runtime-io = { path = "../../core/runtime-io", default_features = false } +substrate-runtime-support = { path = "../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 } diff --git a/substrate/runtime/democracy/src/lib.rs b/runtime/democracy/src/lib.rs similarity index 100% rename from substrate/runtime/democracy/src/lib.rs rename to runtime/democracy/src/lib.rs diff --git a/substrate/runtime/democracy/src/vote_threshold.rs b/runtime/democracy/src/vote_threshold.rs similarity index 100% rename from substrate/runtime/democracy/src/vote_threshold.rs rename to runtime/democracy/src/vote_threshold.rs diff --git a/substrate/runtime/example/Cargo.toml b/runtime/example/Cargo.toml similarity index 63% rename from substrate/runtime/example/Cargo.toml rename to runtime/example/Cargo.toml index 92c0d887e7f3a..66da7e9355ea8 100644 --- a/substrate/runtime/example/Cargo.toml +++ b/runtime/example/Cargo.toml @@ -7,13 +7,13 @@ authors = ["Parity Technologies "] 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-std = { path = "../../core/runtime-std", default_features = false } +substrate-runtime-io = { path = "../../core/runtime-io", default_features = false } +substrate-runtime-support = { path = "../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-codec = { path = "../../core/codec", default_features = false } +substrate-codec-derive = { path = "../../core/codec/derive", default_features = false } +substrate-primitives = { path = "../../core/primitives", default_features = false } substrate-runtime-system = { path = "../system", default_features = false } substrate-runtime-balances = { path = "../balances", default_features = false } diff --git a/substrate/runtime/example/src/lib.rs b/runtime/example/src/lib.rs similarity index 100% rename from substrate/runtime/example/src/lib.rs rename to runtime/example/src/lib.rs diff --git a/substrate/runtime/executive/Cargo.toml b/runtime/executive/Cargo.toml similarity index 63% rename from substrate/runtime/executive/Cargo.toml rename to runtime/executive/Cargo.toml index 965bbe2a1e2c1..2cebd50692e38 100644 --- a/substrate/runtime/executive/Cargo.toml +++ b/runtime/executive/Cargo.toml @@ -7,17 +7,17 @@ authors = ["Parity Technologies "] 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-codec = { path = "../../core/codec", default_features = false } +substrate-runtime-std = { path = "../../core/runtime-std", default_features = false } +substrate-runtime-io = { path = "../../core/runtime-io", default_features = false } +substrate-runtime-support = { path = "../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-primitives = { path = "../../core/primitives" } substrate-runtime-balances = { path = "../balances" } -substrate-codec-derive = { path = "../../codec/derive" } +substrate-codec-derive = { path = "../../core/codec/derive" } [features] default = ["std"] diff --git a/substrate/runtime/executive/src/lib.rs b/runtime/executive/src/lib.rs similarity index 100% rename from substrate/runtime/executive/src/lib.rs rename to runtime/executive/src/lib.rs diff --git a/substrate/runtime/primitives/Cargo.toml b/runtime/primitives/Cargo.toml similarity index 58% rename from substrate/runtime/primitives/Cargo.toml rename to runtime/primitives/Cargo.toml index e7adc094d6789..f67577664c5e3 100644 --- a/substrate/runtime/primitives/Cargo.toml +++ b/runtime/primitives/Cargo.toml @@ -8,12 +8,12 @@ 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 } +substrate-codec = { path = "../../core/codec", default_features = false } +substrate-codec-derive = { path = "../../core/codec/derive", default_features = false } +substrate-primitives = { path = "../../core/primitives", default_features = false } +substrate-runtime-std = { path = "../../core/runtime-std", default_features = false } +substrate-runtime-io = { path = "../../core/runtime-io", default_features = false } +substrate-runtime-support = { path = "../support", default_features = false } log = {version = "0.3", optional = true } [dev-dependencies] diff --git a/substrate/runtime/primitives/src/bft.rs b/runtime/primitives/src/bft.rs similarity index 100% rename from substrate/runtime/primitives/src/bft.rs rename to runtime/primitives/src/bft.rs diff --git a/substrate/runtime/primitives/src/generic/block.rs b/runtime/primitives/src/generic/block.rs similarity index 100% rename from substrate/runtime/primitives/src/generic/block.rs rename to runtime/primitives/src/generic/block.rs diff --git a/substrate/runtime/primitives/src/generic/checked_extrinsic.rs b/runtime/primitives/src/generic/checked_extrinsic.rs similarity index 100% rename from substrate/runtime/primitives/src/generic/checked_extrinsic.rs rename to runtime/primitives/src/generic/checked_extrinsic.rs diff --git a/substrate/runtime/primitives/src/generic/digest.rs b/runtime/primitives/src/generic/digest.rs similarity index 100% rename from substrate/runtime/primitives/src/generic/digest.rs rename to runtime/primitives/src/generic/digest.rs diff --git a/substrate/runtime/primitives/src/generic/header.rs b/runtime/primitives/src/generic/header.rs similarity index 100% rename from substrate/runtime/primitives/src/generic/header.rs rename to runtime/primitives/src/generic/header.rs diff --git a/substrate/runtime/primitives/src/generic/mod.rs b/runtime/primitives/src/generic/mod.rs similarity index 100% rename from substrate/runtime/primitives/src/generic/mod.rs rename to runtime/primitives/src/generic/mod.rs diff --git a/substrate/runtime/primitives/src/generic/tests.rs b/runtime/primitives/src/generic/tests.rs similarity index 100% rename from substrate/runtime/primitives/src/generic/tests.rs rename to runtime/primitives/src/generic/tests.rs diff --git a/substrate/runtime/primitives/src/generic/unchecked_extrinsic.rs b/runtime/primitives/src/generic/unchecked_extrinsic.rs similarity index 100% rename from substrate/runtime/primitives/src/generic/unchecked_extrinsic.rs rename to runtime/primitives/src/generic/unchecked_extrinsic.rs diff --git a/substrate/runtime/primitives/src/lib.rs b/runtime/primitives/src/lib.rs similarity index 100% rename from substrate/runtime/primitives/src/lib.rs rename to runtime/primitives/src/lib.rs diff --git a/substrate/runtime/primitives/src/testing.rs b/runtime/primitives/src/testing.rs similarity index 100% rename from substrate/runtime/primitives/src/testing.rs rename to runtime/primitives/src/testing.rs diff --git a/substrate/runtime/primitives/src/traits.rs b/runtime/primitives/src/traits.rs similarity index 100% rename from substrate/runtime/primitives/src/traits.rs rename to runtime/primitives/src/traits.rs diff --git a/substrate/runtime/session/Cargo.toml b/runtime/session/Cargo.toml similarity index 65% rename from substrate/runtime/session/Cargo.toml rename to runtime/session/Cargo.toml index c2acfc1de2638..9cffec07b8ddd 100644 --- a/substrate/runtime/session/Cargo.toml +++ b/runtime/session/Cargo.toml @@ -8,13 +8,13 @@ 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-keyring = { path = "../../core/keyring", optional = true } +substrate-codec = { path = "../../core/codec", default_features = false } +substrate-codec-derive = { path = "../../core/codec/derive", default_features = false } +substrate-primitives = { path = "../../core/primitives", default_features = false } +substrate-runtime-std = { path = "../../core/runtime-std", default_features = false } +substrate-runtime-io = { path = "../../core/runtime-io", default_features = false } +substrate-runtime-support = { path = "../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 } diff --git a/substrate/runtime/session/src/lib.rs b/runtime/session/src/lib.rs similarity index 100% rename from substrate/runtime/session/src/lib.rs rename to runtime/session/src/lib.rs diff --git a/substrate/runtime/staking/Cargo.toml b/runtime/staking/Cargo.toml similarity index 66% rename from substrate/runtime/staking/Cargo.toml rename to runtime/staking/Cargo.toml index 78ea8b2958e95..84a14febae386 100644 --- a/substrate/runtime/staking/Cargo.toml +++ b/runtime/staking/Cargo.toml @@ -8,14 +8,14 @@ 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-keyring = { path = "../../core/keyring", optional = true } +substrate-codec = { path = "../../core/codec", default_features = false } +substrate-codec-derive = { path = "../../core/codec/derive", default_features = false } +substrate-primitives = { path = "../../core/primitives", default_features = false } +substrate-runtime-std = { path = "../../core/runtime-std", default_features = false } +substrate-runtime-io = { path = "../../core/runtime-io", default_features = false } +substrate-runtime-sandbox = { path = "../../core/runtime-sandbox", default_features = false } +substrate-runtime-support = { path = "../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 } diff --git a/substrate/runtime/staking/src/genesis_config.rs b/runtime/staking/src/genesis_config.rs similarity index 100% rename from substrate/runtime/staking/src/genesis_config.rs rename to runtime/staking/src/genesis_config.rs diff --git a/substrate/runtime/staking/src/lib.rs b/runtime/staking/src/lib.rs similarity index 100% rename from substrate/runtime/staking/src/lib.rs rename to runtime/staking/src/lib.rs diff --git a/substrate/runtime/staking/src/mock.rs b/runtime/staking/src/mock.rs similarity index 100% rename from substrate/runtime/staking/src/mock.rs rename to runtime/staking/src/mock.rs diff --git a/substrate/runtime/staking/src/tests.rs b/runtime/staking/src/tests.rs similarity index 100% rename from substrate/runtime/staking/src/tests.rs rename to runtime/staking/src/tests.rs diff --git a/runtime/support/Cargo.toml b/runtime/support/Cargo.toml new file mode 100644 index 0000000000000..a718a24573f4f --- /dev/null +++ b/runtime/support/Cargo.toml @@ -0,0 +1,32 @@ +[package] +name = "substrate-runtime-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 } +substrate-runtime-std = { path = "../../core/runtime-std", default_features = false } +substrate-runtime-io = { path = "../../core/runtime-io", default_features = false } +substrate-primitives = { path = "../../core/primitives", default_features = false } +substrate-codec = { path = "../../core/codec", default_features = false } + +[dev-dependencies] +pretty_assertions = "0.5.1" +serde_json = { version = "1.0" } +substrate-codec-derive = { path = "../../core/codec/derive" } + +[features] +default = ["std"] +std = [ + "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-support/README.adoc b/runtime/support/README.adoc similarity index 100% rename from substrate/runtime-support/README.adoc rename to runtime/support/README.adoc diff --git a/substrate/runtime-support/src/dispatch.rs b/runtime/support/src/dispatch.rs similarity index 100% rename from substrate/runtime-support/src/dispatch.rs rename to runtime/support/src/dispatch.rs diff --git a/substrate/runtime-support/src/event.rs b/runtime/support/src/event.rs similarity index 100% rename from substrate/runtime-support/src/event.rs rename to runtime/support/src/event.rs diff --git a/substrate/runtime-support/src/hashable.rs b/runtime/support/src/hashable.rs similarity index 100% rename from substrate/runtime-support/src/hashable.rs rename to runtime/support/src/hashable.rs diff --git a/substrate/runtime-support/src/lib.rs b/runtime/support/src/lib.rs similarity index 100% rename from substrate/runtime-support/src/lib.rs rename to runtime/support/src/lib.rs diff --git a/substrate/runtime-support/src/metadata.rs b/runtime/support/src/metadata.rs similarity index 100% rename from substrate/runtime-support/src/metadata.rs rename to runtime/support/src/metadata.rs diff --git a/substrate/runtime-support/src/storage/generator.rs b/runtime/support/src/storage/generator.rs similarity index 100% rename from substrate/runtime-support/src/storage/generator.rs rename to runtime/support/src/storage/generator.rs diff --git a/substrate/runtime-support/src/storage/mod.rs b/runtime/support/src/storage/mod.rs similarity index 100% rename from substrate/runtime-support/src/storage/mod.rs rename to runtime/support/src/storage/mod.rs diff --git a/substrate/runtime/system/Cargo.toml b/runtime/system/Cargo.toml similarity index 58% rename from substrate/runtime/system/Cargo.toml rename to runtime/system/Cargo.toml index 28388bd5390f9..2991c2a00fe08 100644 --- a/substrate/runtime/system/Cargo.toml +++ b/runtime/system/Cargo.toml @@ -8,12 +8,12 @@ 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-codec = { path = "../../core/codec", default_features = false } +substrate-codec-derive = { path = "../../core/codec/derive", default_features = false } +substrate-primitives = { path = "../../core/primitives", default_features = false } +substrate-runtime-std = { path = "../../core/runtime-std", default_features = false } +substrate-runtime-io = { path = "../../core/runtime-io", default_features = false } +substrate-runtime-support = { path = "../support", default_features = false } substrate-runtime-primitives = { path = "../primitives", default_features = false } [features] diff --git a/substrate/runtime/system/src/lib.rs b/runtime/system/src/lib.rs similarity index 100% rename from substrate/runtime/system/src/lib.rs rename to runtime/system/src/lib.rs diff --git a/substrate/runtime/timestamp/Cargo.toml b/runtime/timestamp/Cargo.toml similarity index 62% rename from substrate/runtime/timestamp/Cargo.toml rename to runtime/timestamp/Cargo.toml index c87da900bfe19..b8c42308a79ba 100644 --- a/substrate/runtime/timestamp/Cargo.toml +++ b/runtime/timestamp/Cargo.toml @@ -7,18 +7,15 @@ authors = ["Parity Technologies "] 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-std = { path = "../../core/runtime-std", default_features = false } +substrate-runtime-io = { path = "../../core/runtime-io", default_features = false } +substrate-runtime-support = { path = "../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-codec = { path = "../../core/codec", default_features = false } +substrate-primitives = { path = "../../core/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 = [ diff --git a/substrate/runtime/timestamp/src/lib.rs b/runtime/timestamp/src/lib.rs similarity index 100% rename from substrate/runtime/timestamp/src/lib.rs rename to runtime/timestamp/src/lib.rs diff --git a/substrate/runtime/treasury/Cargo.toml b/runtime/treasury/Cargo.toml similarity index 63% rename from substrate/runtime/treasury/Cargo.toml rename to runtime/treasury/Cargo.toml index 0c76961434c2c..221439917b928 100644 --- a/substrate/runtime/treasury/Cargo.toml +++ b/runtime/treasury/Cargo.toml @@ -7,13 +7,13 @@ authors = ["Parity Technologies "] 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-std = { path = "../../core/runtime-std", default_features = false } +substrate-runtime-io = { path = "../../core/runtime-io", default_features = false } +substrate-runtime-support = { path = "../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-codec = { path = "../../core/codec", default_features = false } +substrate-codec-derive = { path = "../../core/codec/derive", default_features = false } +substrate-primitives = { path = "../../core/primitives", default_features = false } substrate-runtime-system = { path = "../system", default_features = false } substrate-runtime-balances = { path = "../balances", default_features = false } diff --git a/substrate/runtime/treasury/src/lib.rs b/runtime/treasury/src/lib.rs similarity index 100% rename from substrate/runtime/treasury/src/lib.rs rename to runtime/treasury/src/lib.rs diff --git a/substrate/runtime/version/Cargo.toml b/runtime/version/Cargo.toml similarity index 54% rename from substrate/runtime/version/Cargo.toml rename to runtime/version/Cargo.toml index 2f471fe6ed085..10f91e9677c71 100644 --- a/substrate/runtime/version/Cargo.toml +++ b/runtime/version/Cargo.toml @@ -6,10 +6,10 @@ 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 } +substrate-codec = { path = "../../core/codec", default_features = false } +substrate-codec-derive = { path = "../../core/codec/derive", default_features = false } +substrate-runtime-std = { path = "../../core/runtime-std", default_features = false } +substrate-runtime-support = { path = "../support", default_features = false } [features] default = ["std"] diff --git a/substrate/runtime/version/src/lib.rs b/runtime/version/src/lib.rs similarity index 99% rename from substrate/runtime/version/src/lib.rs rename to runtime/version/src/lib.rs index c8e3b8f4a6dc1..632351b76314a 100644 --- a/substrate/runtime/version/src/lib.rs +++ b/runtime/version/src/lib.rs @@ -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/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..042dba9e99c72 100644 --- a/scripts/common.sh +++ b/scripts/common.sh @@ -4,12 +4,12 @@ ROOT=`dirname "$0"` # A list of directories which contain wasm projects. SRCS=( - "substrate/executor/wasm" + "core/executor/wasm" + "node/runtime/wasm" + "core/test-runtime/wasm" ) DEMOS=( - "demo/runtime/wasm" - "substrate/test-runtime/wasm" ) # Make pushd/popd silent. 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..349898602062b 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::{hexdisplay::HexDisplay, ed25519::Pair}; 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/client/src/genesis.rs b/substrate/client/src/genesis.rs index 93b8244fec534..9c7810aedca3d 100644 --- a/substrate/client/src/genesis.rs +++ b/substrate/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/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/ed25519/README.adoc b/substrate/ed25519/README.adoc deleted file mode 100644 index 97c10769ee902..0000000000000 --- a/substrate/ed25519/README.adoc +++ /dev/null @@ -1,13 +0,0 @@ - -= ED25519 - -.Summary -[source, toml] ----- -include::Cargo.toml[lines=2..5] ----- - -.Description ----- -include::src/lib.rs[tag=description] ----- 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-io/with_std.rs b/substrate/runtime-io/with_std.rs index c1d85d914ebef..8b868efed691f 100644 --- a/substrate/runtime-io/with_std.rs +++ b/substrate/runtime-io/with_std.rs @@ -22,7 +22,6 @@ extern crate substrate_primitives as primitives; extern crate substrate_state_machine; extern crate triehash; -extern crate ed25519; extern crate hashdb; extern crate rlp; 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/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 c917584c7f3d8..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 89a0e6127e8be..0000000000000 Binary files a/substrate/test-runtime/wasm/target/wasm32-unknown-unknown/release/substrate_test_runtime.wasm and /dev/null differ