diff --git a/.gitignore b/.gitignore index ea86b1eb14742..9155c1d6e1293 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ /target/ **/*.rs.bk *.swp -polkadot-runtime/wasm/target/ -executor/wasm/target/ +polkadot/runtime/wasm/target/ +substrate/executor/wasm/target/ **/._* diff --git a/Cargo.toml b/Cargo.toml index 615a00dc05e58..1c3d80e3c7dd7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,3 +1,7 @@ +[[bin]] +name = "polkadot" +path = "polkadot/src/main.rs" + [package] name = "polkadot" version = "0.1.0" @@ -5,34 +9,34 @@ authors = ["Parity Technologies "] [dependencies] error-chain = "0.11" -polkadot-cli = { path = "polkadot-cli", version = "0.1" } -polkadot-network = { path = "network" } +polkadot-cli = { path = "polkadot/cli" } +polkadot-network = { path = "polkadot/network" } [workspace] members = [ - "client", - "codec", - "environmental", - "executor", - "network", - "polkadot-candidate-agreement", - "polkadot-cli", - "polkadot-collator", - "polkadot-executor", - "polkadot-runtime", - "polkadot-primitives", - "polkadot-validator", - "primitives", - "rpc", - "rpc-servers", - "runtime-io", - "runtime-std", - "serializer", - "state-machine", + "substrate/client", + "substrate/codec", + "substrate/environmental", + "substrate/executor", + "polkadot/network", + "polkadot/candidate-agreement", + "polkadot/cli", + "polkadot/collator", + "polkadot/executor", + "polkadot/runtime", + "polkadot/primitives", + "polkadot/validator", + "substrate/primitives", + "substrate/rpc", + "substrate/rpc-servers", + "substrate/runtime-io", + "substrate/runtime-std", + "substrate/serializer", + "substrate/state-machine", ] exclude = [ - "executor/wasm", - "polkadot-runtime/wasm", - "pwasm-alloc", - "pwasm-libc", + "substrate/executor/wasm", + "polkadot/runtime/wasm", + "substrate/pwasm-alloc", + "substrate/pwasm-libc", ] diff --git a/polkadot-cli/Cargo.toml b/polkadot-cli/Cargo.toml deleted file mode 100644 index 6ab7915afb8d9..0000000000000 --- a/polkadot-cli/Cargo.toml +++ /dev/null @@ -1,24 +0,0 @@ -[package] -name = "polkadot-cli" -version = "0.1.0" -authors = ["Parity Technologies "] -description = "Polkadot node implementation in Rust." - -[dependencies] -clap = { version = "2.27", features = ["yaml"] } -env_logger = "0.4" -error-chain = "0.11" -log = "0.3" -hex-literal = "0.1" -ed25519 = { path = "../ed25519" } -triehash = { version = "0.1" } -substrate-client = { path = "../client" } -substrate-codec = { path = "../codec" } -substrate-runtime-io = { path = "../runtime-io" } -substrate-state-machine = { path = "../state-machine" } -substrate-executor = { path = "../executor" } -substrate-primitives = { path = "../primitives" } -substrate-rpc-servers = { path = "../rpc-servers" } -polkadot-primitives = { path = "../polkadot-primitives" } -polkadot-executor = { path = "../polkadot-executor" } -polkadot-runtime = { path = "../polkadot-runtime" } diff --git a/polkadot-executor/Cargo.toml b/polkadot-executor/Cargo.toml deleted file mode 100644 index fdab366062b39..0000000000000 --- a/polkadot-executor/Cargo.toml +++ /dev/null @@ -1,17 +0,0 @@ -[package] -name = "polkadot-executor" -version = "0.1.0" -authors = ["Parity Technologies "] -description = "Polkadot node implementation in Rust." - -[dependencies] -hex-literal = "0.1" -ed25519 = { path = "../ed25519" } -triehash = { version = "0.1" } -substrate-codec = { path = "../codec" } -substrate-runtime-io = { path = "../runtime-io" } -substrate-state-machine = { path = "../state-machine" } -substrate-executor = { path = "../executor" } -substrate-primitives = { path = "../primitives" } -polkadot-primitives = { path = "../polkadot-primitives", version = "0.1" } -polkadot-runtime = { path = "../polkadot-runtime" } diff --git a/polkadot-runtime/Cargo.toml b/polkadot-runtime/Cargo.toml deleted file mode 100644 index 3bb02f1fbb5c1..0000000000000 --- a/polkadot-runtime/Cargo.toml +++ /dev/null @@ -1,18 +0,0 @@ -[package] -name = "polkadot-runtime" -version = "0.1.0" -authors = ["Parity Technologies "] - -[dependencies] -substrate-codec = { path = "../codec", version = "0.1" } -substrate-runtime-std = { path = "../runtime-std", version = "0.1" } -substrate-runtime-io = { path = "../runtime-io", version = "0.1" } -substrate-primitives = { path = "../primitives", version = "0.1" } -polkadot-primitives = { path = "../polkadot-primitives", version = "0.1" } -rustc-hex = "1.0" -hex-literal = "0.1.0" -log = { version = "0.3", optional = true } - -[features] -default = ["std"] -std = ["substrate-codec/std", "substrate-runtime-std/std", "substrate-runtime-io/std", "substrate-primitives/std", "polkadot-primitives/std", "log"] diff --git a/polkadot-runtime/wasm/Cargo.toml b/polkadot-runtime/wasm/Cargo.toml deleted file mode 100644 index 054d05c658463..0000000000000 --- a/polkadot-runtime/wasm/Cargo.toml +++ /dev/null @@ -1,24 +0,0 @@ -[package] -name = "polkadot-runtime" -version = "0.1.0" -authors = ["Parity Technologies "] - -[lib] -crate-type = ["cdylib"] - -[dependencies] -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-primitives = { path = "../../primitives", default-features = false } -polkadot-primitives = { path = "../../polkadot-primitives", default-features = false } - -[features] -default = [] -std = ["substrate-codec/std", "substrate-runtime-io/std", "substrate-runtime-std/std", "substrate-primitives/std", "polkadot-primitives/std"] - -[profile.release] -panic = "abort" - -[workspace] -members = [] diff --git a/polkadot-validator/Cargo.toml b/polkadot-validator/Cargo.toml deleted file mode 100644 index a95f6798ae02f..0000000000000 --- a/polkadot-validator/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "polkadot-validator" -version = "0.1.0" -authors = ["Parity Technologies "] - -[dependencies] -error-chain = "0.11" -substrate-primitives = { path = "../primitives" } -polkadot-primitives = { path = "../polkadot-primitives" } -substrate-serializer = { path = "../serializer" } -serde = "1.0" diff --git a/polkadot-candidate-agreement/Cargo.toml b/polkadot/candidate-agreement/Cargo.toml similarity index 100% rename from polkadot-candidate-agreement/Cargo.toml rename to polkadot/candidate-agreement/Cargo.toml diff --git a/polkadot-candidate-agreement/src/bft/accumulator.rs b/polkadot/candidate-agreement/src/bft/accumulator.rs similarity index 100% rename from polkadot-candidate-agreement/src/bft/accumulator.rs rename to polkadot/candidate-agreement/src/bft/accumulator.rs diff --git a/polkadot-candidate-agreement/src/bft/mod.rs b/polkadot/candidate-agreement/src/bft/mod.rs similarity index 100% rename from polkadot-candidate-agreement/src/bft/mod.rs rename to polkadot/candidate-agreement/src/bft/mod.rs diff --git a/polkadot-candidate-agreement/src/bft/tests.rs b/polkadot/candidate-agreement/src/bft/tests.rs similarity index 100% rename from polkadot-candidate-agreement/src/bft/tests.rs rename to polkadot/candidate-agreement/src/bft/tests.rs diff --git a/polkadot-candidate-agreement/src/handle_incoming.rs b/polkadot/candidate-agreement/src/handle_incoming.rs similarity index 100% rename from polkadot-candidate-agreement/src/handle_incoming.rs rename to polkadot/candidate-agreement/src/handle_incoming.rs diff --git a/polkadot-candidate-agreement/src/lib.rs b/polkadot/candidate-agreement/src/lib.rs similarity index 100% rename from polkadot-candidate-agreement/src/lib.rs rename to polkadot/candidate-agreement/src/lib.rs diff --git a/polkadot-candidate-agreement/src/round_robin.rs b/polkadot/candidate-agreement/src/round_robin.rs similarity index 100% rename from polkadot-candidate-agreement/src/round_robin.rs rename to polkadot/candidate-agreement/src/round_robin.rs diff --git a/polkadot-candidate-agreement/src/table.rs b/polkadot/candidate-agreement/src/table.rs similarity index 100% rename from polkadot-candidate-agreement/src/table.rs rename to polkadot/candidate-agreement/src/table.rs diff --git a/polkadot-candidate-agreement/src/tests/mod.rs b/polkadot/candidate-agreement/src/tests/mod.rs similarity index 100% rename from polkadot-candidate-agreement/src/tests/mod.rs rename to polkadot/candidate-agreement/src/tests/mod.rs diff --git a/polkadot/cli/Cargo.toml b/polkadot/cli/Cargo.toml new file mode 100644 index 0000000000000..4bb48abf2b886 --- /dev/null +++ b/polkadot/cli/Cargo.toml @@ -0,0 +1,24 @@ +[package] +name = "polkadot-cli" +version = "0.1.0" +authors = ["Parity Technologies "] +description = "Polkadot node implementation in Rust." + +[dependencies] +clap = { version = "2.27", features = ["yaml"] } +env_logger = "0.4" +error-chain = "0.11" +log = "0.3" +hex-literal = "0.1" +triehash = "0.1" +ed25519 = { path = "../../substrate/ed25519" } +substrate-client = { path = "../../substrate/client" } +substrate-codec = { path = "../../substrate/codec" } +substrate-runtime-io = { path = "../../substrate/runtime-io" } +substrate-state-machine = { path = "../../substrate/state-machine" } +substrate-executor = { path = "../../substrate/executor" } +substrate-primitives = { path = "../../substrate/primitives" } +substrate-rpc-servers = { path = "../../substrate/rpc-servers" } +polkadot-primitives = { path = "../primitives" } +polkadot-executor = { path = "../executor" } +polkadot-runtime = { path = "../runtime" } diff --git a/polkadot-cli/src/cli.yml b/polkadot/cli/src/cli.yml similarity index 100% rename from polkadot-cli/src/cli.yml rename to polkadot/cli/src/cli.yml diff --git a/polkadot-cli/src/error.rs b/polkadot/cli/src/error.rs similarity index 100% rename from polkadot-cli/src/error.rs rename to polkadot/cli/src/error.rs diff --git a/polkadot-cli/src/genesis.rs b/polkadot/cli/src/genesis.rs similarity index 100% rename from polkadot-cli/src/genesis.rs rename to polkadot/cli/src/genesis.rs diff --git a/polkadot-cli/src/lib.rs b/polkadot/cli/src/lib.rs similarity index 100% rename from polkadot-cli/src/lib.rs rename to polkadot/cli/src/lib.rs diff --git a/polkadot-collator/Cargo.toml b/polkadot/collator/Cargo.toml similarity index 56% rename from polkadot-collator/Cargo.toml rename to polkadot/collator/Cargo.toml index e4a91cab66590..6f1fa1630228f 100644 --- a/polkadot-collator/Cargo.toml +++ b/polkadot/collator/Cargo.toml @@ -5,6 +5,6 @@ authors = ["Parity Technologies "] description = "Abstract collation logic" [dependencies] -substrate-primitives = { path = "../primitives", version = "0.1" } -polkadot-primitives = { path = "../polkadot-primitives", version = "0.1" } futures = "0.1.17" +substrate-primitives = { path = "../../substrate/primitives", version = "0.1" } +polkadot-primitives = { path = "../primitives", version = "0.1" } diff --git a/polkadot-collator/src/lib.rs b/polkadot/collator/src/lib.rs similarity index 100% rename from polkadot-collator/src/lib.rs rename to polkadot/collator/src/lib.rs diff --git a/polkadot/executor/Cargo.toml b/polkadot/executor/Cargo.toml new file mode 100644 index 0000000000000..2c268ad51db88 --- /dev/null +++ b/polkadot/executor/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "polkadot-executor" +version = "0.1.0" +authors = ["Parity Technologies "] +description = "Polkadot node implementation in Rust." + +[dependencies] +hex-literal = "0.1" +triehash = { version = "0.1" } +ed25519 = { path = "../../substrate/ed25519" } +substrate-codec = { path = "../../substrate/codec" } +substrate-runtime-io = { path = "../../substrate/runtime-io" } +substrate-state-machine = { path = "../../substrate/state-machine" } +substrate-executor = { path = "../../substrate/executor" } +substrate-primitives = { path = "../../substrate/primitives" } +polkadot-primitives = { path = "../primitives" } +polkadot-runtime = { path = "../runtime" } diff --git a/polkadot-executor/src/lib.rs b/polkadot/executor/src/lib.rs similarity index 93% rename from polkadot-executor/src/lib.rs rename to polkadot/executor/src/lib.rs index 0c6c0fb37ee31..1c2ec994b61fb 100644 --- a/polkadot-executor/src/lib.rs +++ b/polkadot/executor/src/lib.rs @@ -40,7 +40,7 @@ impl NativeExecutionDispatch for LocalNativeExecutionDispatch { fn native_equivalent() -> &'static [u8] { // WARNING!!! This assumes that the runtime was built *before* the main project. Until we // get a proper build script, this must be strictly adhered to or things will go wrong. - include_bytes!("../../polkadot-runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.compact.wasm") + include_bytes!("../../runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.compact.wasm") } fn dispatch(method: &str, data: &[u8]) -> Option> { @@ -67,8 +67,8 @@ mod tests { UncheckedTransaction, Function, AccountId}; use ed25519::Pair; - const BLOATY_CODE: &[u8] = include_bytes!("../../polkadot-runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.wasm"); - const COMPACT_CODE: &[u8] = include_bytes!("../../polkadot-runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.compact.wasm"); + const BLOATY_CODE: &[u8] = include_bytes!("../../runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.wasm"); + const COMPACT_CODE: &[u8] = include_bytes!("../../runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.compact.wasm"); // TODO: move into own crate. macro_rules! map { @@ -289,7 +289,7 @@ mod tests { twox_128(&one.to_keyed_vec(b"sta:bal:")).to_vec() => vec![68u8, 0, 0, 0, 0, 0, 0, 0] ], }; - let foreign_code = include_bytes!("../../polkadot-runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.wasm"); + let foreign_code = include_bytes!("../../runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.wasm"); let r = WasmExecutor.call(&mut t, &foreign_code[..], "execute_transaction", &vec![].join(&Header::from_block_number(1u64)).join(&tx())); assert!(r.is_err()); } @@ -303,7 +303,7 @@ mod tests { twox_128(&one.to_keyed_vec(b"sta:bal:")).to_vec() => vec![111u8, 0, 0, 0, 0, 0, 0, 0] ], }; - let foreign_code = include_bytes!("../../polkadot-runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.compact.wasm"); + let foreign_code = include_bytes!("../../runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.compact.wasm"); let r = WasmExecutor.call(&mut t, &foreign_code[..], "execute_transaction", &vec![].join(&Header::from_block_number(1u64)).join(&tx())); assert!(r.is_ok()); diff --git a/network/Cargo.toml b/polkadot/network/Cargo.toml similarity index 66% rename from network/Cargo.toml rename to polkadot/network/Cargo.toml index 39e88c97dbcff..e016be7d3010f 100644 --- a/network/Cargo.toml +++ b/polkadot/network/Cargo.toml @@ -8,12 +8,6 @@ authors = ["Parity Technologies "] [lib] [dependencies] -ethcore-network = { git = "https://github.com/paritytech/parity.git" } -ethcore-io = { git = "https://github.com/paritytech/parity.git" } -substrate-primitives = { path = "../primitives" } -substrate-client = { path = "../client" } -substrate-state-machine = { path = "../state-machine" } -substrate-serializer = { path = "../serializer" } log = "0.3" env_logger = "0.4" rand = "0.3" @@ -27,4 +21,10 @@ bitflags = "1.0" serde = "1.0" serde_derive = "1.0" serde_json = "1.0" -polkadot-primitives = { path = "../polkadot-primitives" } +ethcore-network = { git = "https://github.com/paritytech/parity.git" } +ethcore-io = { git = "https://github.com/paritytech/parity.git" } +substrate-primitives = { path = "../../substrate/primitives" } +substrate-client = { path = "../../substrate/client" } +substrate-state-machine = { path = "../../substrate/state-machine" } +substrate-serializer = { path = "../../substrate/serializer" } +polkadot-primitives = { path = "../primitives" } diff --git a/network/src/blocks.rs b/polkadot/network/src/blocks.rs similarity index 100% rename from network/src/blocks.rs rename to polkadot/network/src/blocks.rs diff --git a/network/src/chain.rs b/polkadot/network/src/chain.rs similarity index 100% rename from network/src/chain.rs rename to polkadot/network/src/chain.rs diff --git a/network/src/config.rs b/polkadot/network/src/config.rs similarity index 100% rename from network/src/config.rs rename to polkadot/network/src/config.rs diff --git a/network/src/error.rs b/polkadot/network/src/error.rs similarity index 100% rename from network/src/error.rs rename to polkadot/network/src/error.rs diff --git a/network/src/io.rs b/polkadot/network/src/io.rs similarity index 100% rename from network/src/io.rs rename to polkadot/network/src/io.rs diff --git a/network/src/lib.rs b/polkadot/network/src/lib.rs similarity index 100% rename from network/src/lib.rs rename to polkadot/network/src/lib.rs diff --git a/network/src/message.rs b/polkadot/network/src/message.rs similarity index 100% rename from network/src/message.rs rename to polkadot/network/src/message.rs diff --git a/network/src/protocol.rs b/polkadot/network/src/protocol.rs similarity index 100% rename from network/src/protocol.rs rename to polkadot/network/src/protocol.rs diff --git a/network/src/service.rs b/polkadot/network/src/service.rs similarity index 100% rename from network/src/service.rs rename to polkadot/network/src/service.rs diff --git a/network/src/sync.rs b/polkadot/network/src/sync.rs similarity index 100% rename from network/src/sync.rs rename to polkadot/network/src/sync.rs diff --git a/network/src/test/mod.rs b/polkadot/network/src/test/mod.rs similarity index 100% rename from network/src/test/mod.rs rename to polkadot/network/src/test/mod.rs diff --git a/polkadot-primitives/Cargo.toml b/polkadot/primitives/Cargo.toml similarity index 57% rename from polkadot-primitives/Cargo.toml rename to polkadot/primitives/Cargo.toml index dde8e9d476f59..ec2433c9a7935 100644 --- a/polkadot-primitives/Cargo.toml +++ b/polkadot/primitives/Cargo.toml @@ -6,12 +6,12 @@ authors = ["Parity Technologies "] [dependencies] serde = { version = "1.0", default_features = false } serde_derive = { version = "1.0", optional = true } -substrate-codec = { path = "../codec", default_features = false } -substrate-primitives = { path = "../primitives", default_features = false } -substrate-runtime-std = { path = "../runtime-std", default_features = false } +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 } [dev-dependencies] -substrate-serializer = { path = "../serializer" } +substrate-serializer = { path = "../../substrate/serializer" } pretty_assertions = "0.4" [features] diff --git a/polkadot-primitives/src/block.rs b/polkadot/primitives/src/block.rs similarity index 100% rename from polkadot-primitives/src/block.rs rename to polkadot/primitives/src/block.rs diff --git a/polkadot-primitives/src/lib.rs b/polkadot/primitives/src/lib.rs similarity index 100% rename from polkadot-primitives/src/lib.rs rename to polkadot/primitives/src/lib.rs diff --git a/polkadot-primitives/src/parachain.rs b/polkadot/primitives/src/parachain.rs similarity index 100% rename from polkadot-primitives/src/parachain.rs rename to polkadot/primitives/src/parachain.rs diff --git a/polkadot-primitives/src/transaction.rs b/polkadot/primitives/src/transaction.rs similarity index 100% rename from polkadot-primitives/src/transaction.rs rename to polkadot/primitives/src/transaction.rs diff --git a/polkadot-primitives/src/validator.rs b/polkadot/primitives/src/validator.rs similarity index 100% rename from polkadot-primitives/src/validator.rs rename to polkadot/primitives/src/validator.rs diff --git a/polkadot/runtime/Cargo.toml b/polkadot/runtime/Cargo.toml new file mode 100644 index 0000000000000..d3b3cfb34f05c --- /dev/null +++ b/polkadot/runtime/Cargo.toml @@ -0,0 +1,25 @@ +[package] +name = "polkadot-runtime" +version = "0.1.0" +authors = ["Parity Technologies "] + +[dependencies] +rustc-hex = "1.0" +hex-literal = "0.1.0" +log = { version = "0.3", optional = true } +substrate-codec = { path = "../../substrate/codec" } +substrate-runtime-std = { path = "../../substrate/runtime-std" } +substrate-runtime-io = { path = "../../substrate/runtime-io" } +substrate-primitives = { path = "../../substrate/primitives" } +polkadot-primitives = { path = "../primitives" } + +[features] +default = ["std"] +std = [ + "substrate-codec/std", + "substrate-runtime-std/std", + "substrate-runtime-io/std", + "substrate-primitives/std", + "polkadot-primitives/std", + "log" +] diff --git a/polkadot-runtime/src/genesismap.rs b/polkadot/runtime/src/genesismap.rs similarity index 100% rename from polkadot-runtime/src/genesismap.rs rename to polkadot/runtime/src/genesismap.rs diff --git a/polkadot-runtime/src/lib.rs b/polkadot/runtime/src/lib.rs similarity index 100% rename from polkadot-runtime/src/lib.rs rename to polkadot/runtime/src/lib.rs diff --git a/polkadot-runtime/src/runtime/consensus.rs b/polkadot/runtime/src/runtime/consensus.rs similarity index 100% rename from polkadot-runtime/src/runtime/consensus.rs rename to polkadot/runtime/src/runtime/consensus.rs diff --git a/polkadot-runtime/src/runtime/governance.rs b/polkadot/runtime/src/runtime/governance.rs similarity index 100% rename from polkadot-runtime/src/runtime/governance.rs rename to polkadot/runtime/src/runtime/governance.rs diff --git a/polkadot-runtime/src/runtime/mod.rs b/polkadot/runtime/src/runtime/mod.rs similarity index 100% rename from polkadot-runtime/src/runtime/mod.rs rename to polkadot/runtime/src/runtime/mod.rs diff --git a/polkadot-runtime/src/runtime/parachains.rs b/polkadot/runtime/src/runtime/parachains.rs similarity index 100% rename from polkadot-runtime/src/runtime/parachains.rs rename to polkadot/runtime/src/runtime/parachains.rs diff --git a/polkadot-runtime/src/runtime/session.rs b/polkadot/runtime/src/runtime/session.rs similarity index 100% rename from polkadot-runtime/src/runtime/session.rs rename to polkadot/runtime/src/runtime/session.rs diff --git a/polkadot-runtime/src/runtime/staking.rs b/polkadot/runtime/src/runtime/staking.rs similarity index 100% rename from polkadot-runtime/src/runtime/staking.rs rename to polkadot/runtime/src/runtime/staking.rs diff --git a/polkadot-runtime/src/runtime/system.rs b/polkadot/runtime/src/runtime/system.rs similarity index 100% rename from polkadot-runtime/src/runtime/system.rs rename to polkadot/runtime/src/runtime/system.rs diff --git a/polkadot-runtime/src/runtime/timestamp.rs b/polkadot/runtime/src/runtime/timestamp.rs similarity index 100% rename from polkadot-runtime/src/runtime/timestamp.rs rename to polkadot/runtime/src/runtime/timestamp.rs diff --git a/polkadot-runtime/src/support/environment.rs b/polkadot/runtime/src/support/environment.rs similarity index 100% rename from polkadot-runtime/src/support/environment.rs rename to polkadot/runtime/src/support/environment.rs diff --git a/polkadot-runtime/src/support/hashable.rs b/polkadot/runtime/src/support/hashable.rs similarity index 100% rename from polkadot-runtime/src/support/hashable.rs rename to polkadot/runtime/src/support/hashable.rs diff --git a/polkadot-runtime/src/support/mod.rs b/polkadot/runtime/src/support/mod.rs similarity index 100% rename from polkadot-runtime/src/support/mod.rs rename to polkadot/runtime/src/support/mod.rs diff --git a/polkadot-runtime/src/support/statichex.rs b/polkadot/runtime/src/support/statichex.rs similarity index 100% rename from polkadot-runtime/src/support/statichex.rs rename to polkadot/runtime/src/support/statichex.rs diff --git a/polkadot-runtime/src/support/storage.rs b/polkadot/runtime/src/support/storage.rs similarity index 100% rename from polkadot-runtime/src/support/storage.rs rename to polkadot/runtime/src/support/storage.rs diff --git a/polkadot-runtime/src/support/testing.rs b/polkadot/runtime/src/support/testing.rs similarity index 100% rename from polkadot-runtime/src/support/testing.rs rename to polkadot/runtime/src/support/testing.rs diff --git a/polkadot-runtime/wasm/Cargo.lock b/polkadot/runtime/wasm/Cargo.lock similarity index 100% rename from polkadot-runtime/wasm/Cargo.lock rename to polkadot/runtime/wasm/Cargo.lock diff --git a/polkadot/runtime/wasm/Cargo.toml b/polkadot/runtime/wasm/Cargo.toml new file mode 100644 index 0000000000000..10bfbc330f6a4 --- /dev/null +++ b/polkadot/runtime/wasm/Cargo.toml @@ -0,0 +1,30 @@ +[package] +name = "polkadot-runtime" +version = "0.1.0" +authors = ["Parity Technologies "] + +[lib] +crate-type = ["cdylib"] + +[dependencies] +substrate-codec = { path = "../../../substrate/codec", default-features = false } +substrate-runtime-std = { path = "../../../substrate/runtime-std", default-features = false } +substrate-runtime-io = { path = "../../../substrate/runtime-io", default-features = false } +substrate-primitives = { path = "../../../substrate/primitives", default-features = false } +polkadot-primitives = { path = "../../primitives", default-features = false } + +[features] +default = [] +std = [ + "substrate-codec/std", + "substrate-runtime-io/std", + "substrate-runtime-std/std", + "substrate-primitives/std", + "polkadot-primitives/std" +] + +[profile.release] +panic = "abort" + +[workspace] +members = [] diff --git a/polkadot-runtime/wasm/build.sh b/polkadot/runtime/wasm/build.sh similarity index 100% rename from polkadot-runtime/wasm/build.sh rename to polkadot/runtime/wasm/build.sh diff --git a/polkadot-runtime/wasm/genesis.wasm b/polkadot/runtime/wasm/genesis.wasm similarity index 100% rename from polkadot-runtime/wasm/genesis.wasm rename to polkadot/runtime/wasm/genesis.wasm diff --git a/polkadot-runtime/wasm/init.sh b/polkadot/runtime/wasm/init.sh similarity index 100% rename from polkadot-runtime/wasm/init.sh rename to polkadot/runtime/wasm/init.sh diff --git a/polkadot-runtime/wasm/src b/polkadot/runtime/wasm/src similarity index 100% rename from polkadot-runtime/wasm/src rename to polkadot/runtime/wasm/src diff --git a/polkadot-runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.compact.wasm b/polkadot/runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.compact.wasm similarity index 78% rename from polkadot-runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.compact.wasm rename to polkadot/runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.compact.wasm index 325669d0e06ee..3afbce2059eec 100644 Binary files a/polkadot-runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.compact.wasm and b/polkadot/runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.compact.wasm differ diff --git a/polkadot-runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.wasm b/polkadot/runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.wasm similarity index 78% rename from polkadot-runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.wasm rename to polkadot/runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.wasm index 91c7b475743cb..940a1e2910cf4 100644 Binary files a/polkadot-runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.wasm and b/polkadot/runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.wasm differ diff --git a/src/main.rs b/polkadot/src/main.rs similarity index 100% rename from src/main.rs rename to polkadot/src/main.rs diff --git a/polkadot/validator/Cargo.toml b/polkadot/validator/Cargo.toml new file mode 100644 index 0000000000000..204c356a99098 --- /dev/null +++ b/polkadot/validator/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "polkadot-validator" +version = "0.1.0" +authors = ["Parity Technologies "] + +[dependencies] +error-chain = "0.11" +serde = "1.0" +substrate-primitives = { path = "../../substrate/primitives" } +substrate-serializer = { path = "../../substrate/serializer" } +polkadot-primitives = { path = "../primitives" } diff --git a/polkadot-validator/src/error.rs b/polkadot/validator/src/error.rs similarity index 100% rename from polkadot-validator/src/error.rs rename to polkadot/validator/src/error.rs diff --git a/polkadot-validator/src/lib.rs b/polkadot/validator/src/lib.rs similarity index 100% rename from polkadot-validator/src/lib.rs rename to polkadot/validator/src/lib.rs diff --git a/polkadot-validator/src/parachains.rs b/polkadot/validator/src/parachains.rs similarity index 100% rename from polkadot-validator/src/parachains.rs rename to polkadot/validator/src/parachains.rs diff --git a/polkadot-validator/src/validator.rs b/polkadot/validator/src/validator.rs similarity index 100% rename from polkadot-validator/src/validator.rs rename to polkadot/validator/src/validator.rs diff --git a/client/Cargo.toml b/substrate/client/Cargo.toml similarity index 100% rename from client/Cargo.toml rename to substrate/client/Cargo.toml diff --git a/client/src/backend.rs b/substrate/client/src/backend.rs similarity index 100% rename from client/src/backend.rs rename to substrate/client/src/backend.rs diff --git a/client/src/blockchain.rs b/substrate/client/src/blockchain.rs similarity index 100% rename from client/src/blockchain.rs rename to substrate/client/src/blockchain.rs diff --git a/client/src/error.rs b/substrate/client/src/error.rs similarity index 100% rename from client/src/error.rs rename to substrate/client/src/error.rs diff --git a/client/src/in_mem.rs b/substrate/client/src/in_mem.rs similarity index 100% rename from client/src/in_mem.rs rename to substrate/client/src/in_mem.rs diff --git a/client/src/lib.rs b/substrate/client/src/lib.rs similarity index 100% rename from client/src/lib.rs rename to substrate/client/src/lib.rs diff --git a/codec/Cargo.toml b/substrate/codec/Cargo.toml similarity index 100% rename from codec/Cargo.toml rename to substrate/codec/Cargo.toml diff --git a/codec/src/endiansensitive.rs b/substrate/codec/src/endiansensitive.rs similarity index 100% rename from codec/src/endiansensitive.rs rename to substrate/codec/src/endiansensitive.rs diff --git a/codec/src/joiner.rs b/substrate/codec/src/joiner.rs similarity index 100% rename from codec/src/joiner.rs rename to substrate/codec/src/joiner.rs diff --git a/codec/src/keyedvec.rs b/substrate/codec/src/keyedvec.rs similarity index 100% rename from codec/src/keyedvec.rs rename to substrate/codec/src/keyedvec.rs diff --git a/codec/src/lib.rs b/substrate/codec/src/lib.rs similarity index 100% rename from codec/src/lib.rs rename to substrate/codec/src/lib.rs diff --git a/codec/src/slicable.rs b/substrate/codec/src/slicable.rs similarity index 100% rename from codec/src/slicable.rs rename to substrate/codec/src/slicable.rs diff --git a/ed25519/Cargo.toml b/substrate/ed25519/Cargo.toml similarity index 100% rename from ed25519/Cargo.toml rename to substrate/ed25519/Cargo.toml diff --git a/ed25519/src/lib.rs b/substrate/ed25519/src/lib.rs similarity index 100% rename from ed25519/src/lib.rs rename to substrate/ed25519/src/lib.rs diff --git a/environmental/Cargo.toml b/substrate/environmental/Cargo.toml similarity index 100% rename from environmental/Cargo.toml rename to substrate/environmental/Cargo.toml diff --git a/environmental/src/lib.rs b/substrate/environmental/src/lib.rs similarity index 100% rename from environmental/src/lib.rs rename to substrate/environmental/src/lib.rs diff --git a/executor/Cargo.toml b/substrate/executor/Cargo.toml similarity index 100% rename from executor/Cargo.toml rename to substrate/executor/Cargo.toml diff --git a/executor/src/error.rs b/substrate/executor/src/error.rs similarity index 100% rename from executor/src/error.rs rename to substrate/executor/src/error.rs diff --git a/executor/src/lib.rs b/substrate/executor/src/lib.rs similarity index 97% rename from executor/src/lib.rs rename to substrate/executor/src/lib.rs index 44656fab5bd5f..266373f2b2297 100644 --- a/executor/src/lib.rs +++ b/substrate/executor/src/lib.rs @@ -41,10 +41,6 @@ extern crate rustc_hex; extern crate triehash; #[macro_use] extern crate log; -#[cfg(test)] -#[macro_use] -extern crate hex_literal; - #[macro_use] extern crate error_chain; diff --git a/executor/src/native_executor.rs b/substrate/executor/src/native_executor.rs similarity index 96% rename from executor/src/native_executor.rs rename to substrate/executor/src/native_executor.rs index e7c9258063986..0ee6a66864be2 100644 --- a/executor/src/native_executor.rs +++ b/substrate/executor/src/native_executor.rs @@ -34,6 +34,7 @@ pub trait NativeExecutionDispatch { /// A generic `CodeExecutor` implementation that uses a delegate to determine wasm code equivalence /// and dispatch to native code when possible, falling back on `WasmExecutor` when not. pub struct NativeExecutor { + /// Dummy field to avoid the compiler complaining about us not using `D`. pub _dummy: ::std::marker::PhantomData, } diff --git a/executor/src/wasm_executor.rs b/substrate/executor/src/wasm_executor.rs similarity index 99% rename from executor/src/wasm_executor.rs rename to substrate/executor/src/wasm_executor.rs index 0a61a5b099709..e9ed255f1933c 100644 --- a/executor/src/wasm_executor.rs +++ b/substrate/executor/src/wasm_executor.rs @@ -330,11 +330,9 @@ impl CodeExecutor for WasmExecutor { mod tests { use super::*; use rustc_hex::FromHex; - use codec::{KeyedVec, Slicable, Joiner}; + use codec::{Slicable, Joiner}; use state_machine::TestExternalities; - use primitives::{twox_128, Header}; - use runtime_io; - use ed25519::Pair; + use primitives::Header; #[test] fn returning_should_work() { diff --git a/executor/src/wasm_utils.rs b/substrate/executor/src/wasm_utils.rs similarity index 100% rename from executor/src/wasm_utils.rs rename to substrate/executor/src/wasm_utils.rs diff --git a/executor/wasm/Cargo.lock b/substrate/executor/wasm/Cargo.lock similarity index 100% rename from executor/wasm/Cargo.lock rename to substrate/executor/wasm/Cargo.lock diff --git a/executor/wasm/Cargo.toml b/substrate/executor/wasm/Cargo.toml similarity index 100% rename from executor/wasm/Cargo.toml rename to substrate/executor/wasm/Cargo.toml diff --git a/executor/wasm/build.sh b/substrate/executor/wasm/build.sh similarity index 100% rename from executor/wasm/build.sh rename to substrate/executor/wasm/build.sh diff --git a/executor/wasm/src/lib.rs b/substrate/executor/wasm/src/lib.rs similarity index 100% rename from executor/wasm/src/lib.rs rename to substrate/executor/wasm/src/lib.rs diff --git a/executor/wasm/target/wasm32-unknown-unknown/release/runtime_test.compact.wasm b/substrate/executor/wasm/target/wasm32-unknown-unknown/release/runtime_test.compact.wasm similarity index 100% rename from executor/wasm/target/wasm32-unknown-unknown/release/runtime_test.compact.wasm rename to substrate/executor/wasm/target/wasm32-unknown-unknown/release/runtime_test.compact.wasm 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 new file mode 100644 index 0000000000000..b3e3b8389158f Binary files /dev/null and b/substrate/executor/wasm/target/wasm32-unknown-unknown/release/runtime_test.wasm differ diff --git a/primitives/Cargo.toml b/substrate/primitives/Cargo.toml similarity index 100% rename from primitives/Cargo.toml rename to substrate/primitives/Cargo.toml diff --git a/primitives/src/block.rs b/substrate/primitives/src/block.rs similarity index 100% rename from primitives/src/block.rs rename to substrate/primitives/src/block.rs diff --git a/primitives/src/bytes.rs b/substrate/primitives/src/bytes.rs similarity index 100% rename from primitives/src/bytes.rs rename to substrate/primitives/src/bytes.rs diff --git a/primitives/src/hash.rs b/substrate/primitives/src/hash.rs similarity index 100% rename from primitives/src/hash.rs rename to substrate/primitives/src/hash.rs diff --git a/primitives/src/hashing.rs b/substrate/primitives/src/hashing.rs similarity index 100% rename from primitives/src/hashing.rs rename to substrate/primitives/src/hashing.rs diff --git a/primitives/src/hexdisplay.rs b/substrate/primitives/src/hexdisplay.rs similarity index 100% rename from primitives/src/hexdisplay.rs rename to substrate/primitives/src/hexdisplay.rs diff --git a/primitives/src/lib.rs b/substrate/primitives/src/lib.rs similarity index 100% rename from primitives/src/lib.rs rename to substrate/primitives/src/lib.rs diff --git a/primitives/src/storage.rs b/substrate/primitives/src/storage.rs similarity index 100% rename from primitives/src/storage.rs rename to substrate/primitives/src/storage.rs diff --git a/primitives/src/tests.rs b/substrate/primitives/src/tests.rs similarity index 100% rename from primitives/src/tests.rs rename to substrate/primitives/src/tests.rs diff --git a/primitives/src/uint.rs b/substrate/primitives/src/uint.rs similarity index 100% rename from primitives/src/uint.rs rename to substrate/primitives/src/uint.rs diff --git a/pwasm-alloc/Cargo.toml b/substrate/pwasm-alloc/Cargo.toml similarity index 100% rename from pwasm-alloc/Cargo.toml rename to substrate/pwasm-alloc/Cargo.toml diff --git a/pwasm-alloc/README.md b/substrate/pwasm-alloc/README.md similarity index 100% rename from pwasm-alloc/README.md rename to substrate/pwasm-alloc/README.md diff --git a/pwasm-alloc/build.rs b/substrate/pwasm-alloc/build.rs similarity index 100% rename from pwasm-alloc/build.rs rename to substrate/pwasm-alloc/build.rs diff --git a/pwasm-alloc/src/lib.rs b/substrate/pwasm-alloc/src/lib.rs similarity index 100% rename from pwasm-alloc/src/lib.rs rename to substrate/pwasm-alloc/src/lib.rs diff --git a/pwasm-libc/Cargo.toml b/substrate/pwasm-libc/Cargo.toml similarity index 100% rename from pwasm-libc/Cargo.toml rename to substrate/pwasm-libc/Cargo.toml diff --git a/pwasm-libc/README.md b/substrate/pwasm-libc/README.md similarity index 100% rename from pwasm-libc/README.md rename to substrate/pwasm-libc/README.md diff --git a/pwasm-libc/src/lib.rs b/substrate/pwasm-libc/src/lib.rs similarity index 100% rename from pwasm-libc/src/lib.rs rename to substrate/pwasm-libc/src/lib.rs diff --git a/rpc-servers/Cargo.toml b/substrate/rpc-servers/Cargo.toml similarity index 100% rename from rpc-servers/Cargo.toml rename to substrate/rpc-servers/Cargo.toml diff --git a/rpc-servers/src/lib.rs b/substrate/rpc-servers/src/lib.rs similarity index 100% rename from rpc-servers/src/lib.rs rename to substrate/rpc-servers/src/lib.rs diff --git a/rpc/Cargo.toml b/substrate/rpc/Cargo.toml similarity index 100% rename from rpc/Cargo.toml rename to substrate/rpc/Cargo.toml diff --git a/rpc/src/chain/error.rs b/substrate/rpc/src/chain/error.rs similarity index 100% rename from rpc/src/chain/error.rs rename to substrate/rpc/src/chain/error.rs diff --git a/rpc/src/chain/mod.rs b/substrate/rpc/src/chain/mod.rs similarity index 100% rename from rpc/src/chain/mod.rs rename to substrate/rpc/src/chain/mod.rs diff --git a/rpc/src/chain/tests.rs b/substrate/rpc/src/chain/tests.rs similarity index 100% rename from rpc/src/chain/tests.rs rename to substrate/rpc/src/chain/tests.rs diff --git a/rpc/src/lib.rs b/substrate/rpc/src/lib.rs similarity index 100% rename from rpc/src/lib.rs rename to substrate/rpc/src/lib.rs diff --git a/rpc/src/state/error.rs b/substrate/rpc/src/state/error.rs similarity index 100% rename from rpc/src/state/error.rs rename to substrate/rpc/src/state/error.rs diff --git a/rpc/src/state/mod.rs b/substrate/rpc/src/state/mod.rs similarity index 100% rename from rpc/src/state/mod.rs rename to substrate/rpc/src/state/mod.rs diff --git a/rpc/src/state/tests.rs b/substrate/rpc/src/state/tests.rs similarity index 100% rename from rpc/src/state/tests.rs rename to substrate/rpc/src/state/tests.rs diff --git a/runtime-io/Cargo.toml b/substrate/runtime-io/Cargo.toml similarity index 100% rename from runtime-io/Cargo.toml rename to substrate/runtime-io/Cargo.toml diff --git a/runtime-io/build.rs b/substrate/runtime-io/build.rs similarity index 100% rename from runtime-io/build.rs rename to substrate/runtime-io/build.rs diff --git a/runtime-io/src/lib.rs b/substrate/runtime-io/src/lib.rs similarity index 100% rename from runtime-io/src/lib.rs rename to substrate/runtime-io/src/lib.rs diff --git a/runtime-io/with_std.rs b/substrate/runtime-io/with_std.rs similarity index 100% rename from runtime-io/with_std.rs rename to substrate/runtime-io/with_std.rs diff --git a/runtime-io/without_std.rs b/substrate/runtime-io/without_std.rs similarity index 100% rename from runtime-io/without_std.rs rename to substrate/runtime-io/without_std.rs diff --git a/runtime-std/Cargo.toml b/substrate/runtime-std/Cargo.toml similarity index 100% rename from runtime-std/Cargo.toml rename to substrate/runtime-std/Cargo.toml diff --git a/runtime-std/build.rs b/substrate/runtime-std/build.rs similarity index 100% rename from runtime-std/build.rs rename to substrate/runtime-std/build.rs diff --git a/runtime-std/src/lib.rs b/substrate/runtime-std/src/lib.rs similarity index 100% rename from runtime-std/src/lib.rs rename to substrate/runtime-std/src/lib.rs diff --git a/runtime-std/with_std.rs b/substrate/runtime-std/with_std.rs similarity index 100% rename from runtime-std/with_std.rs rename to substrate/runtime-std/with_std.rs diff --git a/runtime-std/without_std.rs b/substrate/runtime-std/without_std.rs similarity index 100% rename from runtime-std/without_std.rs rename to substrate/runtime-std/without_std.rs diff --git a/serializer/Cargo.toml b/substrate/serializer/Cargo.toml similarity index 100% rename from serializer/Cargo.toml rename to substrate/serializer/Cargo.toml diff --git a/serializer/src/lib.rs b/substrate/serializer/src/lib.rs similarity index 100% rename from serializer/src/lib.rs rename to substrate/serializer/src/lib.rs diff --git a/state-machine/Cargo.toml b/substrate/state-machine/Cargo.toml similarity index 100% rename from state-machine/Cargo.toml rename to substrate/state-machine/Cargo.toml diff --git a/state-machine/src/backend.rs b/substrate/state-machine/src/backend.rs similarity index 100% rename from state-machine/src/backend.rs rename to substrate/state-machine/src/backend.rs diff --git a/state-machine/src/ext.rs b/substrate/state-machine/src/ext.rs similarity index 100% rename from state-machine/src/ext.rs rename to substrate/state-machine/src/ext.rs diff --git a/state-machine/src/lib.rs b/substrate/state-machine/src/lib.rs similarity index 100% rename from state-machine/src/lib.rs rename to substrate/state-machine/src/lib.rs diff --git a/state-machine/src/testing.rs b/substrate/state-machine/src/testing.rs similarity index 100% rename from state-machine/src/testing.rs rename to substrate/state-machine/src/testing.rs