From 1b7f34bef2b3819d7ad4f11c88195e3b681fcd59 Mon Sep 17 00:00:00 2001 From: Gav Date: Wed, 7 Feb 2018 11:03:43 +0100 Subject: [PATCH 01/15] Refactor primitives. --- substrate/Cargo.lock | 18 +++++----- substrate/Cargo.toml | 2 +- substrate/client/Cargo.toml | 2 +- substrate/client/src/genesis.rs | 4 +-- substrate/client/src/lib.rs | 2 +- substrate/{runtime-codec => codec}/Cargo.toml | 2 +- .../src/endiansensitive.rs | 0 .../{runtime-codec => codec}/src/joiner.rs | 0 .../{runtime-codec => codec}/src/keyedvec.rs | 0 substrate/{runtime-codec => codec}/src/lib.rs | 0 .../{runtime-codec => codec}/src/slicable.rs | 0 substrate/collator/src/lib.rs | 2 +- substrate/ed25519/src/lib.rs | 5 ++- substrate/executor/Cargo.toml | 2 +- substrate/executor/src/lib.rs | 2 +- substrate/executor/src/native_executor.rs | 7 ++-- substrate/executor/src/wasm_executor.rs | 4 +-- substrate/native-runtime/Cargo.toml | 4 +-- substrate/network/src/message.rs | 3 +- substrate/primitives/Cargo.toml | 4 +-- substrate/primitives/src/lib.rs | 33 +------------------ substrate/primitives/src/parachain.rs | 8 ++--- substrate/primitives/src/relay/mod.rs | 24 ++++++++++++++ substrate/primitives/src/relay/transaction.rs | 12 +++---- substrate/primitives/src/tests.rs | 5 +-- substrate/runtime-std/Cargo.toml | 4 +-- substrate/runtime-std/src/lib.rs | 7 ++-- substrate/wasm-runtime/Cargo.lock | 14 ++++---- substrate/wasm-runtime/polkadot/Cargo.toml | 4 +-- substrate/wasm-runtime/polkadot/src/lib.rs | 2 +- .../polkadot/src/runtime/consensus.rs | 2 +- .../polkadot/src/runtime/genesismap.rs | 3 +- .../polkadot/src/runtime/governance.rs | 6 ++-- .../polkadot/src/runtime/session.rs | 4 +-- .../polkadot/src/runtime/staking.rs | 4 +-- .../polkadot/src/runtime/system.rs | 4 +-- .../polkadot/src/runtime/timestamp.rs | 3 +- .../polkadot/src/support/environment.rs | 3 +- .../polkadot/src/support/testing.rs | 2 +- 39 files changed, 99 insertions(+), 108 deletions(-) rename substrate/{runtime-codec => codec}/Cargo.toml (86%) rename substrate/{runtime-codec => codec}/src/endiansensitive.rs (100%) rename substrate/{runtime-codec => codec}/src/joiner.rs (100%) rename substrate/{runtime-codec => codec}/src/keyedvec.rs (100%) rename substrate/{runtime-codec => codec}/src/lib.rs (100%) rename substrate/{runtime-codec => codec}/src/slicable.rs (100%) diff --git a/substrate/Cargo.lock b/substrate/Cargo.lock index 2509a54917..24234565d2 100644 --- a/substrate/Cargo.lock +++ b/substrate/Cargo.lock @@ -827,8 +827,8 @@ version = "0.1.0" dependencies = [ "hex-literal 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "polkadot-codec 0.1.0", "polkadot-primitives 0.1.0", - "polkadot-runtime-codec 0.1.0", "polkadot-runtime-std 0.1.0", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1003,14 +1003,18 @@ dependencies = [ "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "native-runtime 0.1.0", "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "polkadot-codec 0.1.0", "polkadot-executor 0.1.0", "polkadot-primitives 0.1.0", - "polkadot-runtime-codec 0.1.0", "polkadot-serializer 0.1.0", "polkadot-state-machine 0.1.0", "triehash 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "polkadot-codec" +version = "0.1.0" + [[package]] name = "polkadot-collator" version = "0.1.0" @@ -1031,8 +1035,8 @@ dependencies = [ "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "native-runtime 0.1.0", "parity-wasm 0.15.4 (registry+https://github.com/rust-lang/crates.io-index)", + "polkadot-codec 0.1.0", "polkadot-primitives 0.1.0", - "polkadot-runtime-codec 0.1.0", "polkadot-runtime-std 0.1.0", "polkadot-serializer 0.1.0", "polkadot-state-machine 0.1.0", @@ -1075,7 +1079,7 @@ dependencies = [ "byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "fixed-hash 0.1.3 (git+https://github.com/rphmeier/primitives.git?branch=compile-for-wasm)", - "polkadot-runtime-codec 0.1.0", + "polkadot-codec 0.1.0", "polkadot-serializer 0.1.0", "pretty_assertions 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 2.0.0 (git+https://github.com/rphmeier/rustc-hex.git)", @@ -1108,18 +1112,14 @@ dependencies = [ "polkadot-rpc 0.1.0", ] -[[package]] -name = "polkadot-runtime-codec" -version = "0.1.0" - [[package]] name = "polkadot-runtime-std" version = "0.1.0" dependencies = [ "ed25519 0.1.0", "environmental 0.1.0", + "polkadot-codec 0.1.0", "polkadot-primitives 0.1.0", - "polkadot-runtime-codec 0.1.0", "polkadot-state-machine 0.1.0", "pwasm-alloc 0.1.0", "pwasm-libc 0.1.0", diff --git a/substrate/Cargo.toml b/substrate/Cargo.toml index 2c4d8703e9..04b654bfce 100644 --- a/substrate/Cargo.toml +++ b/substrate/Cargo.toml @@ -20,7 +20,7 @@ members = [ "primitives", "rpc-servers", "rpc", - "runtime-codec", + "codec", "runtime-std", "serializer", "state-machine", diff --git a/substrate/client/Cargo.toml b/substrate/client/Cargo.toml index f8221bef8e..7fe9621de7 100644 --- a/substrate/client/Cargo.toml +++ b/substrate/client/Cargo.toml @@ -11,7 +11,7 @@ polkadot-primitives = { path = "../primitives", version = "0.1" } polkadot-state-machine = { path = "../state-machine", version = "0.1" } polkadot-serializer = { path = "../serializer" } polkadot-executor = { path = "../executor" } -polkadot-runtime-codec = { path = "../runtime-codec", version = "0.1" } +polkadot-codec = { path = "../codec", version = "0.1" } native-runtime = { path = "../native-runtime" } triehash = "0.1" hex-literal = "0.1" diff --git a/substrate/client/src/genesis.rs b/substrate/client/src/genesis.rs index b2781668dd..a288bec4e5 100644 --- a/substrate/client/src/genesis.rs +++ b/substrate/client/src/genesis.rs @@ -46,8 +46,8 @@ mod tests { use state_machine::OverlayedChanges; use state_machine::backend::InMemory; use polkadot_executor::executor; - use primitives::{AccountId, Hash}; - use primitives::relay::{BlockNumber, Header, Digest, UncheckedTransaction, Transaction, Function}; + use primitives::relay::{AccountId, Hash, BlockNumber, Header, Digest, UncheckedTransaction, + Transaction, Function}; use primitives::contract::CallData; use ed25519::Pair; diff --git a/substrate/client/src/lib.rs b/substrate/client/src/lib.rs index 591c216145..e97c93dd39 100644 --- a/substrate/client/src/lib.rs +++ b/substrate/client/src/lib.rs @@ -21,7 +21,7 @@ extern crate polkadot_primitives as primitives; extern crate polkadot_state_machine as state_machine; extern crate polkadot_serializer as ser; -extern crate polkadot_runtime_codec as codec; +extern crate polkadot_codec as codec; extern crate polkadot_executor; extern crate native_runtime; extern crate ed25519; diff --git a/substrate/runtime-codec/Cargo.toml b/substrate/codec/Cargo.toml similarity index 86% rename from substrate/runtime-codec/Cargo.toml rename to substrate/codec/Cargo.toml index c85c9c0631..0cf0083d5f 100644 --- a/substrate/runtime-codec/Cargo.toml +++ b/substrate/codec/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "polkadot-runtime-codec" +name = "polkadot-codec" description = "Serialization and deserialization codec for runtime values" version = "0.1.0" authors = ["Parity Technologies "] diff --git a/substrate/runtime-codec/src/endiansensitive.rs b/substrate/codec/src/endiansensitive.rs similarity index 100% rename from substrate/runtime-codec/src/endiansensitive.rs rename to substrate/codec/src/endiansensitive.rs diff --git a/substrate/runtime-codec/src/joiner.rs b/substrate/codec/src/joiner.rs similarity index 100% rename from substrate/runtime-codec/src/joiner.rs rename to substrate/codec/src/joiner.rs diff --git a/substrate/runtime-codec/src/keyedvec.rs b/substrate/codec/src/keyedvec.rs similarity index 100% rename from substrate/runtime-codec/src/keyedvec.rs rename to substrate/codec/src/keyedvec.rs diff --git a/substrate/runtime-codec/src/lib.rs b/substrate/codec/src/lib.rs similarity index 100% rename from substrate/runtime-codec/src/lib.rs rename to substrate/codec/src/lib.rs diff --git a/substrate/runtime-codec/src/slicable.rs b/substrate/codec/src/slicable.rs similarity index 100% rename from substrate/runtime-codec/src/slicable.rs rename to substrate/codec/src/slicable.rs diff --git a/substrate/collator/src/lib.rs b/substrate/collator/src/lib.rs index 1752ecdb7e..044050e79b 100644 --- a/substrate/collator/src/lib.rs +++ b/substrate/collator/src/lib.rs @@ -60,7 +60,7 @@ pub trait ParachainContext { fn produce_candidate>( &self, ingress: I, - ) -> (parachain::BlockData, primitives::Signature); + ) -> (parachain::BlockData, primitives::relay::Signature); } /// Relay chain context needed to collate. diff --git a/substrate/ed25519/src/lib.rs b/substrate/ed25519/src/lib.rs index 9658b46d97..7f0bfae0ff 100644 --- a/substrate/ed25519/src/lib.rs +++ b/substrate/ed25519/src/lib.rs @@ -22,9 +22,12 @@ extern crate untrusted; extern crate rustc_hex; use ring::{rand, signature}; -use primitives::Signature; +use primitives::hash::H512; use rustc_hex::FromHex; +/// Alias to 520-bit hash when used in the context of a signature on the relay chain. +pub type Signature = H512; + /// Verify a message without type checking the parameters' types for the right size. pub fn verify(sig: &[u8], message: &[u8], public: &[u8]) -> bool { let public_key = untrusted::Input::from(public); diff --git a/substrate/executor/Cargo.toml b/substrate/executor/Cargo.toml index eb6e46e6e2..d51522c568 100644 --- a/substrate/executor/Cargo.toml +++ b/substrate/executor/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Parity Technologies "] [dependencies] error-chain = "0.11" -polkadot-runtime-codec = { path = "../runtime-codec", version = "0.1" } +polkadot-codec = { path = "../codec", version = "0.1" } polkadot-runtime-std = { path = "../runtime-std", version = "0.1" } polkadot-primitives = { path = "../primitives", version = "0.1" } polkadot-serializer = { path = "../serializer", version = "0.1" } diff --git a/substrate/executor/src/lib.rs b/substrate/executor/src/lib.rs index 27d26f7adb..1bd7a1db25 100644 --- a/substrate/executor/src/lib.rs +++ b/substrate/executor/src/lib.rs @@ -27,7 +27,7 @@ #![warn(missing_docs)] -extern crate polkadot_runtime_codec as codec; +extern crate polkadot_codec as codec; extern crate polkadot_runtime_std as runtime_std; extern crate polkadot_primitives as primitives; extern crate polkadot_serializer as serializer; diff --git a/substrate/executor/src/native_executor.rs b/substrate/executor/src/native_executor.rs index d2ea75413a..ea13ac6593 100644 --- a/substrate/executor/src/native_executor.rs +++ b/substrate/executor/src/native_executor.rs @@ -63,8 +63,9 @@ mod tests { use native_runtime::support::{one, two, Hashable}; use native_runtime::runtime::staking::balance; use state_machine::TestExternalities; - use primitives::{twox_128, Hash}; - use primitives::relay::{Header, BlockNumber, Block, Digest, Transaction, UncheckedTransaction, Function}; + use primitives::twox_128; + use primitives::relay::{Hash, Header, BlockNumber, Block, Digest, Transaction, + UncheckedTransaction, Function, AccountId}; use ed25519::Pair; const BLOATY_CODE: &[u8] = include_bytes!("../../wasm-runtime/target/wasm32-unknown-unknown/release/runtime_polkadot.wasm"); @@ -164,7 +165,7 @@ mod tests { ], } } - fn secret_for(who: &::primitives::AccountId) -> Option { + fn secret_for(who: &AccountId) -> Option { match who { x if *x == one() => Some(Pair::from_seed(b"12345678901234567890123456789012")), x if *x == two() => Some("9d61b19deffd5a60ba844af492ec2cc44449c5697b326919703bac031cae7f60".into()), diff --git a/substrate/executor/src/wasm_executor.rs b/substrate/executor/src/wasm_executor.rs index d8912c1703..6269675dad 100644 --- a/substrate/executor/src/wasm_executor.rs +++ b/substrate/executor/src/wasm_executor.rs @@ -293,8 +293,8 @@ mod tests { use native_runtime::support::{one, two}; use native_runtime::runtime::staking::balance; use state_machine::TestExternalities; - use primitives::{twox_128, AccountId}; - use primitives::relay::{Header, Transaction, UncheckedTransaction, Function}; + use primitives::twox_128; + use primitives::relay::{Header, Transaction, UncheckedTransaction, Function, AccountId}; use runtime_std; use ed25519::Pair; diff --git a/substrate/native-runtime/Cargo.toml b/substrate/native-runtime/Cargo.toml index a4052bf8de..e46823bbb0 100644 --- a/substrate/native-runtime/Cargo.toml +++ b/substrate/native-runtime/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" authors = ["Parity Technologies "] [dependencies] -polkadot-runtime-codec = { path = "../runtime-codec", version = "0.1" } +polkadot-codec = { path = "../codec", version = "0.1" } polkadot-runtime-std = { path = "../runtime-std", version = "0.1" } polkadot-primitives = { path = "../primitives", version = "0.1" } rustc-hex = "1.0" @@ -13,4 +13,4 @@ log = { version = "0.3", optional = true } [features] default = ["std"] -std = ["polkadot-runtime-codec/std", "polkadot-runtime-std/std", "polkadot-primitives/std", "log"] +std = ["polkadot-codec/std", "polkadot-runtime-std/std", "polkadot-primitives/std", "log"] diff --git a/substrate/network/src/message.rs b/substrate/network/src/message.rs index daa6b5520a..e3dce5b0f2 100644 --- a/substrate/network/src/message.rs +++ b/substrate/network/src/message.rs @@ -18,8 +18,7 @@ use std::borrow::Borrow; use primitives::parachain::Id as ParachainId; -use primitives::AccountId; -use primitives::relay::{BlockNumber, HeaderHash, Header, Body}; +use primitives::relay::{AccountId, BlockNumber, HeaderHash, Header, Body}; use service::Role as RoleFlags; pub type RequestId = u64; diff --git a/substrate/primitives/Cargo.toml b/substrate/primitives/Cargo.toml index 6e5a4bd0c4..d3ba1eec0f 100644 --- a/substrate/primitives/Cargo.toml +++ b/substrate/primitives/Cargo.toml @@ -13,7 +13,7 @@ uint = { git = "https://github.com/rphmeier/primitives.git", branch = "compile-f twox-hash = { version = "1.1.0", optional = true } byteorder = { version = "1.1", default_features = false } blake2-rfc = { version = "0.2.18", optional = true } -polkadot-runtime-codec = { path = "../runtime-codec", version = "0.1", default_features = false } +polkadot-codec = { path = "../codec", version = "0.1", default_features = false } [dev-dependencies] polkadot-serializer = { path = "../serializer", version = "0.1" } @@ -24,7 +24,7 @@ default = ["std"] std = [ "uint/std", "fixed-hash/std", - "polkadot-runtime-codec/std", + "polkadot-codec/std", "serde/std", "rustc-hex/std", "twox-hash", diff --git a/substrate/primitives/src/lib.rs b/substrate/primitives/src/lib.rs index e16aa8ef50..59728fb43c 100644 --- a/substrate/primitives/src/lib.rs +++ b/substrate/primitives/src/lib.rs @@ -43,7 +43,7 @@ extern crate uint as uint_crate; #[cfg(feature = "std")] extern crate core; -extern crate polkadot_runtime_codec as codec; +extern crate polkadot_codec as codec; #[cfg(test)] extern crate polkadot_serializer; #[cfg(test)] @@ -80,38 +80,7 @@ mod tests; pub mod hashing; pub use self::hash::{H160, H256}; -pub use self::relay::BlockNumber; pub use self::uint::{U256, U512}; #[cfg(feature = "std")] pub use hashing::{blake2_256, twox_128, twox_256}; - -/// Virtual account ID that represents the idea of a dispatch/statement being signed by everybody -/// (who matters). Essentially this means that a majority of validators have decided it is -/// "correct". -pub const EVERYBODY: AccountId = [255u8; 32]; - -/// Alias to Ed25519 pubkey that identifies an account. -pub type AccountId = [u8; 32]; - -/// The Ed25519 pub key of an session that belongs to an authority. This is used as what the -/// external environment/consensus algorithm calls an "authority". -pub type SessionKey = AccountId; - -/// Indentifier for a chain. -pub type ChainID = u64; - -/// Index of a transaction. -pub type TxOrder = u64; - -/// A hash of some data. -pub type Hash = hash::H256; - -/// Alias to 520-bit hash when used in the context of a signature. -pub type Signature = hash::H512; - -/// A balance in the staking subsystem. -pub type Balance = u64; - -/// A timestamp. -pub type Timestamp = u64; diff --git a/substrate/primitives/src/parachain.rs b/substrate/primitives/src/parachain.rs index 4b3f308a70..f7dac2fec0 100644 --- a/substrate/primitives/src/parachain.rs +++ b/substrate/primitives/src/parachain.rs @@ -54,7 +54,7 @@ pub struct Candidate { /// The ID of the parachain this is a proposal for. pub parachain_index: Id, /// Collator's signature - pub collator_signature: ::Signature, + pub collator_signature: ::relay::Signature, /// Unprocessed ingress queue. /// /// Ordered by parachain ID and block number. @@ -71,12 +71,12 @@ pub struct Candidate { pub struct CandidateReceipt { /// The ID of the parachain this is a candidate for. pub parachain_index: Id, - /// The collator's account ID - pub collator: ::AccountId, + /// The collator's relay-chain account ID + pub collator: ::relay::AccountId, /// The head-data pub head_data: HeadData, /// Balance uploads to the relay chain. - pub balance_uploads: Vec<(::AccountId, ::uint::U256)>, + pub balance_uploads: Vec<(::relay::AccountId, ::uint::U256)>, /// Egress queue roots. pub egress_queue_roots: Vec<(Id, ::hash::H256)>, /// Fees paid from the chain to the relay chain validators diff --git a/substrate/primitives/src/relay/mod.rs b/substrate/primitives/src/relay/mod.rs index c4f22ac55f..a7a5f3cff9 100644 --- a/substrate/primitives/src/relay/mod.rs +++ b/substrate/primitives/src/relay/mod.rs @@ -7,3 +7,27 @@ pub use self::block::*; pub use self::transaction::*; pub use self::block::Number as BlockNumber; + +/// Virtual account ID that represents the idea of a dispatch/statement being signed by everybody +/// (who matters). Essentially this means that a majority of validators have decided it is +/// "correct". +pub const EVERYBODY: AccountId = [255u8; 32]; + +/// Alias to Ed25519 pubkey that identifies an account on the relay chain. +pub type AccountId = [u8; 32]; + +/// The Ed25519 pub key of an session that belongs to an authority of the relay chain. This is +/// used as what the external environment/consensus algorithm calls an "authority". +pub type SessionKey = AccountId; + +/// Indentifier for a chain. +pub type ChainID = u64; + +/// Index of a transaction in the relay chain. +pub type TxOrder = u64; + +/// A hash of some data used by the relay chain. +pub type Hash = ::hash::H256; + +/// Alias to 520-bit hash when used in the context of a signature on the relay chain. +pub type Signature = ::hash::H512; diff --git a/substrate/primitives/src/relay/transaction.rs b/substrate/primitives/src/relay/transaction.rs index 1432693e6e..fc7216737e 100644 --- a/substrate/primitives/src/relay/transaction.rs +++ b/substrate/primitives/src/relay/transaction.rs @@ -205,15 +205,15 @@ impl FunctionId { #[cfg_attr(feature = "std", derive(Serialize, Deserialize))] pub enum Function { /// Set the timestamp. - TimestampSet(::Timestamp), + TimestampSet(u64), /// Set temporary session key as a validator. - SessionSetKey(::SessionKey), + SessionSetKey(::relay::SessionKey), /// Staking subsystem: begin staking. StakingStake, /// Staking subsystem: stop staking. StakingUnstake, /// Staking subsystem: transfer stake. - StakingTransfer(::AccountId, ::Balance), + StakingTransfer(::relay::AccountId, u64), /// Make a proposal for the governance system. GovernancePropose(Proposal), /// Approve a proposal for the governance system. @@ -288,9 +288,9 @@ impl Slicable for Function { #[cfg_attr(feature = "std", derive(Serialize, Deserialize))] pub struct Transaction { /// Who signed it (note this is not a signature). - pub signed: ::AccountId, + pub signed: super::AccountId, /// The number of transactions have come before from the same signer. - pub nonce: ::TxOrder, + pub nonce: super::TxOrder, /// The function that should be called. pub function: Function, } @@ -326,7 +326,7 @@ pub struct UncheckedTransaction { /// The actual transaction information. pub transaction: Transaction, /// The signature; should be an Ed25519 signature applied to the serialised `transaction` field. - pub signature: ::Signature, + pub signature: super::Signature, } impl Slicable for UncheckedTransaction { diff --git a/substrate/primitives/src/tests.rs b/substrate/primitives/src/tests.rs index 88710c4412..1dd8f4d3f8 100644 --- a/substrate/primitives/src/tests.rs +++ b/substrate/primitives/src/tests.rs @@ -17,10 +17,7 @@ //! Tests. use codec::Slicable; - -use ::AccountId; -use relay::block::{Block, Header, Digest, Log}; -use relay::transaction::{UncheckedTransaction, Transaction, Function}; +use relay::{AccountId, Block, Header, Digest, Log, UncheckedTransaction, Transaction, Function}; #[test] fn serialise_transaction_works() { diff --git a/substrate/runtime-std/Cargo.toml b/substrate/runtime-std/Cargo.toml index 7ecafc73ce..1822161c39 100644 --- a/substrate/runtime-std/Cargo.toml +++ b/substrate/runtime-std/Cargo.toml @@ -13,7 +13,7 @@ pwasm-libc = { path = "../wasm-runtime/pwasm-libc", version = "0.1" } environmental = { path = "../environmental", version = "0.1", optional = true } polkadot-state-machine = { path = "../state-machine", version = "0.1", optional = true } polkadot-primitives = { path = "../primitives", version = "0.1", default_features = false } -polkadot-runtime-codec = { path = "../runtime-codec", version = "0.1", default_features = false } +polkadot-codec = { path = "../codec", version = "0.1", default_features = false } triehash = { version = "0.1", optional = true } ed25519 = { path = "../ed25519", version = "0.1", optional = true } @@ -24,7 +24,7 @@ std = [ "polkadot-state-machine", "triehash", "polkadot-primitives/std", - "polkadot-runtime-codec/std", + "polkadot-codec/std", "ed25519", ] nightly = [] diff --git a/substrate/runtime-std/src/lib.rs b/substrate/runtime-std/src/lib.rs index 6cee2e3326..9fb2148b76 100644 --- a/substrate/runtime-std/src/lib.rs +++ b/substrate/runtime-std/src/lib.rs @@ -14,6 +14,8 @@ // You should have received a copy of the GNU General Public License // along with Polkadot. If not, see . +//! This is part of the Polkadot runtime. + #![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(not(feature = "std"), feature(lang_items))] #![cfg_attr(not(feature = "std"), feature(core_intrinsics))] @@ -22,7 +24,7 @@ #![cfg_attr(feature = "std", doc = "Polkadot runtime standard library as compiled when linked with Rust's standard library.")] #![cfg_attr(not(feature = "std"), doc = "Polkadot's runtime standard library as compiled without Rust's standard library.")] -extern crate polkadot_runtime_codec as codec; +extern crate polkadot_codec as codec; #[cfg(feature = "std")] include!("../with_std.rs"); @@ -41,7 +43,7 @@ pub mod prelude { /// Type definitions and helpers for transactions. pub mod transaction { pub use primitives::relay::{Transaction, UncheckedTransaction}; - use primitives::Signature; + use primitives::relay::Signature; #[cfg(feature = "std")] use std::ops; @@ -81,4 +83,3 @@ pub mod transaction { } } } - diff --git a/substrate/wasm-runtime/Cargo.lock b/substrate/wasm-runtime/Cargo.lock index 287249192e..97c9736c3f 100644 --- a/substrate/wasm-runtime/Cargo.lock +++ b/substrate/wasm-runtime/Cargo.lock @@ -375,6 +375,10 @@ dependencies = [ "crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "polkadot-codec" +version = "0.1.0" + [[package]] name = "polkadot-primitives" version = "0.1.0" @@ -383,7 +387,7 @@ dependencies = [ "byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "fixed-hash 0.1.3 (git+https://github.com/rphmeier/primitives.git?branch=compile-for-wasm)", - "polkadot-runtime-codec 0.1.0", + "polkadot-codec 0.1.0", "rustc-hex 2.0.0 (git+https://github.com/rphmeier/rustc-hex.git)", "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", @@ -391,18 +395,14 @@ dependencies = [ "uint 0.1.2 (git+https://github.com/rphmeier/primitives.git?branch=compile-for-wasm)", ] -[[package]] -name = "polkadot-runtime-codec" -version = "0.1.0" - [[package]] name = "polkadot-runtime-std" version = "0.1.0" dependencies = [ "ed25519 0.1.0", "environmental 0.1.0", + "polkadot-codec 0.1.0", "polkadot-primitives 0.1.0", - "polkadot-runtime-codec 0.1.0", "polkadot-state-machine 0.1.0", "pwasm-alloc 0.1.0", "pwasm-libc 0.1.0", @@ -551,8 +551,8 @@ dependencies = [ name = "runtime-polkadot" version = "0.1.0" dependencies = [ + "polkadot-codec 0.1.0", "polkadot-primitives 0.1.0", - "polkadot-runtime-codec 0.1.0", "polkadot-runtime-std 0.1.0", ] diff --git a/substrate/wasm-runtime/polkadot/Cargo.toml b/substrate/wasm-runtime/polkadot/Cargo.toml index b0bc7a480b..fcf280ca8c 100644 --- a/substrate/wasm-runtime/polkadot/Cargo.toml +++ b/substrate/wasm-runtime/polkadot/Cargo.toml @@ -7,10 +7,10 @@ authors = ["Parity Technologies "] crate-type = ["cdylib"] [dependencies] -polkadot-runtime-codec = { path = "../../runtime-codec", version = "0.1", default-features = false } +polkadot-codec = { path = "../../codec", version = "0.1", default-features = false } polkadot-runtime-std = { path = "../../runtime-std", version = "0.1", default-features = false } polkadot-primitives = { path = "../../primitives", version = "0.1", default-features = false } [features] default = [] -std = ["polkadot-runtime-codec/std", "polkadot-runtime-std/std", "polkadot-primitives/std"] +std = ["polkadot-codec/std", "polkadot-runtime-std/std", "polkadot-primitives/std"] diff --git a/substrate/wasm-runtime/polkadot/src/lib.rs b/substrate/wasm-runtime/polkadot/src/lib.rs index a6cd2c1f69..36e03e4e68 100644 --- a/substrate/wasm-runtime/polkadot/src/lib.rs +++ b/substrate/wasm-runtime/polkadot/src/lib.rs @@ -27,7 +27,7 @@ extern crate rustc_hex; #[macro_use] extern crate log; -extern crate polkadot_runtime_codec as codec; +extern crate polkadot_codec as codec; extern crate polkadot_primitives as primitives; #[cfg(test)] diff --git a/substrate/wasm-runtime/polkadot/src/runtime/consensus.rs b/substrate/wasm-runtime/polkadot/src/runtime/consensus.rs index 83e59d0684..6f0552368b 100644 --- a/substrate/wasm-runtime/polkadot/src/runtime/consensus.rs +++ b/substrate/wasm-runtime/polkadot/src/runtime/consensus.rs @@ -18,7 +18,7 @@ use runtime_std::prelude::*; use support::storage::unhashed::StorageVec; -use primitives::SessionKey; +use primitives::relay::SessionKey; struct AuthorityStorageVec {} impl StorageVec for AuthorityStorageVec { diff --git a/substrate/wasm-runtime/polkadot/src/runtime/genesismap.rs b/substrate/wasm-runtime/polkadot/src/runtime/genesismap.rs index 38099f22f3..5fa27d1a8f 100644 --- a/substrate/wasm-runtime/polkadot/src/runtime/genesismap.rs +++ b/substrate/wasm-runtime/polkadot/src/runtime/genesismap.rs @@ -20,8 +20,7 @@ use std::collections::HashMap; use runtime_std::twox_128; use codec::{KeyedVec, Joiner}; use support::Hashable; -use primitives::relay::{Number as BlockNumber, Block}; -use primitives::AccountId; +use primitives::relay::{Number as BlockNumber, Block, AccountId}; use runtime::staking::Balance; /// Configuration of a general Polkadot genesis block. diff --git a/substrate/wasm-runtime/polkadot/src/runtime/governance.rs b/substrate/wasm-runtime/polkadot/src/runtime/governance.rs index 298add1c40..8e830b7e14 100644 --- a/substrate/wasm-runtime/polkadot/src/runtime/governance.rs +++ b/substrate/wasm-runtime/polkadot/src/runtime/governance.rs @@ -28,8 +28,7 @@ use runtime_std::prelude::*; use codec::KeyedVec; use support::storage; -use primitives::{AccountId, Hash, BlockNumber}; -use primitives::relay::Proposal; +use primitives::relay::{Proposal, AccountId, Hash, BlockNumber}; use runtime::{staking, system, session}; const APPROVALS_REQUIRED: &[u8] = b"gov:apr"; @@ -149,8 +148,7 @@ mod tests { use runtime_std::{with_externalities, twox_128, TestExternalities}; use codec::{KeyedVec, Joiner}; use support::{one, two, with_env}; - use primitives::AccountId; - use primitives::relay::InternalFunction; + use primitives::relay::{AccountId, InternalFunction}; use runtime::{staking, session}; fn new_test_ext() -> TestExternalities { diff --git a/substrate/wasm-runtime/polkadot/src/runtime/session.rs b/substrate/wasm-runtime/polkadot/src/runtime/session.rs index 6710e8854a..7e94eaf308 100644 --- a/substrate/wasm-runtime/polkadot/src/runtime/session.rs +++ b/substrate/wasm-runtime/polkadot/src/runtime/session.rs @@ -20,7 +20,7 @@ use runtime_std::prelude::*; use codec::KeyedVec; use support::{storage, StorageVec}; -use primitives::{AccountId, SessionKey, BlockNumber}; +use primitives::relay::{AccountId, SessionKey, BlockNumber}; use runtime::{system, staking, consensus}; const SESSION_LENGTH: &[u8] = b"ses:len"; @@ -140,7 +140,7 @@ mod tests { use runtime_std::{with_externalities, twox_128, TestExternalities}; use codec::{KeyedVec, Joiner}; use support::{one, two, with_env}; - use primitives::AccountId; + use primitives::relay::AccountId; use runtime::{consensus, session}; fn simple_setup() -> TestExternalities { diff --git a/substrate/wasm-runtime/polkadot/src/runtime/staking.rs b/substrate/wasm-runtime/polkadot/src/runtime/staking.rs index f503ee7363..d3577b9f6b 100644 --- a/substrate/wasm-runtime/polkadot/src/runtime/staking.rs +++ b/substrate/wasm-runtime/polkadot/src/runtime/staking.rs @@ -21,7 +21,7 @@ use runtime_std::cell::RefCell; use runtime_std::print; use codec::KeyedVec; use support::{storage, StorageVec}; -use primitives::{BlockNumber, AccountId}; +use primitives::relay::{BlockNumber, AccountId}; use runtime::{system, session, governance}; /// The balance of an account. @@ -216,7 +216,7 @@ mod tests { use runtime_std::{with_externalities, twox_128, TestExternalities}; use codec::{KeyedVec, Joiner}; use support::{one, two, with_env}; - use primitives::AccountId; + use primitives::relay::AccountId; use runtime::{staking, session}; #[test] diff --git a/substrate/wasm-runtime/polkadot/src/runtime/system.rs b/substrate/wasm-runtime/polkadot/src/runtime/system.rs index aa96548aa3..9f8edbb92e 100644 --- a/substrate/wasm-runtime/polkadot/src/runtime/system.rs +++ b/substrate/wasm-runtime/polkadot/src/runtime/system.rs @@ -21,8 +21,8 @@ use runtime_std::prelude::*; use runtime_std::{mem, storage_root, enumerated_trie_root}; use codec::{KeyedVec, Slicable}; use support::{Hashable, storage, with_env}; -use primitives::{AccountId, Hash, TxOrder, BlockNumber}; -use primitives::relay::{Block, Header, UncheckedTransaction, Function, Log}; +use primitives::relay::{AccountId, Hash, TxOrder, BlockNumber, Block, Header, UncheckedTransaction, + Function, Log}; use runtime::{staking, session}; const NONCE_OF: &[u8] = b"sys:non:"; diff --git a/substrate/wasm-runtime/polkadot/src/runtime/timestamp.rs b/substrate/wasm-runtime/polkadot/src/runtime/timestamp.rs index de62dd03b8..2b316f17af 100644 --- a/substrate/wasm-runtime/polkadot/src/runtime/timestamp.rs +++ b/substrate/wasm-runtime/polkadot/src/runtime/timestamp.rs @@ -17,7 +17,8 @@ //! Timestamp manager: just handles the current timestamp. use support::storage; -use primitives::Timestamp; + +pub type Timestamp = u64; const CURRENT_TIMESTAMP: &[u8] = b"tim:val"; diff --git a/substrate/wasm-runtime/polkadot/src/support/environment.rs b/substrate/wasm-runtime/polkadot/src/support/environment.rs index b2ab7e8798..b2d0e737e1 100644 --- a/substrate/wasm-runtime/polkadot/src/support/environment.rs +++ b/substrate/wasm-runtime/polkadot/src/support/environment.rs @@ -21,8 +21,7 @@ use runtime_std::mem; use runtime_std::cell::RefCell; use runtime_std::rc::Rc; -use primitives::relay::{BlockNumber, Digest}; -use primitives::Hash; +use primitives::relay::{BlockNumber, Digest, Hash}; #[derive(Default)] /// The information that can be accessed globally. diff --git a/substrate/wasm-runtime/polkadot/src/support/testing.rs b/substrate/wasm-runtime/polkadot/src/support/testing.rs index 06420668c6..89510e0212 100644 --- a/substrate/wasm-runtime/polkadot/src/support/testing.rs +++ b/substrate/wasm-runtime/polkadot/src/support/testing.rs @@ -16,7 +16,7 @@ //! Testing helpers. -use primitives::AccountId; +use primitives::relay::AccountId; use super::statichex::StaticHexInto; #[macro_export] From c0d072a5f3bd465849323e12fce74300df8cba88 Mon Sep 17 00:00:00 2001 From: Gav Date: Wed, 7 Feb 2018 11:29:10 +0100 Subject: [PATCH 02/15] Rename codec -> substrate-codec, executor -> substrate-executor. --- substrate/Cargo.lock | 68 +++++++++--------- substrate/cli/Cargo.toml | 8 +-- substrate/cli/src/lib.rs | 2 +- substrate/client/Cargo.toml | 4 +- substrate/client/src/genesis.rs | 2 +- substrate/client/src/lib.rs | 4 +- substrate/codec/Cargo.toml | 2 +- substrate/codec/src/endiansensitive.rs | 8 +-- substrate/codec/src/joiner.rs | 8 +-- substrate/codec/src/keyedvec.rs | 8 +-- substrate/codec/src/slicable.rs | 8 +-- substrate/ed25519/src/lib.rs | 8 +-- substrate/executor/Cargo.toml | 4 +- substrate/executor/src/error.rs | 8 +-- substrate/executor/src/lib.rs | 10 +-- substrate/executor/src/native_executor.rs | 8 +-- substrate/executor/src/wasm_executor.rs | 10 +-- substrate/executor/src/wasm_utils.rs | 10 +-- substrate/native-runtime/Cargo.toml | 4 +- substrate/primitives/Cargo.toml | 4 +- substrate/primitives/src/lib.rs | 2 +- substrate/rpc/Cargo.toml | 8 +-- substrate/rpc/src/chain/tests.rs | 2 +- substrate/rpc/src/lib.rs | 2 +- substrate/rpc/src/state/tests.rs | 2 +- substrate/runtime-std/Cargo.toml | 4 +- substrate/runtime-std/src/lib.rs | 2 +- substrate/wasm-runtime/Cargo.lock | 14 ++-- substrate/wasm-runtime/polkadot/Cargo.toml | 4 +- substrate/wasm-runtime/polkadot/src/lib.rs | 2 +- .../polkadot/src/runtime/parachains.rs | 1 + .../release/runtime_polkadot.compact.wasm | Bin 67849 -> 69428 bytes .../release/runtime_polkadot.wasm | Bin 67928 -> 69507 bytes .../release/runtime_test.compact.wasm | Bin 14104 -> 14104 bytes .../release/runtime_test.wasm | Bin 14229 -> 14229 bytes 35 files changed, 116 insertions(+), 115 deletions(-) diff --git a/substrate/Cargo.lock b/substrate/Cargo.lock index 24234565d2..b84562b8a9 100644 --- a/substrate/Cargo.lock +++ b/substrate/Cargo.lock @@ -827,10 +827,10 @@ version = "0.1.0" dependencies = [ "hex-literal 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "polkadot-codec 0.1.0", "polkadot-primitives 0.1.0", "polkadot-runtime-std 0.1.0", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "substrate-codec 0.1.0", ] [[package]] @@ -988,9 +988,9 @@ dependencies = [ "error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "polkadot-client 0.1.0", - "polkadot-executor 0.1.0", "polkadot-primitives 0.1.0", "polkadot-rpc-servers 0.1.0", + "substrate-executor 0.1.0", ] [[package]] @@ -1003,18 +1003,14 @@ dependencies = [ "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "native-runtime 0.1.0", "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "polkadot-codec 0.1.0", - "polkadot-executor 0.1.0", "polkadot-primitives 0.1.0", "polkadot-serializer 0.1.0", "polkadot-state-machine 0.1.0", + "substrate-codec 0.1.0", + "substrate-executor 0.1.0", "triehash 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "polkadot-codec" -version = "0.1.0" - [[package]] name = "polkadot-collator" version = "0.1.0" @@ -1023,29 +1019,6 @@ dependencies = [ "polkadot-primitives 0.1.0", ] -[[package]] -name = "polkadot-executor" -version = "0.1.0" -dependencies = [ - "assert_matches 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "ed25519 0.1.0", - "error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "hex-literal 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "native-runtime 0.1.0", - "parity-wasm 0.15.4 (registry+https://github.com/rust-lang/crates.io-index)", - "polkadot-codec 0.1.0", - "polkadot-primitives 0.1.0", - "polkadot-runtime-std 0.1.0", - "polkadot-serializer 0.1.0", - "polkadot-state-machine 0.1.0", - "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", - "triehash 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "polkadot-network" version = "0.1.0" @@ -1079,12 +1052,12 @@ dependencies = [ "byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "fixed-hash 0.1.3 (git+https://github.com/rphmeier/primitives.git?branch=compile-for-wasm)", - "polkadot-codec 0.1.0", "polkadot-serializer 0.1.0", "pretty_assertions 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 2.0.0 (git+https://github.com/rphmeier/rustc-hex.git)", "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", + "substrate-codec 0.1.0", "twox-hash 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "uint 0.1.2 (git+https://github.com/rphmeier/primitives.git?branch=compile-for-wasm)", ] @@ -1098,9 +1071,9 @@ dependencies = [ "jsonrpc-core 8.0.1 (git+https://github.com/paritytech/jsonrpc.git)", "jsonrpc-macros 8.0.0 (git+https://github.com/paritytech/jsonrpc.git)", "polkadot-client 0.1.0", - "polkadot-executor 0.1.0", "polkadot-primitives 0.1.0", "polkadot-state-machine 0.1.0", + "substrate-executor 0.1.0", ] [[package]] @@ -1118,12 +1091,12 @@ version = "0.1.0" dependencies = [ "ed25519 0.1.0", "environmental 0.1.0", - "polkadot-codec 0.1.0", "polkadot-primitives 0.1.0", "polkadot-state-machine 0.1.0", "pwasm-alloc 0.1.0", "pwasm-libc 0.1.0", "rustc_version 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "substrate-codec 0.1.0", "triehash 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1475,6 +1448,33 @@ name = "strsim" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "substrate-codec" +version = "0.1.0" + +[[package]] +name = "substrate-executor" +version = "0.1.0" +dependencies = [ + "assert_matches 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ed25519 0.1.0", + "error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "hex-literal 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "native-runtime 0.1.0", + "parity-wasm 0.15.4 (registry+https://github.com/rust-lang/crates.io-index)", + "polkadot-primitives 0.1.0", + "polkadot-runtime-std 0.1.0", + "polkadot-serializer 0.1.0", + "polkadot-state-machine 0.1.0", + "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", + "substrate-codec 0.1.0", + "triehash 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "subtle" version = "0.1.0" diff --git a/substrate/cli/Cargo.toml b/substrate/cli/Cargo.toml index 6d857023f7..6ad69c3717 100644 --- a/substrate/cli/Cargo.toml +++ b/substrate/cli/Cargo.toml @@ -9,7 +9,7 @@ clap = { version = "2.27", features = ["yaml"] } env_logger = "0.4" error-chain = "0.11" log = "0.3" -polkadot-client = { path = "../client", version = "0.1" } -polkadot-executor = { path = "../executor", version = "0.1" } -polkadot-primitives = { path = "../primitives", version = "0.1" } -polkadot-rpc-servers = { path = "../rpc-servers", version = "0.1" } +polkadot-client = { path = "../client" } +substrate-executor = { path = "../executor" } +polkadot-primitives = { path = "../primitives" } +polkadot-rpc-servers = { path = "../rpc-servers" } diff --git a/substrate/cli/src/lib.rs b/substrate/cli/src/lib.rs index d396a7c69e..db6ba224ad 100644 --- a/substrate/cli/src/lib.rs +++ b/substrate/cli/src/lib.rs @@ -20,7 +20,7 @@ extern crate env_logger; extern crate polkadot_client as client; -extern crate polkadot_executor as executor; +extern crate substrate_executor as executor; extern crate polkadot_primitives as primitives; extern crate polkadot_rpc_servers as rpc; diff --git a/substrate/client/Cargo.toml b/substrate/client/Cargo.toml index 7fe9621de7..ef2f85f082 100644 --- a/substrate/client/Cargo.toml +++ b/substrate/client/Cargo.toml @@ -10,8 +10,8 @@ parking_lot = "0.4" polkadot-primitives = { path = "../primitives", version = "0.1" } polkadot-state-machine = { path = "../state-machine", version = "0.1" } polkadot-serializer = { path = "../serializer" } -polkadot-executor = { path = "../executor" } -polkadot-codec = { path = "../codec", version = "0.1" } +substrate-executor = { path = "../executor" } +substrate-codec = { path = "../codec", version = "0.1" } native-runtime = { path = "../native-runtime" } triehash = "0.1" hex-literal = "0.1" diff --git a/substrate/client/src/genesis.rs b/substrate/client/src/genesis.rs index a288bec4e5..1e2020b9a7 100644 --- a/substrate/client/src/genesis.rs +++ b/substrate/client/src/genesis.rs @@ -45,7 +45,7 @@ mod tests { use state_machine::execute; use state_machine::OverlayedChanges; use state_machine::backend::InMemory; - use polkadot_executor::executor; + use substrate_executor::executor; use primitives::relay::{AccountId, Hash, BlockNumber, Header, Digest, UncheckedTransaction, Transaction, Function}; use primitives::contract::CallData; diff --git a/substrate/client/src/lib.rs b/substrate/client/src/lib.rs index e97c93dd39..b53ca407ab 100644 --- a/substrate/client/src/lib.rs +++ b/substrate/client/src/lib.rs @@ -21,8 +21,8 @@ extern crate polkadot_primitives as primitives; extern crate polkadot_state_machine as state_machine; extern crate polkadot_serializer as ser; -extern crate polkadot_codec as codec; -extern crate polkadot_executor; +extern crate substrate_codec as codec; +extern crate substrate_executor; extern crate native_runtime; extern crate ed25519; diff --git a/substrate/codec/Cargo.toml b/substrate/codec/Cargo.toml index 0cf0083d5f..c780c9bd63 100644 --- a/substrate/codec/Cargo.toml +++ b/substrate/codec/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "polkadot-codec" +name = "substrate-codec" description = "Serialization and deserialization codec for runtime values" version = "0.1.0" authors = ["Parity Technologies "] diff --git a/substrate/codec/src/endiansensitive.rs b/substrate/codec/src/endiansensitive.rs index 1b550edffa..00ff9a775f 100644 --- a/substrate/codec/src/endiansensitive.rs +++ b/substrate/codec/src/endiansensitive.rs @@ -1,18 +1,18 @@ // Copyright 2017 Parity Technologies (UK) Ltd. -// This file is part of Polkadot. +// This file is part of Substrate. -// Polkadot 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. -// Polkadot 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 Polkadot. If not, see . +// along with Substrate. If not, see . //! Endian manager. diff --git a/substrate/codec/src/joiner.rs b/substrate/codec/src/joiner.rs index 1d19851243..ac85331012 100644 --- a/substrate/codec/src/joiner.rs +++ b/substrate/codec/src/joiner.rs @@ -1,18 +1,18 @@ // Copyright 2017 Parity Technologies (UK) Ltd. -// This file is part of Polkadot. +// This file is part of Substrate. -// Polkadot 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. -// Polkadot 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 Polkadot. If not, see . +// along with Substrate. If not, see . //! Trait diff --git a/substrate/codec/src/keyedvec.rs b/substrate/codec/src/keyedvec.rs index 2b4bc99fbd..535a616e14 100644 --- a/substrate/codec/src/keyedvec.rs +++ b/substrate/codec/src/keyedvec.rs @@ -1,18 +1,18 @@ // Copyright 2017 Parity Technologies (UK) Ltd. -// This file is part of Polkadot. +// This file is part of Substrate. -// Polkadot 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. -// Polkadot 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 Polkadot. If not, see . +// along with Substrate. If not, see . //! Serialiser and prepender. diff --git a/substrate/codec/src/slicable.rs b/substrate/codec/src/slicable.rs index 1d76fb851e..6baa2ebaad 100644 --- a/substrate/codec/src/slicable.rs +++ b/substrate/codec/src/slicable.rs @@ -1,18 +1,18 @@ // Copyright 2017 Parity Technologies (UK) Ltd. -// This file is part of Polkadot. +// This file is part of Substrate. -// Polkadot 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. -// Polkadot 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 Polkadot. If not, see . +// along with Substrate. If not, see . //! Serialisation. diff --git a/substrate/ed25519/src/lib.rs b/substrate/ed25519/src/lib.rs index 7f0bfae0ff..33c25895b7 100644 --- a/substrate/ed25519/src/lib.rs +++ b/substrate/ed25519/src/lib.rs @@ -1,18 +1,18 @@ // Copyright 2017 Parity Technologies (UK) Ltd. -// This file is part of Polkadot. +// This file is part of Substrate. -// Polkadot 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. -// Polkadot 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 Polkadot. If not, see . +// along with Substrate. If not, see . //! Simple Ed25519 API. diff --git a/substrate/executor/Cargo.toml b/substrate/executor/Cargo.toml index d51522c568..64625e760f 100644 --- a/substrate/executor/Cargo.toml +++ b/substrate/executor/Cargo.toml @@ -1,11 +1,11 @@ [package] -name = "polkadot-executor" +name = "substrate-executor" version = "0.1.0" authors = ["Parity Technologies "] [dependencies] error-chain = "0.11" -polkadot-codec = { path = "../codec", version = "0.1" } +substrate-codec = { path = "../codec", version = "0.1" } polkadot-runtime-std = { path = "../runtime-std", version = "0.1" } polkadot-primitives = { path = "../primitives", version = "0.1" } polkadot-serializer = { path = "../serializer", version = "0.1" } diff --git a/substrate/executor/src/error.rs b/substrate/executor/src/error.rs index 973fa58d38..346fa16c6a 100644 --- a/substrate/executor/src/error.rs +++ b/substrate/executor/src/error.rs @@ -1,18 +1,18 @@ // Copyright 2017 Parity Technologies (UK) Ltd. -// This file is part of Polkadot. +// This file is part of Substrate. -// Polkadot 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. -// Polkadot 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 Polkadot. If not, see . +// along with Substrate. If not, see . //! Rust executor possible errors. diff --git a/substrate/executor/src/lib.rs b/substrate/executor/src/lib.rs index 1bd7a1db25..79b212eb2e 100644 --- a/substrate/executor/src/lib.rs +++ b/substrate/executor/src/lib.rs @@ -1,18 +1,18 @@ // Copyright 2017 Parity Technologies (UK) Ltd. -// This file is part of Polkadot. +// This file is part of Substrate. -// Polkadot 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. -// Polkadot 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 Polkadot. If not, see . +// along with Substrate. If not, see . //! Temporary crate for contracts implementations. //! @@ -27,7 +27,7 @@ #![warn(missing_docs)] -extern crate polkadot_codec as codec; +extern crate substrate_codec as codec; extern crate polkadot_runtime_std as runtime_std; extern crate polkadot_primitives as primitives; extern crate polkadot_serializer as serializer; diff --git a/substrate/executor/src/native_executor.rs b/substrate/executor/src/native_executor.rs index ea13ac6593..d52b0daed1 100644 --- a/substrate/executor/src/native_executor.rs +++ b/substrate/executor/src/native_executor.rs @@ -1,18 +1,18 @@ // Copyright 2017 Parity Technologies (UK) Ltd. -// This file is part of Polkadot. +// This file is part of Substrate. -// Polkadot 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. -// Polkadot 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 Polkadot. If not, see . +// along with Substrate. If not, see . use error::{Error, ErrorKind, Result}; use native_runtime as runtime; diff --git a/substrate/executor/src/wasm_executor.rs b/substrate/executor/src/wasm_executor.rs index 6269675dad..00eb9e67d7 100644 --- a/substrate/executor/src/wasm_executor.rs +++ b/substrate/executor/src/wasm_executor.rs @@ -1,20 +1,20 @@ // Copyright 2017 Parity Technologies (UK) Ltd. -// This file is part of Polkadot. +// This file is part of Substrate. -// Polkadot 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. -// Polkadot 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 Polkadot. If not, see . +// along with Substrate. If not, see . -//! Rust implementation of Polkadot contracts. +//! Rust implementation of Substrate contracts. use std::sync::Arc; use std::cmp::Ordering; diff --git a/substrate/executor/src/wasm_utils.rs b/substrate/executor/src/wasm_utils.rs index f6440628b9..11fc404e2c 100644 --- a/substrate/executor/src/wasm_utils.rs +++ b/substrate/executor/src/wasm_utils.rs @@ -1,20 +1,20 @@ // Copyright 2017 Parity Technologies (UK) Ltd. -// This file is part of Polkadot. +// This file is part of Substrate. -// Polkadot 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. -// Polkadot 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 Polkadot. If not, see . +// along with Substrate. If not, see . -//! Rust implementation of Polkadot contracts. +//! Rust implementation of Substrate contracts. use std::sync::{Arc}; use std::collections::HashMap; diff --git a/substrate/native-runtime/Cargo.toml b/substrate/native-runtime/Cargo.toml index e46823bbb0..b985aa17a9 100644 --- a/substrate/native-runtime/Cargo.toml +++ b/substrate/native-runtime/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" authors = ["Parity Technologies "] [dependencies] -polkadot-codec = { path = "../codec", version = "0.1" } +substrate-codec = { path = "../codec", version = "0.1" } polkadot-runtime-std = { path = "../runtime-std", version = "0.1" } polkadot-primitives = { path = "../primitives", version = "0.1" } rustc-hex = "1.0" @@ -13,4 +13,4 @@ log = { version = "0.3", optional = true } [features] default = ["std"] -std = ["polkadot-codec/std", "polkadot-runtime-std/std", "polkadot-primitives/std", "log"] +std = ["substrate-codec/std", "polkadot-runtime-std/std", "polkadot-primitives/std", "log"] diff --git a/substrate/primitives/Cargo.toml b/substrate/primitives/Cargo.toml index d3ba1eec0f..7fc2544f61 100644 --- a/substrate/primitives/Cargo.toml +++ b/substrate/primitives/Cargo.toml @@ -13,7 +13,7 @@ uint = { git = "https://github.com/rphmeier/primitives.git", branch = "compile-f twox-hash = { version = "1.1.0", optional = true } byteorder = { version = "1.1", default_features = false } blake2-rfc = { version = "0.2.18", optional = true } -polkadot-codec = { path = "../codec", version = "0.1", default_features = false } +substrate-codec = { path = "../codec", version = "0.1", default_features = false } [dev-dependencies] polkadot-serializer = { path = "../serializer", version = "0.1" } @@ -24,7 +24,7 @@ default = ["std"] std = [ "uint/std", "fixed-hash/std", - "polkadot-codec/std", + "substrate-codec/std", "serde/std", "rustc-hex/std", "twox-hash", diff --git a/substrate/primitives/src/lib.rs b/substrate/primitives/src/lib.rs index 59728fb43c..ee95d7ca9a 100644 --- a/substrate/primitives/src/lib.rs +++ b/substrate/primitives/src/lib.rs @@ -43,7 +43,7 @@ extern crate uint as uint_crate; #[cfg(feature = "std")] extern crate core; -extern crate polkadot_codec as codec; +extern crate substrate_codec as codec; #[cfg(test)] extern crate polkadot_serializer; #[cfg(test)] diff --git a/substrate/rpc/Cargo.toml b/substrate/rpc/Cargo.toml index 8095f88fff..a2afb0c118 100644 --- a/substrate/rpc/Cargo.toml +++ b/substrate/rpc/Cargo.toml @@ -7,10 +7,10 @@ authors = ["Parity Technologies "] error-chain = "0.11" jsonrpc-core = { git="https://github.com/paritytech/jsonrpc.git" } jsonrpc-macros = { git="https://github.com/paritytech/jsonrpc.git" } -polkadot-client = { path = "../client", version = "0.1" } -polkadot-primitives = { path = "../primitives", version = "0.1" } -polkadot-state-machine = { path = "../state-machine", version = "0.1" } +polkadot-client = { path = "../client" } +polkadot-primitives = { path = "../primitives" } +polkadot-state-machine = { path = "../state-machine" } [dev-dependencies] assert_matches = "1.1" -polkadot-executor = { path = "../executor", version = "0.1" } +substrate-executor = { path = "../executor" } diff --git a/substrate/rpc/src/chain/tests.rs b/substrate/rpc/src/chain/tests.rs index 952b20b35c..ad629fd41f 100644 --- a/substrate/rpc/src/chain/tests.rs +++ b/substrate/rpc/src/chain/tests.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Polkadot. If not, see . -use polkadot_executor as executor; +use substrate_executor as executor; use client; use super::*; diff --git a/substrate/rpc/src/lib.rs b/substrate/rpc/src/lib.rs index b18f503547..2feef148c5 100644 --- a/substrate/rpc/src/lib.rs +++ b/substrate/rpc/src/lib.rs @@ -29,7 +29,7 @@ extern crate error_chain; extern crate jsonrpc_macros; #[cfg(test)] -extern crate polkadot_executor; +extern crate substrate_executor; #[cfg(test)] #[macro_use] extern crate assert_matches; diff --git a/substrate/rpc/src/state/tests.rs b/substrate/rpc/src/state/tests.rs index 556fa8cfce..2360ce9e45 100644 --- a/substrate/rpc/src/state/tests.rs +++ b/substrate/rpc/src/state/tests.rs @@ -15,7 +15,7 @@ // along with Polkadot. If not, see . use super::*; -use polkadot_executor as executor; +use substrate_executor as executor; use self::error::{Error, ErrorKind}; use client; diff --git a/substrate/runtime-std/Cargo.toml b/substrate/runtime-std/Cargo.toml index 1822161c39..b88baee4f1 100644 --- a/substrate/runtime-std/Cargo.toml +++ b/substrate/runtime-std/Cargo.toml @@ -13,7 +13,7 @@ pwasm-libc = { path = "../wasm-runtime/pwasm-libc", version = "0.1" } environmental = { path = "../environmental", version = "0.1", optional = true } polkadot-state-machine = { path = "../state-machine", version = "0.1", optional = true } polkadot-primitives = { path = "../primitives", version = "0.1", default_features = false } -polkadot-codec = { path = "../codec", version = "0.1", default_features = false } +substrate-codec = { path = "../codec", version = "0.1", default_features = false } triehash = { version = "0.1", optional = true } ed25519 = { path = "../ed25519", version = "0.1", optional = true } @@ -24,7 +24,7 @@ std = [ "polkadot-state-machine", "triehash", "polkadot-primitives/std", - "polkadot-codec/std", + "substrate-codec/std", "ed25519", ] nightly = [] diff --git a/substrate/runtime-std/src/lib.rs b/substrate/runtime-std/src/lib.rs index 9fb2148b76..0c080a743b 100644 --- a/substrate/runtime-std/src/lib.rs +++ b/substrate/runtime-std/src/lib.rs @@ -24,7 +24,7 @@ #![cfg_attr(feature = "std", doc = "Polkadot runtime standard library as compiled when linked with Rust's standard library.")] #![cfg_attr(not(feature = "std"), doc = "Polkadot's runtime standard library as compiled without Rust's standard library.")] -extern crate polkadot_codec as codec; +extern crate substrate_codec as codec; #[cfg(feature = "std")] include!("../with_std.rs"); diff --git a/substrate/wasm-runtime/Cargo.lock b/substrate/wasm-runtime/Cargo.lock index 97c9736c3f..f807d33069 100644 --- a/substrate/wasm-runtime/Cargo.lock +++ b/substrate/wasm-runtime/Cargo.lock @@ -375,10 +375,6 @@ dependencies = [ "crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "polkadot-codec" -version = "0.1.0" - [[package]] name = "polkadot-primitives" version = "0.1.0" @@ -387,10 +383,10 @@ dependencies = [ "byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "fixed-hash 0.1.3 (git+https://github.com/rphmeier/primitives.git?branch=compile-for-wasm)", - "polkadot-codec 0.1.0", "rustc-hex 2.0.0 (git+https://github.com/rphmeier/rustc-hex.git)", "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", + "substrate-codec 0.1.0", "twox-hash 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "uint 0.1.2 (git+https://github.com/rphmeier/primitives.git?branch=compile-for-wasm)", ] @@ -401,12 +397,12 @@ version = "0.1.0" dependencies = [ "ed25519 0.1.0", "environmental 0.1.0", - "polkadot-codec 0.1.0", "polkadot-primitives 0.1.0", "polkadot-state-machine 0.1.0", "pwasm-alloc 0.1.0", "pwasm-libc 0.1.0", "rustc_version 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "substrate-codec 0.1.0", "triehash 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -551,9 +547,9 @@ dependencies = [ name = "runtime-polkadot" version = "0.1.0" dependencies = [ - "polkadot-codec 0.1.0", "polkadot-primitives 0.1.0", "polkadot-runtime-std 0.1.0", + "substrate-codec 0.1.0", ] [[package]] @@ -633,6 +629,10 @@ 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" + [[package]] name = "syn" version = "0.11.11" diff --git a/substrate/wasm-runtime/polkadot/Cargo.toml b/substrate/wasm-runtime/polkadot/Cargo.toml index fcf280ca8c..45b8c711e6 100644 --- a/substrate/wasm-runtime/polkadot/Cargo.toml +++ b/substrate/wasm-runtime/polkadot/Cargo.toml @@ -7,10 +7,10 @@ authors = ["Parity Technologies "] crate-type = ["cdylib"] [dependencies] -polkadot-codec = { path = "../../codec", version = "0.1", default-features = false } +substrate-codec = { path = "../../codec", version = "0.1", default-features = false } polkadot-runtime-std = { path = "../../runtime-std", version = "0.1", default-features = false } polkadot-primitives = { path = "../../primitives", version = "0.1", default-features = false } [features] default = [] -std = ["polkadot-codec/std", "polkadot-runtime-std/std", "polkadot-primitives/std"] +std = ["substrate-codec/std", "polkadot-runtime-std/std", "polkadot-primitives/std"] diff --git a/substrate/wasm-runtime/polkadot/src/lib.rs b/substrate/wasm-runtime/polkadot/src/lib.rs index 36e03e4e68..098fdd09a7 100644 --- a/substrate/wasm-runtime/polkadot/src/lib.rs +++ b/substrate/wasm-runtime/polkadot/src/lib.rs @@ -27,7 +27,7 @@ extern crate rustc_hex; #[macro_use] extern crate log; -extern crate polkadot_codec as codec; +extern crate substrate_codec as codec; extern crate polkadot_primitives as primitives; #[cfg(test)] diff --git a/substrate/wasm-runtime/polkadot/src/runtime/parachains.rs b/substrate/wasm-runtime/polkadot/src/runtime/parachains.rs index 00da191e57..96e395cfa3 100644 --- a/substrate/wasm-runtime/polkadot/src/runtime/parachains.rs +++ b/substrate/wasm-runtime/polkadot/src/runtime/parachains.rs @@ -16,6 +16,7 @@ //! Main parachains logic. For now this is just the determination of which validators do what. +use runtime_std::prelude::*; use runtime_std::mem; use codec::{Slicable, Joiner}; use support::{Hashable, with_env, storage}; diff --git a/substrate/wasm-runtime/target/wasm32-unknown-unknown/release/runtime_polkadot.compact.wasm b/substrate/wasm-runtime/target/wasm32-unknown-unknown/release/runtime_polkadot.compact.wasm index 669fb901a1e40b239ce3879e9156336e82058abc..4baec7f8bc1e7a137cc17be3509a8567e6a40788 100644 GIT binary patch delta 21387 zcmbV!349#Im3LRqJv}3}q|s=k(NW#jF|rN>7|WPTEwI5D;{$VFz65wIWXG0`y$Ou6 zaq=k%B!YsqLpYSg3C_2W6_JzGZv0C`LK5d93d?Vo{lXy<=NE655as(wa1s)}|Eucm z85!~;tU>d-Usb(&_3B-9%zX5|;E_jyhPH9n?M%}&cC&e}afNZ$2E9;VcWuyE;mLtZ z*|O!!LV7F~jKyLhdWgj|ErN%j5!4xD8e_2_V?cyru|zB$()DBr|BP4}{xQ9*EM6Xq zGx1y2WmSc5-#9q9eY3`cx9l7k(5&RZ-hs`#hX-!n1nf3#nYci&E-Wv*W$Vz!!L7SI z^u@8AyN7Nb9@sU!OS>di&NN3eVpnvvcb=YG*t0hN%@cuT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m2q$NcA1NafSi)od3^e-*9XwIQv3Ez{z zhfbjLxuB7n0g?qMm;lji)`OZ_S$i^Qw0Y!?pw)apCy=7MHia~Zv^45yg;@NTr&EXV zJID>FB*LF54m2GS>}*|pHe?t#eQ>y+Zymh3e-8q@k+A4E+tEA`HbT6OYK8!u3LC+8 zzT+0YS#zet217Cv9&hlo^YpQZxc|-C{6xg4ys7`zt%LlMOL_m`&Abi0B8H!e=o2x_ zc7Eq={eygHVC$BxgSQf+)ttSC zVHQwIppb+RAPZ>0Fj!)oSFwa2gBqgnR%YFdVZ``NKnz-jc;7IHm_=t393m!hd~Dfy zBw9jQT|_w+HG&>T3Q@84t@)|v&~P)ladaC&O60J)^B$41^6pqV6+Ac1~w#41G33O2|jEP&&6w0qI;#Eo8;WpOW}7Wzxwt=qeI_YFX# z>W$RqDotypQIIwv>BpZMb#DWX5diHftG%sQTR`m;C_TTdc5AVAs=+wFNb&eBQP!c4 zG>-o^!kYC$li)~(Mpj{iQ&7Vy1IMylWr?h!FuL{w-RUmIi1dwhIpXdVIKSX>3_&II_yZi1Kz76?f)EhNuhW9VWz0v@1opcLO zMJ%z4VQ|kddcEO}IXDDrPP+yAw}70pZee#H3ZoX717my9=|WlU?7^u4}@9c+9SLaaEk@Q0Acp`{LL({F}mjxNmywPfyBV^6-AEj!FXIqU`uD5K-Kv>#fc~MDB ze-bn)t3T5=?nGE^ex%*dyE#_6U5U})0Hp066mH$IySr~E4Anz!Vdt(Ln)CT~BefV_ zg;aJYysC{9n^jj24xyHOPJ3DHmBrd)sGUZi&a&DYRu-#YMs)$zw5lHJtBSQ}+l`PS zX(z;Yv;$lX>*GCqPePk6BB)C-ToJ16D741=p#pkP17Dgrv{`jq2rHNV!>xS$B$Ry T?ZMb0L%C`nrZ-+y#peBgvwcWL diff --git a/substrate/wasm-runtime/target/wasm32-unknown-unknown/release/runtime_polkadot.wasm b/substrate/wasm-runtime/target/wasm32-unknown-unknown/release/runtime_polkadot.wasm index d223adfad327aa331d606964f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_8!3tHbNG{LX1|PDG6)OHYQK)W($SMm;ON~W%Z4PQ$C}3<4Y0-fL^FwO zldsumAOCCsvzQlT34W#-Yyc+72BgG>{rGd(Fn|2d5q7aYGha&B`^Rt&HVv(;LyIw_ zMAd5iDY4#%+9IIMWwqCNwG*gahgz~lZr_bw?ev22?*&<>KGq@?OE0#JZw%r!&~(fA zCxVP;PPQ2482JYLqg2iGOpCF~@#f7L2u~|aH!5i@o&inDhs?B&?}@OQ!dRQ3FXLGG zHYHX=gOI+Dqj3B1j%EGZV8|YF3fs01Yxbwxj8r$A6shnwIBg3lwzrO696&9(u(q<= z%e~qosGUZiuCm&jS9;aQQC&neEv}3D3a|D|n-NkZZG$-PY6lr;yQHk`)n40TyTK4R zO|*|+5MmekXWI>H{3oz~0_Pae+scKeWG)`Gt4>) zM?2w)F^MMNdjfwnJs7ew=obL!meA9Hb|)1ZE(G_f58QTF3A)UK?(2fT16~pn6Mbmi zzJt(53GW2@$WdvT_M%fgQkc{(qiMXqiq)+c8QwlBef(^fQRmq@&pL12yoq8DX*~8U P{7dn{#P|oQ*!=$wVghUE diff --git a/substrate/wasm-runtime/target/wasm32-unknown-unknown/release/runtime_test.compact.wasm b/substrate/wasm-runtime/target/wasm32-unknown-unknown/release/runtime_test.compact.wasm index 045d4dadfaac5d9804c6226433878a4d8f3f2ce2..d317445bea0143b128ddea96aee60d806355e374 100644 GIT binary patch delta 1984 zcmZ`)TWFj`6rP#zU`q?)=#iqx`dk)nObL!Lxog$O=WS@cCg(eMA$G%eJH-S0o& zIdjf8XU_b)lv+xy#b_<1)M-!~bK0Cv7vtL>eTELrOMf;#lO2vvWwLX_)A8)7=@e;l zSzKl`m57n%8q0{KQ{#zjBApsd4sSVHe3oM@IeIc49gg<)kyekzWM|W-Eqm8J_P%I8 zX{)sS@$qPH@4iQdUyn~GjEOn2TR+1>B3$mFL=o<2uku&cii&)eJ_JMCPIK~Wsu7(X8Tb;*YJ4nRb&oGicUDOlQ3`%jIbDU zZxT%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Ml1sF?+cwv_lnM^J@ Nm`^OgS1$?M{14W6xBmbD diff --git a/substrate/wasm-runtime/target/wasm32-unknown-unknown/release/runtime_test.wasm b/substrate/wasm-runtime/target/wasm32-unknown-unknown/release/runtime_test.wasm index bbba7527d46aca944120e5cafdf8b353abece6ed..0c77df8679b873892803739ec24f2e49f545077e 100644 GIT binary patch delta 1897 zcmZuxTWA|c6rCBbo}O*( zS~%f07KVHeT39#0?G}(s45s-he(2ioy#?9*9CIvNVK-60vP1B2NP6gi-F(Ro5vcq- z>mWs^FnfkD7o(nAVh=k^)}7)K>j5I{epwIt!|m0%_uK>0nhVx$qf2gsUUfqUe)F8b z-m3v!6nAht>jAWLiABWw(REij$htsnF{t~Iki%g(#$z9dXPe zmCJqC2(Wvj<6U~~yV$4=UxA6@G_f@FzGjY_V+fz!8JC_@CHR)o+22_X+4f;Lk> z2X+vQqkuYl1S8aLcsI7K8HF`bgI$tn>ue@9qvn0~10+LrGu^5XVs!7z- zbgMc2UK!qoL`}zHvDk40gGc?y1R5b-1JDOJ4G48X(#Iz8!C+3lXr`7N*V}(# zg+90aRZ3kc3=u+b8>zMUghui$2knL9=zSH*4#el;)L(wGqz2dq kDZYo3+PqZdAoa{7bIF;Ew#e0UO8(@mx&Y%LF6{CB4=4=1t^fc4 delta 1965 zcmZuxOKe+36rCAAySB$J6UU98?IfLi8l0qYK21XSHd9&@2}&y{AE}_kNnTo~iC?f^ zn`T42Xjd$fb`n&95Jm*4LKIwCNGXkwB`Uy3pPmHdHGdP%X-K6 z+&kyqx%c`lnu})s9UO9NZnu-Ty%;`Dy8R*YCVpe`K!s&wtU+UP%9-mcFTQsXICF; zm2+g@!GmEt%1E7`G|~yn7#+0INnGd z#hTVjI)Df02Ds#unP6O7aIxCLN5Q+ecEz>ncW(OEzyv|jF)n=L!YQ-C&^~aXP3oGP z)gmgET&!B&sy;?m!&hs9q(tQhH7#11LdsqCp4VpAy}%x;exCg0lZ(|2xK=u&N206Y zUc$ITkY3{B4)~!#`5bV`Cx@d4A!;tVT==2pH5^TL=)^>J&aEy{T%y|$jYbrG>*&L{1mR1tS;`#Mg?MVd9`F|rnzTtBd~X{ zx*~$F6#G|eb5W+)Y;=otfQNokeF6!MYURRI^9F7!I;it>JRW}?!9G&`q^3?I)bB*7 z3NQ~g21H`rK_}$zZ4*b3Sk)-&07n4$8*YR=cEFlOIfG++!Qy}rfI0vf;I7OiC!LqS zwOtuQV!^d5a}#7B7V<2)s9uD#tzc{bRsf!W6872N6&H=21Xk5J1lR;P4+zIm4$uX- zn{3S`e`&iVuDN#;eYuk;@1}u?aAqU&U@+JVdG3P z#h-YR8>vwq0}(IPlnD}E%9{D~StG?W6UmWe>WmUDdgc4=k@!7u=Ab)jAVokwAPfZ9 zELcG>LNMCR_GPK`b?UP@N~@I6_AN42B5h@O!h&2yO8tEJyrrtxqDqvq4G>W6Q;&Lu zq73YIhKijG8P71XXE-+y Date: Wed, 7 Feb 2018 11:29:25 +0100 Subject: [PATCH 03/15] Finish rename. --- substrate/codec/src/lib.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/substrate/codec/src/lib.rs b/substrate/codec/src/lib.rs index 3e076858be..4a3fae781c 100644 --- a/substrate/codec/src/lib.rs +++ b/substrate/codec/src/lib.rs @@ -1,18 +1,18 @@ // Copyright 2017 Parity Technologies (UK) Ltd. -// This file is part of Polkadot. +// This file is part of Substrate. -// Polkadot 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. -// Polkadot 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 Polkadot. If not, see . +// along with Substrate. If not, see . //! Implements the serialization and deserialization codec for polkadot runtime //! values. From 2220c6e37a61c1dc5637490e070ed1c188f119a5 Mon Sep 17 00:00:00 2001 From: Gav Date: Wed, 7 Feb 2018 11:33:29 +0100 Subject: [PATCH 04/15] Rename polkadot-primitives -> substrate-primitives. --- substrate/Cargo.lock | 24 +++++++++++----------- substrate/cli/Cargo.toml | 2 +- substrate/cli/src/lib.rs | 2 +- substrate/client/Cargo.toml | 2 +- substrate/client/src/lib.rs | 2 +- substrate/collator/Cargo.toml | 2 +- substrate/collator/src/lib.rs | 2 +- substrate/ed25519/Cargo.toml | 2 +- substrate/ed25519/src/lib.rs | 2 +- substrate/executor/src/lib.rs | 2 +- substrate/native-runtime/Cargo.toml | 4 ++-- substrate/network/Cargo.toml | 2 +- substrate/network/src/lib.rs | 2 +- substrate/primitives/Cargo.toml | 2 +- substrate/rpc/Cargo.toml | 2 +- substrate/rpc/src/lib.rs | 2 +- substrate/runtime-std/Cargo.toml | 4 ++-- substrate/runtime-std/with_std.rs | 2 +- substrate/runtime-std/without_std.rs | 2 +- substrate/state-machine/Cargo.toml | 2 +- substrate/state-machine/src/lib.rs | 2 +- substrate/validator/Cargo.toml | 2 +- substrate/validator/src/lib.rs | 2 +- substrate/wasm-runtime/Cargo.lock | 10 ++++----- substrate/wasm-runtime/polkadot/Cargo.toml | 4 ++-- substrate/wasm-runtime/polkadot/src/lib.rs | 2 +- 26 files changed, 44 insertions(+), 44 deletions(-) diff --git a/substrate/Cargo.lock b/substrate/Cargo.lock index b84562b8a9..38f0712010 100644 --- a/substrate/Cargo.lock +++ b/substrate/Cargo.lock @@ -195,7 +195,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "ed25519" version = "0.1.0" dependencies = [ - "polkadot-primitives 0.1.0", + "substrate-primitives 0.1.0", "ring 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "untrusted 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -827,7 +827,7 @@ version = "0.1.0" dependencies = [ "hex-literal 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "polkadot-primitives 0.1.0", + "substrate-primitives 0.1.0", "polkadot-runtime-std 0.1.0", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "substrate-codec 0.1.0", @@ -988,7 +988,7 @@ dependencies = [ "error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "polkadot-client 0.1.0", - "polkadot-primitives 0.1.0", + "substrate-primitives 0.1.0", "polkadot-rpc-servers 0.1.0", "substrate-executor 0.1.0", ] @@ -1003,7 +1003,7 @@ dependencies = [ "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "native-runtime 0.1.0", "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "polkadot-primitives 0.1.0", + "substrate-primitives 0.1.0", "polkadot-serializer 0.1.0", "polkadot-state-machine 0.1.0", "substrate-codec 0.1.0", @@ -1016,7 +1016,7 @@ name = "polkadot-collator" version = "0.1.0" dependencies = [ "futures 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", - "polkadot-primitives 0.1.0", + "substrate-primitives 0.1.0", ] [[package]] @@ -1033,7 +1033,7 @@ dependencies = [ "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)", "polkadot-client 0.1.0", - "polkadot-primitives 0.1.0", + "substrate-primitives 0.1.0", "polkadot-serializer 0.1.0", "polkadot-state-machine 0.1.0", "rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1045,7 +1045,7 @@ dependencies = [ ] [[package]] -name = "polkadot-primitives" +name = "substrate-primitives" version = "0.1.0" dependencies = [ "blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1071,7 +1071,7 @@ dependencies = [ "jsonrpc-core 8.0.1 (git+https://github.com/paritytech/jsonrpc.git)", "jsonrpc-macros 8.0.0 (git+https://github.com/paritytech/jsonrpc.git)", "polkadot-client 0.1.0", - "polkadot-primitives 0.1.0", + "substrate-primitives 0.1.0", "polkadot-state-machine 0.1.0", "substrate-executor 0.1.0", ] @@ -1091,7 +1091,7 @@ version = "0.1.0" dependencies = [ "ed25519 0.1.0", "environmental 0.1.0", - "polkadot-primitives 0.1.0", + "substrate-primitives 0.1.0", "polkadot-state-machine 0.1.0", "pwasm-alloc 0.1.0", "pwasm-libc 0.1.0", @@ -1117,7 +1117,7 @@ dependencies = [ "hex-literal 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "memorydb 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "patricia-trie 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "polkadot-primitives 0.1.0", + "substrate-primitives 0.1.0", "triehash 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1126,7 +1126,7 @@ name = "polkadot-validator" version = "0.1.0" dependencies = [ "error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "polkadot-primitives 0.1.0", + "substrate-primitives 0.1.0", "polkadot-serializer 0.1.0", "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1464,7 +1464,7 @@ dependencies = [ "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "native-runtime 0.1.0", "parity-wasm 0.15.4 (registry+https://github.com/rust-lang/crates.io-index)", - "polkadot-primitives 0.1.0", + "substrate-primitives 0.1.0", "polkadot-runtime-std 0.1.0", "polkadot-serializer 0.1.0", "polkadot-state-machine 0.1.0", diff --git a/substrate/cli/Cargo.toml b/substrate/cli/Cargo.toml index 6ad69c3717..74299ec2eb 100644 --- a/substrate/cli/Cargo.toml +++ b/substrate/cli/Cargo.toml @@ -11,5 +11,5 @@ error-chain = "0.11" log = "0.3" polkadot-client = { path = "../client" } substrate-executor = { path = "../executor" } -polkadot-primitives = { path = "../primitives" } +substrate-primitives = { path = "../primitives" } polkadot-rpc-servers = { path = "../rpc-servers" } diff --git a/substrate/cli/src/lib.rs b/substrate/cli/src/lib.rs index db6ba224ad..faad72526e 100644 --- a/substrate/cli/src/lib.rs +++ b/substrate/cli/src/lib.rs @@ -21,7 +21,7 @@ extern crate env_logger; extern crate polkadot_client as client; extern crate substrate_executor as executor; -extern crate polkadot_primitives as primitives; +extern crate substrate_primitives as primitives; extern crate polkadot_rpc_servers as rpc; #[macro_use] diff --git a/substrate/client/Cargo.toml b/substrate/client/Cargo.toml index ef2f85f082..313b48cce3 100644 --- a/substrate/client/Cargo.toml +++ b/substrate/client/Cargo.toml @@ -7,7 +7,7 @@ authors = ["Parity Technologies "] error-chain = "0.11" log = "0.3" parking_lot = "0.4" -polkadot-primitives = { path = "../primitives", version = "0.1" } +substrate-primitives = { path = "../primitives", version = "0.1" } polkadot-state-machine = { path = "../state-machine", version = "0.1" } polkadot-serializer = { path = "../serializer" } substrate-executor = { path = "../executor" } diff --git a/substrate/client/src/lib.rs b/substrate/client/src/lib.rs index b53ca407ab..02bc273cac 100644 --- a/substrate/client/src/lib.rs +++ b/substrate/client/src/lib.rs @@ -18,7 +18,7 @@ #![warn(missing_docs)] -extern crate polkadot_primitives as primitives; +extern crate substrate_primitives as primitives; extern crate polkadot_state_machine as state_machine; extern crate polkadot_serializer as ser; extern crate substrate_codec as codec; diff --git a/substrate/collator/Cargo.toml b/substrate/collator/Cargo.toml index 71e2606f67..1f612ca85a 100644 --- a/substrate/collator/Cargo.toml +++ b/substrate/collator/Cargo.toml @@ -5,5 +5,5 @@ authors = ["Parity Technologies "] description = "Abstract collation logic" [dependencies] -polkadot-primitives = { path = "../primitives", version = "0.1" } +substrate-primitives = { path = "../primitives", version = "0.1" } futures = "0.1.17" diff --git a/substrate/collator/src/lib.rs b/substrate/collator/src/lib.rs index 044050e79b..da16e7520e 100644 --- a/substrate/collator/src/lib.rs +++ b/substrate/collator/src/lib.rs @@ -45,7 +45,7 @@ //! to be performed, as the collation logic itself. extern crate futures; -extern crate polkadot_primitives as primitives; +extern crate substrate_primitives as primitives; use std::collections::{BTreeSet, BTreeMap}; diff --git a/substrate/ed25519/Cargo.toml b/substrate/ed25519/Cargo.toml index e6ba80d9a5..6d11f67920 100644 --- a/substrate/ed25519/Cargo.toml +++ b/substrate/ed25519/Cargo.toml @@ -6,5 +6,5 @@ authors = ["Parity Technologies "] [dependencies] ring = "0.12" untrusted = "0.5" -polkadot-primitives = { version = "0.1", path = "../primitives" } +substrate-primitives = { version = "0.1", path = "../primitives" } rustc-hex = "1.0" diff --git a/substrate/ed25519/src/lib.rs b/substrate/ed25519/src/lib.rs index 33c25895b7..287d83e36d 100644 --- a/substrate/ed25519/src/lib.rs +++ b/substrate/ed25519/src/lib.rs @@ -17,7 +17,7 @@ //! Simple Ed25519 API. extern crate ring; -extern crate polkadot_primitives as primitives; +extern crate substrate_primitives as primitives; extern crate untrusted; extern crate rustc_hex; diff --git a/substrate/executor/src/lib.rs b/substrate/executor/src/lib.rs index 79b212eb2e..cb754a93f5 100644 --- a/substrate/executor/src/lib.rs +++ b/substrate/executor/src/lib.rs @@ -29,7 +29,7 @@ extern crate substrate_codec as codec; extern crate polkadot_runtime_std as runtime_std; -extern crate polkadot_primitives as primitives; +extern crate substrate_primitives as primitives; extern crate polkadot_serializer as serializer; extern crate polkadot_state_machine as state_machine; extern crate ed25519; diff --git a/substrate/native-runtime/Cargo.toml b/substrate/native-runtime/Cargo.toml index b985aa17a9..90c4bdee72 100644 --- a/substrate/native-runtime/Cargo.toml +++ b/substrate/native-runtime/Cargo.toml @@ -6,11 +6,11 @@ authors = ["Parity Technologies "] [dependencies] substrate-codec = { path = "../codec", version = "0.1" } polkadot-runtime-std = { path = "../runtime-std", version = "0.1" } -polkadot-primitives = { path = "../primitives", version = "0.1" } +substrate-primitives = { path = "../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", "polkadot-runtime-std/std", "polkadot-primitives/std", "log"] +std = ["substrate-codec/std", "polkadot-runtime-std/std", "substrate-primitives/std", "log"] diff --git a/substrate/network/Cargo.toml b/substrate/network/Cargo.toml index d3b62e4a4c..4a49ae5283 100644 --- a/substrate/network/Cargo.toml +++ b/substrate/network/Cargo.toml @@ -10,7 +10,7 @@ authors = ["Parity Technologies "] [dependencies] ethcore-network = { git = "https://github.com/paritytech/parity.git" } ethcore-io = { git = "https://github.com/paritytech/parity.git" } -polkadot-primitives = { path = "../primitives" } +substrate-primitives = { path = "../primitives" } polkadot-client = { path = "../client" } polkadot-state-machine = { path = "../state-machine" } polkadot-serializer = { path = "../serializer" } diff --git a/substrate/network/src/lib.rs b/substrate/network/src/lib.rs index df06532289..0116363dca 100644 --- a/substrate/network/src/lib.rs +++ b/substrate/network/src/lib.rs @@ -27,7 +27,7 @@ extern crate semver; extern crate parking_lot; extern crate smallvec; extern crate ipnetwork; -extern crate polkadot_primitives as primitives; +extern crate substrate_primitives as primitives; extern crate polkadot_client as client; extern crate polkadot_state_machine as state_machine; extern crate polkadot_serializer as ser; diff --git a/substrate/primitives/Cargo.toml b/substrate/primitives/Cargo.toml index 7fc2544f61..4339977804 100644 --- a/substrate/primitives/Cargo.toml +++ b/substrate/primitives/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "polkadot-primitives" +name = "substrate-primitives" version = "0.1.0" authors = ["Parity Technologies "] diff --git a/substrate/rpc/Cargo.toml b/substrate/rpc/Cargo.toml index a2afb0c118..a19dc5353c 100644 --- a/substrate/rpc/Cargo.toml +++ b/substrate/rpc/Cargo.toml @@ -8,7 +8,7 @@ error-chain = "0.11" jsonrpc-core = { git="https://github.com/paritytech/jsonrpc.git" } jsonrpc-macros = { git="https://github.com/paritytech/jsonrpc.git" } polkadot-client = { path = "../client" } -polkadot-primitives = { path = "../primitives" } +substrate-primitives = { path = "../primitives" } polkadot-state-machine = { path = "../state-machine" } [dev-dependencies] diff --git a/substrate/rpc/src/lib.rs b/substrate/rpc/src/lib.rs index 2feef148c5..701eed9ff9 100644 --- a/substrate/rpc/src/lib.rs +++ b/substrate/rpc/src/lib.rs @@ -20,7 +20,7 @@ extern crate jsonrpc_core as rpc; extern crate polkadot_client as client; -extern crate polkadot_primitives as primitives; +extern crate substrate_primitives as primitives; extern crate polkadot_state_machine as state_machine; #[macro_use] diff --git a/substrate/runtime-std/Cargo.toml b/substrate/runtime-std/Cargo.toml index b88baee4f1..badf3355fb 100644 --- a/substrate/runtime-std/Cargo.toml +++ b/substrate/runtime-std/Cargo.toml @@ -12,7 +12,7 @@ pwasm-alloc = { path = "../wasm-runtime/pwasm-alloc", version = "0.1" } pwasm-libc = { path = "../wasm-runtime/pwasm-libc", version = "0.1" } environmental = { path = "../environmental", version = "0.1", optional = true } polkadot-state-machine = { path = "../state-machine", version = "0.1", optional = true } -polkadot-primitives = { path = "../primitives", version = "0.1", default_features = false } +substrate-primitives = { path = "../primitives", version = "0.1", default_features = false } substrate-codec = { path = "../codec", version = "0.1", default_features = false } triehash = { version = "0.1", optional = true } ed25519 = { path = "../ed25519", version = "0.1", optional = true } @@ -23,7 +23,7 @@ std = [ "environmental", "polkadot-state-machine", "triehash", - "polkadot-primitives/std", + "substrate-primitives/std", "substrate-codec/std", "ed25519", ] diff --git a/substrate/runtime-std/with_std.rs b/substrate/runtime-std/with_std.rs index d03cf840fc..9c4cb5e1bd 100644 --- a/substrate/runtime-std/with_std.rs +++ b/substrate/runtime-std/with_std.rs @@ -18,7 +18,7 @@ extern crate environmental; extern crate polkadot_state_machine; -extern crate polkadot_primitives as primitives; +extern crate substrate_primitives as primitives; extern crate triehash; extern crate ed25519; diff --git a/substrate/runtime-std/without_std.rs b/substrate/runtime-std/without_std.rs index f599f6c3d2..6176012370 100644 --- a/substrate/runtime-std/without_std.rs +++ b/substrate/runtime-std/without_std.rs @@ -6,7 +6,7 @@ extern crate pwasm_libc; #[cfg(feature = "nightly")] extern crate pwasm_alloc; -extern crate polkadot_primitives as primitives; +extern crate substrate_primitives as primitives; pub use alloc::vec; pub use alloc::boxed; diff --git a/substrate/state-machine/Cargo.toml b/substrate/state-machine/Cargo.toml index 65c6feed54..d326d1f6a9 100644 --- a/substrate/state-machine/Cargo.toml +++ b/substrate/state-machine/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Parity Technologies "] description = "Polkadot State Machine" [dependencies] -polkadot-primitives = { path = "../primitives", version = "0.1.0" } +substrate-primitives = { path = "../primitives", version = "0.1.0" } hashdb = "0.1.1" patricia-trie = "0.1.0" memorydb = "0.1.1" diff --git a/substrate/state-machine/src/lib.rs b/substrate/state-machine/src/lib.rs index 386c5da20a..6998153f82 100644 --- a/substrate/state-machine/src/lib.rs +++ b/substrate/state-machine/src/lib.rs @@ -18,7 +18,7 @@ #![warn(missing_docs)] -extern crate polkadot_primitives as primitives; +extern crate substrate_primitives as primitives; #[cfg_attr(test, macro_use)] extern crate hex_literal; diff --git a/substrate/validator/Cargo.toml b/substrate/validator/Cargo.toml index 39096165d5..ca69e1a98f 100644 --- a/substrate/validator/Cargo.toml +++ b/substrate/validator/Cargo.toml @@ -5,6 +5,6 @@ authors = ["Parity Technologies "] [dependencies] error-chain = "0.11" -polkadot-primitives = { path = "../primitives", version = "0.1" } +substrate-primitives = { path = "../primitives", version = "0.1" } polkadot-serializer = { path = "../serializer", version = "0.1" } serde = "1.0" diff --git a/substrate/validator/src/lib.rs b/substrate/validator/src/lib.rs index 131a4861aa..778db0155b 100644 --- a/substrate/validator/src/lib.rs +++ b/substrate/validator/src/lib.rs @@ -18,7 +18,7 @@ #[warn(missing_docs)] -extern crate polkadot_primitives as primitives; +extern crate substrate_primitives as primitives; extern crate polkadot_serializer as serializer; extern crate serde; diff --git a/substrate/wasm-runtime/Cargo.lock b/substrate/wasm-runtime/Cargo.lock index f807d33069..b8a9b800fc 100644 --- a/substrate/wasm-runtime/Cargo.lock +++ b/substrate/wasm-runtime/Cargo.lock @@ -92,7 +92,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "ed25519" version = "0.1.0" dependencies = [ - "polkadot-primitives 0.1.0", + "substrate-primitives 0.1.0", "ring 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "untrusted 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -376,7 +376,7 @@ dependencies = [ ] [[package]] -name = "polkadot-primitives" +name = "substrate-primitives" version = "0.1.0" dependencies = [ "blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", @@ -397,7 +397,7 @@ version = "0.1.0" dependencies = [ "ed25519 0.1.0", "environmental 0.1.0", - "polkadot-primitives 0.1.0", + "substrate-primitives 0.1.0", "polkadot-state-machine 0.1.0", "pwasm-alloc 0.1.0", "pwasm-libc 0.1.0", @@ -415,7 +415,7 @@ dependencies = [ "hex-literal 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "memorydb 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "patricia-trie 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "polkadot-primitives 0.1.0", + "substrate-primitives 0.1.0", "triehash 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -547,7 +547,7 @@ dependencies = [ name = "runtime-polkadot" version = "0.1.0" dependencies = [ - "polkadot-primitives 0.1.0", + "substrate-primitives 0.1.0", "polkadot-runtime-std 0.1.0", "substrate-codec 0.1.0", ] diff --git a/substrate/wasm-runtime/polkadot/Cargo.toml b/substrate/wasm-runtime/polkadot/Cargo.toml index 45b8c711e6..1bd0618a91 100644 --- a/substrate/wasm-runtime/polkadot/Cargo.toml +++ b/substrate/wasm-runtime/polkadot/Cargo.toml @@ -9,8 +9,8 @@ crate-type = ["cdylib"] [dependencies] substrate-codec = { path = "../../codec", version = "0.1", default-features = false } polkadot-runtime-std = { path = "../../runtime-std", version = "0.1", default-features = false } -polkadot-primitives = { path = "../../primitives", version = "0.1", default-features = false } +substrate-primitives = { path = "../../primitives", version = "0.1", default-features = false } [features] default = [] -std = ["substrate-codec/std", "polkadot-runtime-std/std", "polkadot-primitives/std"] +std = ["substrate-codec/std", "polkadot-runtime-std/std", "substrate-primitives/std"] diff --git a/substrate/wasm-runtime/polkadot/src/lib.rs b/substrate/wasm-runtime/polkadot/src/lib.rs index 098fdd09a7..81b0e0c032 100644 --- a/substrate/wasm-runtime/polkadot/src/lib.rs +++ b/substrate/wasm-runtime/polkadot/src/lib.rs @@ -28,7 +28,7 @@ extern crate rustc_hex; extern crate log; extern crate substrate_codec as codec; -extern crate polkadot_primitives as primitives; +extern crate substrate_primitives as primitives; #[cfg(test)] #[macro_use] From 13fb513a3d05f13ca21c854d98180baf3fff7193 Mon Sep 17 00:00:00 2001 From: Gav Date: Wed, 7 Feb 2018 11:34:29 +0100 Subject: [PATCH 05/15] Finish rename. --- substrate/Cargo.lock | 54 +++++++++++++++++------------------ substrate/executor/Cargo.toml | 6 ++-- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/substrate/Cargo.lock b/substrate/Cargo.lock index 38f0712010..e6ddb9cf39 100644 --- a/substrate/Cargo.lock +++ b/substrate/Cargo.lock @@ -195,9 +195,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "ed25519" version = "0.1.0" dependencies = [ - "substrate-primitives 0.1.0", "ring 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (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)", ] @@ -827,10 +827,10 @@ version = "0.1.0" dependencies = [ "hex-literal 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-primitives 0.1.0", "polkadot-runtime-std 0.1.0", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "substrate-codec 0.1.0", + "substrate-primitives 0.1.0", ] [[package]] @@ -988,9 +988,9 @@ dependencies = [ "error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "polkadot-client 0.1.0", - "substrate-primitives 0.1.0", "polkadot-rpc-servers 0.1.0", "substrate-executor 0.1.0", + "substrate-primitives 0.1.0", ] [[package]] @@ -1003,11 +1003,11 @@ dependencies = [ "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "native-runtime 0.1.0", "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-primitives 0.1.0", "polkadot-serializer 0.1.0", "polkadot-state-machine 0.1.0", "substrate-codec 0.1.0", "substrate-executor 0.1.0", + "substrate-primitives 0.1.0", "triehash 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1033,7 +1033,6 @@ dependencies = [ "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)", "polkadot-client 0.1.0", - "substrate-primitives 0.1.0", "polkadot-serializer 0.1.0", "polkadot-state-machine 0.1.0", "rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1042,24 +1041,7 @@ dependencies = [ "serde_derive 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.4.4 (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.1 (registry+https://github.com/rust-lang/crates.io-index)", - "crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "fixed-hash 0.1.3 (git+https://github.com/rphmeier/primitives.git?branch=compile-for-wasm)", - "polkadot-serializer 0.1.0", - "pretty_assertions 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-hex 2.0.0 (git+https://github.com/rphmeier/rustc-hex.git)", - "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-codec 0.1.0", - "twox-hash 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "uint 0.1.2 (git+https://github.com/rphmeier/primitives.git?branch=compile-for-wasm)", + "substrate-primitives 0.1.0", ] [[package]] @@ -1071,9 +1053,9 @@ dependencies = [ "jsonrpc-core 8.0.1 (git+https://github.com/paritytech/jsonrpc.git)", "jsonrpc-macros 8.0.0 (git+https://github.com/paritytech/jsonrpc.git)", "polkadot-client 0.1.0", - "substrate-primitives 0.1.0", "polkadot-state-machine 0.1.0", "substrate-executor 0.1.0", + "substrate-primitives 0.1.0", ] [[package]] @@ -1091,12 +1073,12 @@ version = "0.1.0" dependencies = [ "ed25519 0.1.0", "environmental 0.1.0", - "substrate-primitives 0.1.0", "polkadot-state-machine 0.1.0", "pwasm-alloc 0.1.0", "pwasm-libc 0.1.0", "rustc_version 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "substrate-codec 0.1.0", + "substrate-primitives 0.1.0", "triehash 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1126,9 +1108,9 @@ name = "polkadot-validator" version = "0.1.0" dependencies = [ "error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-primitives 0.1.0", "polkadot-serializer 0.1.0", "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", + "substrate-primitives 0.1.0", ] [[package]] @@ -1464,7 +1446,6 @@ dependencies = [ "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "native-runtime 0.1.0", "parity-wasm 0.15.4 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-primitives 0.1.0", "polkadot-runtime-std 0.1.0", "polkadot-serializer 0.1.0", "polkadot-state-machine 0.1.0", @@ -1472,9 +1453,28 @@ dependencies = [ "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", "substrate-codec 0.1.0", + "substrate-primitives 0.1.0", "triehash 0.1.0 (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.1 (registry+https://github.com/rust-lang/crates.io-index)", + "crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "fixed-hash 0.1.3 (git+https://github.com/rphmeier/primitives.git?branch=compile-for-wasm)", + "polkadot-serializer 0.1.0", + "pretty_assertions 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-hex 2.0.0 (git+https://github.com/rphmeier/rustc-hex.git)", + "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", + "substrate-codec 0.1.0", + "twox-hash 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "uint 0.1.2 (git+https://github.com/rphmeier/primitives.git?branch=compile-for-wasm)", +] + [[package]] name = "subtle" version = "0.1.0" diff --git a/substrate/executor/Cargo.toml b/substrate/executor/Cargo.toml index 64625e760f..c098d3d117 100644 --- a/substrate/executor/Cargo.toml +++ b/substrate/executor/Cargo.toml @@ -7,17 +7,17 @@ authors = ["Parity Technologies "] error-chain = "0.11" substrate-codec = { path = "../codec", version = "0.1" } polkadot-runtime-std = { path = "../runtime-std", version = "0.1" } -polkadot-primitives = { path = "../primitives", version = "0.1" } +substrate-primitives = { path = "../primitives", version = "0.1" } polkadot-serializer = { path = "../serializer", version = "0.1" } polkadot-state-machine = { path = "../state-machine" , version = "0.1" } +native-runtime = { path = "../native-runtime", version = "0.1" } +ed25519 = { path = "../ed25519", version = "0.1" } serde = "1.0" serde_derive = "1.0" parity-wasm = "0.15.0" byteorder = "1.1" rustc-hex = "1.0.0" -native-runtime = { path = "../native-runtime", version = "0.1" } triehash = "0.1.0" -ed25519 = { path = "../ed25519", version = "0.1" } hex-literal = "0.1.0" log = "0.3" From 43ef2ca6f367744d9f7b65b1039744b3c5c3bcb2 Mon Sep 17 00:00:00 2001 From: Gav Date: Wed, 7 Feb 2018 11:38:40 +0100 Subject: [PATCH 06/15] New wasm binaries. --- substrate/wasm-runtime/Cargo.lock | 38 +++++++++--------- .../release/runtime_polkadot.compact.wasm | Bin 69428 -> 69581 bytes .../release/runtime_polkadot.wasm | Bin 69507 -> 69660 bytes .../release/runtime_test.compact.wasm | Bin 14104 -> 14104 bytes .../release/runtime_test.wasm | Bin 14229 -> 14229 bytes 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/substrate/wasm-runtime/Cargo.lock b/substrate/wasm-runtime/Cargo.lock index b8a9b800fc..a91e7a7233 100644 --- a/substrate/wasm-runtime/Cargo.lock +++ b/substrate/wasm-runtime/Cargo.lock @@ -92,9 +92,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "ed25519" version = "0.1.0" dependencies = [ - "substrate-primitives 0.1.0", "ring 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (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)", ] @@ -375,34 +375,18 @@ dependencies = [ "crunchy 0.1.6 (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.1 (registry+https://github.com/rust-lang/crates.io-index)", - "crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "fixed-hash 0.1.3 (git+https://github.com/rphmeier/primitives.git?branch=compile-for-wasm)", - "rustc-hex 2.0.0 (git+https://github.com/rphmeier/rustc-hex.git)", - "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-codec 0.1.0", - "twox-hash 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "uint 0.1.2 (git+https://github.com/rphmeier/primitives.git?branch=compile-for-wasm)", -] - [[package]] name = "polkadot-runtime-std" version = "0.1.0" dependencies = [ "ed25519 0.1.0", "environmental 0.1.0", - "substrate-primitives 0.1.0", "polkadot-state-machine 0.1.0", "pwasm-alloc 0.1.0", "pwasm-libc 0.1.0", "rustc_version 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "substrate-codec 0.1.0", + "substrate-primitives 0.1.0", "triehash 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -547,9 +531,9 @@ dependencies = [ name = "runtime-polkadot" version = "0.1.0" dependencies = [ - "substrate-primitives 0.1.0", "polkadot-runtime-std 0.1.0", "substrate-codec 0.1.0", + "substrate-primitives 0.1.0", ] [[package]] @@ -633,6 +617,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "substrate-codec" version = "0.1.0" +[[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.1 (registry+https://github.com/rust-lang/crates.io-index)", + "crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "fixed-hash 0.1.3 (git+https://github.com/rphmeier/primitives.git?branch=compile-for-wasm)", + "rustc-hex 2.0.0 (git+https://github.com/rphmeier/rustc-hex.git)", + "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", + "substrate-codec 0.1.0", + "twox-hash 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "uint 0.1.2 (git+https://github.com/rphmeier/primitives.git?branch=compile-for-wasm)", +] + [[package]] name = "syn" version = "0.11.11" diff --git a/substrate/wasm-runtime/target/wasm32-unknown-unknown/release/runtime_polkadot.compact.wasm b/substrate/wasm-runtime/target/wasm32-unknown-unknown/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5#Y=*#L}AV))L;{b+X;8oA=iB*PkfJm~Hp4A{`(bv}eCt!kc;) zF~_Q5tfgq(FXCDI`NekBNI<0m3x3gr9_CDUWdB^kQ<=FA>>g~P3^VUHMzNI(USt0u z>_FaY92$lF&UI+}9XdV%6pQH6aWux93mvAF2NYW5ar~mv#bOtWxKDx6t+-R2rnRTP z_Htw=!S=a*1-z#_vGEv7IZc8>A@(xDM<>yF%<-3f2y<4c1@fI{Q`U^~26O!InD*?+ WuI$+|F2zijTl#*TnC~LjX#O9h9!LWK diff --git a/substrate/wasm-runtime/target/wasm32-unknown-unknown/release/runtime_test.compact.wasm b/substrate/wasm-runtime/target/wasm32-unknown-unknown/release/runtime_test.compact.wasm index d317445bea0143b128ddea96aee60d806355e374..3c4e94098f7841c66b1de54593cf9747b823cfbb 100644 GIT binary patch delta 166 zcmbP{HzRMuY8J)^lh?4c0!bs*e#Qrz53y=70jam_tHn7MNDD|Xa67h4ULdauRB%lG zH;_D}5CxQ%Rb0jh!{*N#H+g*~NOMbU;ALPCWME*p0HlS1 z^eH9=22LQ&;J87WTQE7XATc?!q*5WjEVU>tC%>G*@q#qBa871YVopwevVKuwd3;%F IvR+X!0E~k+UH||9 diff --git a/substrate/wasm-runtime/target/wasm32-unknown-unknown/release/runtime_test.wasm b/substrate/wasm-runtime/target/wasm32-unknown-unknown/release/runtime_test.wasm index 0c77df8679b873892803739ec24f2e49f545077e..6a79823c536ce4669af6e06271c92dcef34806b4 100644 GIT binary patch delta 148 zcmbQ5KQ(`Y1}o!($(pRKKyp26KjVYV_H0^AKq`x4wK&HDX#qI~ZpW6%vI?p|1)l delta 148 zcmbQ5KQ(`Y1}o!)$(pRKKyp26KjVbW_H0^AKq`x4wK&HHX#qI~ZpR6eWffF`3Y-;w z14(|k_dCewBb4zUCWnd6wU|_faq=kX> pDJBL6P9V+TxIvm*FgdXxF*&oOQX#)AwJ0qoznsDG!sL2$F#x6rEf4?z From 6071774f574b3b746efce39732e86e706f4ff193 Mon Sep 17 00:00:00 2001 From: Gav Date: Wed, 7 Feb 2018 11:44:32 +0100 Subject: [PATCH 07/15] Rename polkadot-state-machine -> substrate-state-machine --- substrate/Cargo.lock | 36 +++++++++++++------------- substrate/client/Cargo.toml | 2 +- substrate/client/src/lib.rs | 2 +- substrate/executor/Cargo.toml | 2 +- substrate/executor/src/lib.rs | 2 +- substrate/network/Cargo.toml | 2 +- substrate/network/src/lib.rs | 2 +- substrate/rpc/Cargo.toml | 2 +- substrate/rpc/src/lib.rs | 2 +- substrate/runtime-std/Cargo.toml | 4 +-- substrate/runtime-std/with_std.rs | 4 +-- substrate/state-machine/Cargo.toml | 4 +-- substrate/state-machine/src/backend.rs | 8 +++--- substrate/state-machine/src/ext.rs | 8 +++--- substrate/state-machine/src/lib.rs | 10 +++---- substrate/state-machine/src/testing.rs | 8 +++--- substrate/wasm-runtime/Cargo.lock | 4 +-- 17 files changed, 51 insertions(+), 51 deletions(-) diff --git a/substrate/Cargo.lock b/substrate/Cargo.lock index e6ddb9cf39..919454982a 100644 --- a/substrate/Cargo.lock +++ b/substrate/Cargo.lock @@ -1004,10 +1004,10 @@ dependencies = [ "native-runtime 0.1.0", "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "polkadot-serializer 0.1.0", - "polkadot-state-machine 0.1.0", "substrate-codec 0.1.0", "substrate-executor 0.1.0", "substrate-primitives 0.1.0", + "substrate-state-machine 0.1.0", "triehash 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1034,7 +1034,6 @@ dependencies = [ "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "polkadot-client 0.1.0", "polkadot-serializer 0.1.0", - "polkadot-state-machine 0.1.0", "rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", "semver 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1042,6 +1041,7 @@ dependencies = [ "serde_json 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "substrate-primitives 0.1.0", + "substrate-state-machine 0.1.0", ] [[package]] @@ -1053,9 +1053,9 @@ dependencies = [ "jsonrpc-core 8.0.1 (git+https://github.com/paritytech/jsonrpc.git)", "jsonrpc-macros 8.0.0 (git+https://github.com/paritytech/jsonrpc.git)", "polkadot-client 0.1.0", - "polkadot-state-machine 0.1.0", "substrate-executor 0.1.0", "substrate-primitives 0.1.0", + "substrate-state-machine 0.1.0", ] [[package]] @@ -1073,12 +1073,12 @@ version = "0.1.0" dependencies = [ "ed25519 0.1.0", "environmental 0.1.0", - "polkadot-state-machine 0.1.0", "pwasm-alloc 0.1.0", "pwasm-libc 0.1.0", "rustc_version 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "substrate-codec 0.1.0", "substrate-primitives 0.1.0", + "substrate-state-machine 0.1.0", "triehash 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1090,19 +1090,6 @@ dependencies = [ "serde_json 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "polkadot-state-machine" -version = "0.1.0" -dependencies = [ - "byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "hashdb 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "hex-literal 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "memorydb 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "patricia-trie 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-primitives 0.1.0", - "triehash 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "polkadot-validator" version = "0.1.0" @@ -1448,12 +1435,12 @@ dependencies = [ "parity-wasm 0.15.4 (registry+https://github.com/rust-lang/crates.io-index)", "polkadot-runtime-std 0.1.0", "polkadot-serializer 0.1.0", - "polkadot-state-machine 0.1.0", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", "substrate-codec 0.1.0", "substrate-primitives 0.1.0", + "substrate-state-machine 0.1.0", "triehash 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1475,6 +1462,19 @@ dependencies = [ "uint 0.1.2 (git+https://github.com/rphmeier/primitives.git?branch=compile-for-wasm)", ] +[[package]] +name = "substrate-state-machine" +version = "0.1.0" +dependencies = [ + "byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "hashdb 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "hex-literal 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "memorydb 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "patricia-trie 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "substrate-primitives 0.1.0", + "triehash 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "subtle" version = "0.1.0" diff --git a/substrate/client/Cargo.toml b/substrate/client/Cargo.toml index 313b48cce3..0901b92b73 100644 --- a/substrate/client/Cargo.toml +++ b/substrate/client/Cargo.toml @@ -8,7 +8,7 @@ error-chain = "0.11" log = "0.3" parking_lot = "0.4" substrate-primitives = { path = "../primitives", version = "0.1" } -polkadot-state-machine = { path = "../state-machine", version = "0.1" } +substrate-state-machine = { path = "../state-machine", version = "0.1" } polkadot-serializer = { path = "../serializer" } substrate-executor = { path = "../executor" } substrate-codec = { path = "../codec", version = "0.1" } diff --git a/substrate/client/src/lib.rs b/substrate/client/src/lib.rs index 02bc273cac..d38cda6945 100644 --- a/substrate/client/src/lib.rs +++ b/substrate/client/src/lib.rs @@ -19,7 +19,7 @@ #![warn(missing_docs)] extern crate substrate_primitives as primitives; -extern crate polkadot_state_machine as state_machine; +extern crate substrate_state_machine as state_machine; extern crate polkadot_serializer as ser; extern crate substrate_codec as codec; extern crate substrate_executor; diff --git a/substrate/executor/Cargo.toml b/substrate/executor/Cargo.toml index c098d3d117..081ade6b0f 100644 --- a/substrate/executor/Cargo.toml +++ b/substrate/executor/Cargo.toml @@ -9,7 +9,7 @@ substrate-codec = { path = "../codec", version = "0.1" } polkadot-runtime-std = { path = "../runtime-std", version = "0.1" } substrate-primitives = { path = "../primitives", version = "0.1" } polkadot-serializer = { path = "../serializer", version = "0.1" } -polkadot-state-machine = { path = "../state-machine" , version = "0.1" } +substrate-state-machine = { path = "../state-machine" , version = "0.1" } native-runtime = { path = "../native-runtime", version = "0.1" } ed25519 = { path = "../ed25519", version = "0.1" } serde = "1.0" diff --git a/substrate/executor/src/lib.rs b/substrate/executor/src/lib.rs index cb754a93f5..9d5a012c34 100644 --- a/substrate/executor/src/lib.rs +++ b/substrate/executor/src/lib.rs @@ -31,7 +31,7 @@ extern crate substrate_codec as codec; extern crate polkadot_runtime_std as runtime_std; extern crate substrate_primitives as primitives; extern crate polkadot_serializer as serializer; -extern crate polkadot_state_machine as state_machine; +extern crate substrate_state_machine as state_machine; extern crate ed25519; extern crate serde; diff --git a/substrate/network/Cargo.toml b/substrate/network/Cargo.toml index 4a49ae5283..e2e901a0df 100644 --- a/substrate/network/Cargo.toml +++ b/substrate/network/Cargo.toml @@ -12,7 +12,7 @@ ethcore-network = { git = "https://github.com/paritytech/parity.git" } ethcore-io = { git = "https://github.com/paritytech/parity.git" } substrate-primitives = { path = "../primitives" } polkadot-client = { path = "../client" } -polkadot-state-machine = { path = "../state-machine" } +substrate-state-machine = { path = "../state-machine" } polkadot-serializer = { path = "../serializer" } log = "0.3" env_logger = "0.4" diff --git a/substrate/network/src/lib.rs b/substrate/network/src/lib.rs index 0116363dca..059ba93221 100644 --- a/substrate/network/src/lib.rs +++ b/substrate/network/src/lib.rs @@ -29,7 +29,7 @@ extern crate smallvec; extern crate ipnetwork; extern crate substrate_primitives as primitives; extern crate polkadot_client as client; -extern crate polkadot_state_machine as state_machine; +extern crate substrate_state_machine as state_machine; extern crate polkadot_serializer as ser; extern crate serde; extern crate serde_json; diff --git a/substrate/rpc/Cargo.toml b/substrate/rpc/Cargo.toml index a19dc5353c..fdf9f7595b 100644 --- a/substrate/rpc/Cargo.toml +++ b/substrate/rpc/Cargo.toml @@ -9,7 +9,7 @@ jsonrpc-core = { git="https://github.com/paritytech/jsonrpc.git" } jsonrpc-macros = { git="https://github.com/paritytech/jsonrpc.git" } polkadot-client = { path = "../client" } substrate-primitives = { path = "../primitives" } -polkadot-state-machine = { path = "../state-machine" } +substrate-state-machine = { path = "../state-machine" } [dev-dependencies] assert_matches = "1.1" diff --git a/substrate/rpc/src/lib.rs b/substrate/rpc/src/lib.rs index 701eed9ff9..68935fb00b 100644 --- a/substrate/rpc/src/lib.rs +++ b/substrate/rpc/src/lib.rs @@ -21,7 +21,7 @@ extern crate jsonrpc_core as rpc; extern crate polkadot_client as client; extern crate substrate_primitives as primitives; -extern crate polkadot_state_machine as state_machine; +extern crate substrate_state_machine as state_machine; #[macro_use] extern crate error_chain; diff --git a/substrate/runtime-std/Cargo.toml b/substrate/runtime-std/Cargo.toml index badf3355fb..4429017974 100644 --- a/substrate/runtime-std/Cargo.toml +++ b/substrate/runtime-std/Cargo.toml @@ -11,7 +11,7 @@ rustc_version = "0.2" pwasm-alloc = { path = "../wasm-runtime/pwasm-alloc", version = "0.1" } pwasm-libc = { path = "../wasm-runtime/pwasm-libc", version = "0.1" } environmental = { path = "../environmental", version = "0.1", optional = true } -polkadot-state-machine = { path = "../state-machine", version = "0.1", optional = true } +substrate-state-machine = { path = "../state-machine", version = "0.1", optional = true } substrate-primitives = { path = "../primitives", version = "0.1", default_features = false } substrate-codec = { path = "../codec", version = "0.1", default_features = false } triehash = { version = "0.1", optional = true } @@ -21,7 +21,7 @@ ed25519 = { path = "../ed25519", version = "0.1", optional = true } default = ["std"] std = [ "environmental", - "polkadot-state-machine", + "substrate-state-machine", "triehash", "substrate-primitives/std", "substrate-codec/std", diff --git a/substrate/runtime-std/with_std.rs b/substrate/runtime-std/with_std.rs index 9c4cb5e1bd..88bfbd940c 100644 --- a/substrate/runtime-std/with_std.rs +++ b/substrate/runtime-std/with_std.rs @@ -17,7 +17,7 @@ #[macro_use] extern crate environmental; -extern crate polkadot_state_machine; +extern crate substrate_state_machine; extern crate substrate_primitives as primitives; extern crate triehash; extern crate ed25519; @@ -32,7 +32,7 @@ pub use std::mem; // re-export hashing functions. pub use primitives::{blake2_256, twox_128, twox_256}; -pub use polkadot_state_machine::{Externalities, ExternalitiesError, TestExternalities}; +pub use substrate_state_machine::{Externalities, ExternalitiesError, TestExternalities}; use primitives::hexdisplay::HexDisplay; // TODO: use the real error, not NoError. diff --git a/substrate/state-machine/Cargo.toml b/substrate/state-machine/Cargo.toml index d326d1f6a9..646c6d7f1d 100644 --- a/substrate/state-machine/Cargo.toml +++ b/substrate/state-machine/Cargo.toml @@ -1,8 +1,8 @@ [package] -name = "polkadot-state-machine" +name = "substrate-state-machine" version = "0.1.0" authors = ["Parity Technologies "] -description = "Polkadot State Machine" +description = "Substrate State Machine" [dependencies] substrate-primitives = { path = "../primitives", version = "0.1.0" } diff --git a/substrate/state-machine/src/backend.rs b/substrate/state-machine/src/backend.rs index 2ad10e44d3..a1dec6dc3a 100644 --- a/substrate/state-machine/src/backend.rs +++ b/substrate/state-machine/src/backend.rs @@ -1,18 +1,18 @@ // Copyright 2017 Parity Technologies (UK) Ltd. -// This file is part of Polkadot. +// This file is part of Substrate. -// Polkadot 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. -// Polkadot 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 Polkadot. If not, see . +// along with Substrate. If not, see . //! State machine backends. These manage the code and storage of contracts. diff --git a/substrate/state-machine/src/ext.rs b/substrate/state-machine/src/ext.rs index 1beca17fa6..e0176ad41c 100644 --- a/substrate/state-machine/src/ext.rs +++ b/substrate/state-machine/src/ext.rs @@ -1,18 +1,18 @@ // Copyright 2017 Parity Technologies (UK) Ltd. -// This file is part of Polkadot. +// This file is part of Substrate. -// Polkadot 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. -// Polkadot 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 Polkadot. If not, see . +// along with Substrate. If not, see . //! Conrete externalities implementation. diff --git a/substrate/state-machine/src/lib.rs b/substrate/state-machine/src/lib.rs index 6998153f82..8a7af31a05 100644 --- a/substrate/state-machine/src/lib.rs +++ b/substrate/state-machine/src/lib.rs @@ -1,20 +1,20 @@ // Copyright 2017 Parity Technologies (UK) Ltd. -// This file is part of Polkadot. +// This file is part of Substrate. -// Polkadot 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. -// Polkadot 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 Polkadot. If not, see . +// along with Substrate. If not, see . -//! Polkadot state machine implementation. +//! Substrate state machine implementation. #![warn(missing_docs)] diff --git a/substrate/state-machine/src/testing.rs b/substrate/state-machine/src/testing.rs index 1c9c4dfcf8..a85e1d3f4a 100644 --- a/substrate/state-machine/src/testing.rs +++ b/substrate/state-machine/src/testing.rs @@ -1,18 +1,18 @@ // Copyright 2017 Parity Technologies (UK) Ltd. -// This file is part of Polkadot. +// This file is part of Substrate. -// Polkadot 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. -// Polkadot 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 Polkadot. If not, see . +// along with Substrate. If not, see . //! Test implementation for Externalities. diff --git a/substrate/wasm-runtime/Cargo.lock b/substrate/wasm-runtime/Cargo.lock index a91e7a7233..a5ce44c433 100644 --- a/substrate/wasm-runtime/Cargo.lock +++ b/substrate/wasm-runtime/Cargo.lock @@ -381,7 +381,7 @@ version = "0.1.0" dependencies = [ "ed25519 0.1.0", "environmental 0.1.0", - "polkadot-state-machine 0.1.0", + "substrate-state-machine 0.1.0", "pwasm-alloc 0.1.0", "pwasm-libc 0.1.0", "rustc_version 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -391,7 +391,7 @@ dependencies = [ ] [[package]] -name = "polkadot-state-machine" +name = "substrate-state-machine" version = "0.1.0" dependencies = [ "byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", From a5195dfce6365f1dc7ff8c98a47fffcc0fed90e6 Mon Sep 17 00:00:00 2001 From: Gav Date: Wed, 7 Feb 2018 11:47:30 +0100 Subject: [PATCH 08/15] Rename polkadot-serializer -> substrate-serializer --- substrate/Cargo.lock | 26 ++++++++-------- substrate/client/Cargo.toml | 2 +- substrate/client/src/lib.rs | 2 +- substrate/executor/Cargo.toml | 14 ++++----- substrate/executor/src/lib.rs | 2 +- substrate/network/Cargo.toml | 2 +- substrate/network/src/lib.rs | 2 +- substrate/primitives/Cargo.toml | 4 +-- substrate/primitives/src/hash.rs | 2 +- substrate/primitives/src/lib.rs | 2 +- substrate/primitives/src/parachain.rs | 2 +- substrate/primitives/src/relay/block.rs | 2 +- substrate/primitives/src/uint.rs | 2 +- substrate/primitives/src/validator.rs | 2 +- substrate/serializer/Cargo.toml | 2 +- substrate/serializer/src/lib.rs | 11 ++++--- substrate/validator/Cargo.toml | 4 +-- substrate/validator/src/lib.rs | 2 +- substrate/wasm-runtime/Cargo.lock | 28 +++++++++--------- .../release/runtime_polkadot.compact.wasm | Bin 69581 -> 69581 bytes .../release/runtime_polkadot.wasm | Bin 69660 -> 69660 bytes 21 files changed, 56 insertions(+), 57 deletions(-) diff --git a/substrate/Cargo.lock b/substrate/Cargo.lock index 919454982a..41c2d747f5 100644 --- a/substrate/Cargo.lock +++ b/substrate/Cargo.lock @@ -1003,10 +1003,10 @@ dependencies = [ "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "native-runtime 0.1.0", "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "polkadot-serializer 0.1.0", "substrate-codec 0.1.0", "substrate-executor 0.1.0", "substrate-primitives 0.1.0", + "substrate-serializer 0.1.0", "substrate-state-machine 0.1.0", "triehash 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1033,7 +1033,6 @@ dependencies = [ "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)", "polkadot-client 0.1.0", - "polkadot-serializer 0.1.0", "rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", "semver 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1041,6 +1040,7 @@ dependencies = [ "serde_json 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "substrate-primitives 0.1.0", + "substrate-serializer 0.1.0", "substrate-state-machine 0.1.0", ] @@ -1082,22 +1082,14 @@ dependencies = [ "triehash 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "polkadot-serializer" -version = "0.1.0" -dependencies = [ - "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "polkadot-validator" version = "0.1.0" dependencies = [ "error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "polkadot-serializer 0.1.0", "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", "substrate-primitives 0.1.0", + "substrate-serializer 0.1.0", ] [[package]] @@ -1434,12 +1426,12 @@ dependencies = [ "native-runtime 0.1.0", "parity-wasm 0.15.4 (registry+https://github.com/rust-lang/crates.io-index)", "polkadot-runtime-std 0.1.0", - "polkadot-serializer 0.1.0", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", "substrate-codec 0.1.0", "substrate-primitives 0.1.0", + "substrate-serializer 0.1.0", "substrate-state-machine 0.1.0", "triehash 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1452,16 +1444,24 @@ dependencies = [ "byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "fixed-hash 0.1.3 (git+https://github.com/rphmeier/primitives.git?branch=compile-for-wasm)", - "polkadot-serializer 0.1.0", "pretty_assertions 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 2.0.0 (git+https://github.com/rphmeier/rustc-hex.git)", "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", "substrate-codec 0.1.0", + "substrate-serializer 0.1.0", "twox-hash 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "uint 0.1.2 (git+https://github.com/rphmeier/primitives.git?branch=compile-for-wasm)", ] +[[package]] +name = "substrate-serializer" +version = "0.1.0" +dependencies = [ + "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "substrate-state-machine" version = "0.1.0" diff --git a/substrate/client/Cargo.toml b/substrate/client/Cargo.toml index 0901b92b73..1239525530 100644 --- a/substrate/client/Cargo.toml +++ b/substrate/client/Cargo.toml @@ -9,7 +9,7 @@ log = "0.3" parking_lot = "0.4" substrate-primitives = { path = "../primitives", version = "0.1" } substrate-state-machine = { path = "../state-machine", version = "0.1" } -polkadot-serializer = { path = "../serializer" } +substrate-serializer = { path = "../serializer" } substrate-executor = { path = "../executor" } substrate-codec = { path = "../codec", version = "0.1" } native-runtime = { path = "../native-runtime" } diff --git a/substrate/client/src/lib.rs b/substrate/client/src/lib.rs index d38cda6945..44c2aaa2bf 100644 --- a/substrate/client/src/lib.rs +++ b/substrate/client/src/lib.rs @@ -20,7 +20,7 @@ extern crate substrate_primitives as primitives; extern crate substrate_state_machine as state_machine; -extern crate polkadot_serializer as ser; +extern crate substrate_serializer as ser; extern crate substrate_codec as codec; extern crate substrate_executor; extern crate native_runtime; diff --git a/substrate/executor/Cargo.toml b/substrate/executor/Cargo.toml index 081ade6b0f..4852f173ed 100644 --- a/substrate/executor/Cargo.toml +++ b/substrate/executor/Cargo.toml @@ -5,13 +5,13 @@ authors = ["Parity Technologies "] [dependencies] error-chain = "0.11" -substrate-codec = { path = "../codec", version = "0.1" } -polkadot-runtime-std = { path = "../runtime-std", version = "0.1" } -substrate-primitives = { path = "../primitives", version = "0.1" } -polkadot-serializer = { path = "../serializer", version = "0.1" } -substrate-state-machine = { path = "../state-machine" , version = "0.1" } -native-runtime = { path = "../native-runtime", version = "0.1" } -ed25519 = { path = "../ed25519", version = "0.1" } +substrate-codec = { path = "../codec" } +polkadot-runtime-std = { path = "../runtime-std" } +substrate-primitives = { path = "../primitives" } +substrate-serializer = { path = "../serializer" } +substrate-state-machine = { path = "../state-machine" } +native-runtime = { path = "../native-runtime" } +ed25519 = { path = "../ed25519" } serde = "1.0" serde_derive = "1.0" parity-wasm = "0.15.0" diff --git a/substrate/executor/src/lib.rs b/substrate/executor/src/lib.rs index 9d5a012c34..6b2858dd31 100644 --- a/substrate/executor/src/lib.rs +++ b/substrate/executor/src/lib.rs @@ -30,7 +30,7 @@ extern crate substrate_codec as codec; extern crate polkadot_runtime_std as runtime_std; extern crate substrate_primitives as primitives; -extern crate polkadot_serializer as serializer; +extern crate substrate_serializer as serializer; extern crate substrate_state_machine as state_machine; extern crate ed25519; diff --git a/substrate/network/Cargo.toml b/substrate/network/Cargo.toml index e2e901a0df..6591ebf919 100644 --- a/substrate/network/Cargo.toml +++ b/substrate/network/Cargo.toml @@ -13,7 +13,7 @@ ethcore-io = { git = "https://github.com/paritytech/parity.git" } substrate-primitives = { path = "../primitives" } polkadot-client = { path = "../client" } substrate-state-machine = { path = "../state-machine" } -polkadot-serializer = { path = "../serializer" } +substrate-serializer = { path = "../serializer" } log = "0.3" env_logger = "0.4" rand = "0.3" diff --git a/substrate/network/src/lib.rs b/substrate/network/src/lib.rs index 059ba93221..f1bd64d63f 100644 --- a/substrate/network/src/lib.rs +++ b/substrate/network/src/lib.rs @@ -30,7 +30,7 @@ extern crate ipnetwork; extern crate substrate_primitives as primitives; extern crate polkadot_client as client; extern crate substrate_state_machine as state_machine; -extern crate polkadot_serializer as ser; +extern crate substrate_serializer as ser; extern crate serde; extern crate serde_json; #[macro_use] extern crate serde_derive; diff --git a/substrate/primitives/Cargo.toml b/substrate/primitives/Cargo.toml index 4339977804..558989c76a 100644 --- a/substrate/primitives/Cargo.toml +++ b/substrate/primitives/Cargo.toml @@ -13,10 +13,10 @@ uint = { git = "https://github.com/rphmeier/primitives.git", branch = "compile-f twox-hash = { version = "1.1.0", optional = true } byteorder = { version = "1.1", default_features = false } blake2-rfc = { version = "0.2.18", optional = true } -substrate-codec = { path = "../codec", version = "0.1", default_features = false } +substrate-codec = { path = "../codec", default_features = false } [dev-dependencies] -polkadot-serializer = { path = "../serializer", version = "0.1" } +substrate-serializer = { path = "../serializer" } pretty_assertions = "0.4" [features] diff --git a/substrate/primitives/src/hash.rs b/substrate/primitives/src/hash.rs index 8e7c6f2b8f..788641ed04 100644 --- a/substrate/primitives/src/hash.rs +++ b/substrate/primitives/src/hash.rs @@ -57,7 +57,7 @@ impl_serde!(H512, 64); #[cfg(test)] mod tests { use super::*; - use polkadot_serializer as ser; + use substrate_serializer as ser; #[test] fn test_h160() { diff --git a/substrate/primitives/src/lib.rs b/substrate/primitives/src/lib.rs index ee95d7ca9a..bbeaa40036 100644 --- a/substrate/primitives/src/lib.rs +++ b/substrate/primitives/src/lib.rs @@ -45,7 +45,7 @@ extern crate uint as uint_crate; extern crate core; extern crate substrate_codec as codec; #[cfg(test)] -extern crate polkadot_serializer; +extern crate substrate_serializer; #[cfg(test)] #[macro_use] extern crate pretty_assertions; diff --git a/substrate/primitives/src/parachain.rs b/substrate/primitives/src/parachain.rs index f7dac2fec0..710b044162 100644 --- a/substrate/primitives/src/parachain.rs +++ b/substrate/primitives/src/parachain.rs @@ -136,7 +136,7 @@ impl ::codec::Slicable for Activity { #[cfg(test)] mod tests { use super::*; - use polkadot_serializer as ser; + use substrate_serializer as ser; #[test] fn test_candidate() { diff --git a/substrate/primitives/src/relay/block.rs b/substrate/primitives/src/relay/block.rs index e488d3c1f0..16810bf8a0 100644 --- a/substrate/primitives/src/relay/block.rs +++ b/substrate/primitives/src/relay/block.rs @@ -178,7 +178,7 @@ pub struct Body { mod tests { use super::*; use codec::Slicable; - use polkadot_serializer as ser; + use substrate_serializer as ser; #[test] fn test_header_serialization() { diff --git a/substrate/primitives/src/uint.rs b/substrate/primitives/src/uint.rs index cecf69dd2a..724779a269 100644 --- a/substrate/primitives/src/uint.rs +++ b/substrate/primitives/src/uint.rs @@ -47,7 +47,7 @@ impl_serde!(U512, 8); #[cfg(test)] mod tests { use super::*; - use polkadot_serializer as ser; + use substrate_serializer as ser; macro_rules! test { ($name: ident, $test_name: ident) => { diff --git a/substrate/primitives/src/validator.rs b/substrate/primitives/src/validator.rs index e6cba21e73..acf78f9f3c 100644 --- a/substrate/primitives/src/validator.rs +++ b/substrate/primitives/src/validator.rs @@ -53,7 +53,7 @@ pub struct ValidationResult { #[cfg(test)] mod tests { use super::*; - use polkadot_serializer as ser; + use substrate_serializer as ser; #[test] fn test_validation_result() { diff --git a/substrate/serializer/Cargo.toml b/substrate/serializer/Cargo.toml index 259f43016d..412586599e 100644 --- a/substrate/serializer/Cargo.toml +++ b/substrate/serializer/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "polkadot-serializer" +name = "substrate-serializer" version = "0.1.0" authors = ["Parity Technologies "] diff --git a/substrate/serializer/src/lib.rs b/substrate/serializer/src/lib.rs index 9660f95f71..9bdda4d019 100644 --- a/substrate/serializer/src/lib.rs +++ b/substrate/serializer/src/lib.rs @@ -1,20 +1,20 @@ // Copyright 2017 Parity Technologies (UK) Ltd. -// This file is part of Polkadot. +// This file is part of Substrate. -// Polkadot 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. -// Polkadot 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 Polkadot. If not, see . +// along with Substrate. If not, see . -//! Polkadot customizable serde serializer. +//! Substrate customizable serde serializer. //! //! The idea is that we can later change the implementation //! to something more compact, but for now we're using JSON. @@ -42,4 +42,3 @@ pub fn to_vec(value: &T) -> Vec { pub fn to_writer(writer: W, value: &T) -> Result<()> { serde_json::to_writer(writer, value) } - diff --git a/substrate/validator/Cargo.toml b/substrate/validator/Cargo.toml index ca69e1a98f..64bb00118a 100644 --- a/substrate/validator/Cargo.toml +++ b/substrate/validator/Cargo.toml @@ -5,6 +5,6 @@ authors = ["Parity Technologies "] [dependencies] error-chain = "0.11" -substrate-primitives = { path = "../primitives", version = "0.1" } -polkadot-serializer = { path = "../serializer", version = "0.1" } +substrate-primitives = { path = "../primitives" } +substrate-serializer = { path = "../serializer" } serde = "1.0" diff --git a/substrate/validator/src/lib.rs b/substrate/validator/src/lib.rs index 778db0155b..44192f9327 100644 --- a/substrate/validator/src/lib.rs +++ b/substrate/validator/src/lib.rs @@ -19,7 +19,7 @@ #[warn(missing_docs)] extern crate substrate_primitives as primitives; -extern crate polkadot_serializer as serializer; +extern crate substrate_serializer as serializer; extern crate serde; #[macro_use] diff --git a/substrate/wasm-runtime/Cargo.lock b/substrate/wasm-runtime/Cargo.lock index a5ce44c433..96a286f124 100644 --- a/substrate/wasm-runtime/Cargo.lock +++ b/substrate/wasm-runtime/Cargo.lock @@ -381,25 +381,12 @@ version = "0.1.0" dependencies = [ "ed25519 0.1.0", "environmental 0.1.0", - "substrate-state-machine 0.1.0", "pwasm-alloc 0.1.0", "pwasm-libc 0.1.0", "rustc_version 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "substrate-codec 0.1.0", "substrate-primitives 0.1.0", - "triehash 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "substrate-state-machine" -version = "0.1.0" -dependencies = [ - "byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "hashdb 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "hex-literal 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "memorydb 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "patricia-trie 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-primitives 0.1.0", + "substrate-state-machine 0.1.0", "triehash 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -633,6 +620,19 @@ dependencies = [ "uint 0.1.2 (git+https://github.com/rphmeier/primitives.git?branch=compile-for-wasm)", ] +[[package]] +name = "substrate-state-machine" +version = "0.1.0" +dependencies = [ + "byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "hashdb 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "hex-literal 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "memorydb 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "patricia-trie 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "substrate-primitives 0.1.0", + "triehash 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "syn" version = "0.11.11" diff --git a/substrate/wasm-runtime/target/wasm32-unknown-unknown/release/runtime_polkadot.compact.wasm b/substrate/wasm-runtime/target/wasm32-unknown-unknown/release/runtime_polkadot.compact.wasm index d35a213f5219817ceb8ed799f29c5b1626bc8dff..8772bd974e05f427cdeea76cb9c54504ca9f8dfc 100644 GIT binary patch delta 3887 zcmZ`+4{V#&5r6O5j_o`<`P%%c8z=FL6E}8jrxZ${rgZuGH?&C`F|{tXJ>e@cQ=yF(cwr>JQRz^&{}gjMlz!2ZokL3 z!rgMi9ek8Lj8}84>%d!-dra$yGGmg1o=w2_VWqr-umov#l-VB-6rweeWFkxtG6k->rgtb>HLUsFxq?xmA#C&q{L0 zt9;S(3_YY z(12_jaN0o^l-eI$g|SQ7ze@*%Kia<(Z&oJy877nU{OrI7`pJ6P$Ui*1StmpIpX^TP zQ!T1s1Ai&JMemZ~q~C<=@Md1Sr$%D~dzi}Fl-QmNa7>4?a%edgrw{$$W1UB}?&9P7 zjGV>w{CHHVIPH}Utcq1j7Pi=Gw3w*0iBCoE(r3NbDL)kJ)?fT@;dcG>HG!T_$II|0 z{y}{Ee4Jt@Js%ym>pR!t0~|+Pygj^(e?ELqrEo8GIvw3s#2oU~8o}}V_h#{WUbk=5 zR?J+zn`E%Fh5?<#BCq>CCy=X?`)#;Wd2Rn!xI}~iz;6!Jn4keJANm4}GcL6xnlUOG z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}MFEVu~XX*l=2vFxD^jHp!y43Ol48NBy zRVl!X&AF&;2((>`v`^%;Q!e!f1=v?P>829X`yC-c(@syjX$P;m(lG{u9u&ktfOw+A zP!T4ekOvQ40#(^F7!EEE2O}e)VZA1&Je0ICq&(}Prna8J-XKyAc_744Y6B5qj$|09 zWuzR>FrxurPI#zo3tS^QdaL>=ad*6%3k{<9IDYTh&RzX^>6{MrjfyLIti&J^>{I6WTKfD NeQ6`HW-$qz{{`b9n+E^@ From 26b4b56402d2a1d56953419dea92d60bc15699b2 Mon Sep 17 00:00:00 2001 From: Gav Date: Wed, 7 Feb 2018 13:02:57 +0100 Subject: [PATCH 09/15] Remove CallData/OutData. --- substrate/Cargo.lock | 19 ++++++ substrate/Cargo.toml | 1 + substrate/client/src/genesis.rs | 7 +-- substrate/client/src/lib.rs | 4 +- substrate/executor/src/native_executor.rs | 27 ++++----- substrate/executor/src/wasm_executor.rs | 35 ++++++----- substrate/polkadot-primitives/Cargo.toml | 35 +++++++++++ substrate/polkadot-primitives/src/lib.rs | 56 ++++++++++++++++++ substrate/primitives/src/contract.rs | 10 ---- substrate/rpc/src/state/mod.rs | 6 +- substrate/rpc/src/state/tests.rs | 2 +- substrate/runtime-std/src/lib.rs | 46 -------------- substrate/state-machine/src/lib.rs | 6 +- substrate/wasm-runtime/polkadot/src/lib.rs | 44 ++++++++++++++ .../polkadot/src/runtime/system.rs | 2 +- .../release/runtime_polkadot.compact.wasm | Bin 69581 -> 69574 bytes .../release/runtime_polkadot.wasm | Bin 69660 -> 69653 bytes .../release/runtime_test.compact.wasm | Bin 14104 -> 14104 bytes .../release/runtime_test.wasm | Bin 14229 -> 14229 bytes 19 files changed, 197 insertions(+), 103 deletions(-) create mode 100644 substrate/polkadot-primitives/Cargo.toml create mode 100644 substrate/polkadot-primitives/src/lib.rs diff --git a/substrate/Cargo.lock b/substrate/Cargo.lock index 41c2d747f5..595ca2ff32 100644 --- a/substrate/Cargo.lock +++ b/substrate/Cargo.lock @@ -1044,6 +1044,25 @@ dependencies = [ "substrate-state-machine 0.1.0", ] +[[package]] +name = "polkadot-primitives" +version = "0.1.0" +dependencies = [ + "blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "fixed-hash 0.1.3 (git+https://github.com/rphmeier/primitives.git?branch=compile-for-wasm)", + "pretty_assertions 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-hex 2.0.0 (git+https://github.com/rphmeier/rustc-hex.git)", + "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", + "substrate-codec 0.1.0", + "substrate-primitives 0.1.0", + "substrate-serializer 0.1.0", + "twox-hash 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "uint 0.1.2 (git+https://github.com/rphmeier/primitives.git?branch=compile-for-wasm)", +] + [[package]] name = "polkadot-rpc" version = "0.1.0" diff --git a/substrate/Cargo.toml b/substrate/Cargo.toml index 04b654bfce..ce8281310a 100644 --- a/substrate/Cargo.toml +++ b/substrate/Cargo.toml @@ -21,6 +21,7 @@ members = [ "rpc-servers", "rpc", "codec", + "polkadot-primitives", "runtime-std", "serializer", "state-machine", diff --git a/substrate/client/src/genesis.rs b/substrate/client/src/genesis.rs index 1e2020b9a7..6815f6b2b5 100644 --- a/substrate/client/src/genesis.rs +++ b/substrate/client/src/genesis.rs @@ -48,7 +48,6 @@ mod tests { use substrate_executor::executor; use primitives::relay::{AccountId, Hash, BlockNumber, Header, Digest, UncheckedTransaction, Transaction, Function}; - use primitives::contract::CallData; use ed25519::Pair; fn secret_for(who: &AccountId) -> Option { @@ -88,7 +87,7 @@ mod tests { &mut overlay, &executor(), "execute_transaction", - &CallData(vec![].join(&header).join(tx)) + &vec![].join(&header).join(tx) ).unwrap(); header = Header::from_slice(&mut &ret_data[..]).unwrap(); } @@ -98,7 +97,7 @@ mod tests { &mut overlay, &executor(), "finalise_block", - &CallData(vec![].join(&header)) + &vec![].join(&header) ).unwrap(); header = Header::from_slice(&mut &ret_data[..]).unwrap(); @@ -137,7 +136,7 @@ mod tests { &mut overlay, &executor(), "execute_block", - &CallData(b1data) + &b1data ).unwrap(); } } diff --git a/substrate/client/src/lib.rs b/substrate/client/src/lib.rs index 44c2aaa2bf..edf4d22c3e 100644 --- a/substrate/client/src/lib.rs +++ b/substrate/client/src/lib.rs @@ -48,7 +48,7 @@ pub use blockchain::Info as ChainInfo; pub use blockchain::BlockId; use primitives::relay::block; -use primitives::contract::{CallData, StorageKey, StorageData}; +use primitives::contract::{StorageKey, StorageData}; use blockchain::Backend as BlockchainBackend; use backend::BlockImportOperation; @@ -156,7 +156,7 @@ impl Client where /// Execute a call to a contract on top of state in a block of given hash. /// /// No changes are made. - pub fn call(&self, hash: &block::HeaderHash, method: &str, call_data: &CallData) -> error::Result { + pub fn call(&self, hash: &block::HeaderHash, method: &str, call_data: &[u8]) -> error::Result { let state = self.state_at(hash)?; let mut changes = state_machine::OverlayedChanges::default(); diff --git a/substrate/executor/src/native_executor.rs b/substrate/executor/src/native_executor.rs index d52b0daed1..64aa7b4986 100644 --- a/substrate/executor/src/native_executor.rs +++ b/substrate/executor/src/native_executor.rs @@ -16,7 +16,6 @@ use error::{Error, ErrorKind, Result}; use native_runtime as runtime; -use primitives::contract::CallData; use runtime_std; use state_machine::{Externalities, CodeExecutor}; use wasm_executor::WasmExecutor; @@ -37,16 +36,16 @@ impl CodeExecutor for NativeExecutor { ext: &mut E, code: &[u8], method: &str, - data: &CallData, + data: &[u8], ) -> Result> { // 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. let native_equivalent = include_bytes!("../../wasm-runtime/target/wasm32-unknown-unknown/release/runtime_polkadot.compact.wasm"); if code == &native_equivalent[..] { runtime_std::with_externalities(ext, || match method { - "execute_block" => safe_call(|| runtime::execute_block(&data.0)), - "execute_transaction" => safe_call(|| runtime::execute_transaction(&data.0)), - "finalise_block" => safe_call(|| runtime::finalise_block(&data.0)), + "execute_block" => safe_call(|| runtime::execute_block(data)), + "execute_transaction" => safe_call(|| runtime::execute_transaction(data)), + "finalise_block" => safe_call(|| runtime::finalise_block(data)), _ => Err(ErrorKind::MethodNotFound(method.to_owned()).into()), }) } else { @@ -90,7 +89,7 @@ mod tests { twox_128(&one.to_keyed_vec(b"sta:bal:")).to_vec() => vec![68u8, 0, 0, 0, 0, 0, 0, 0] ], }; - let r = NativeExecutor.call(&mut t, BLOATY_CODE, "execute_transaction", &CallData(vec![].join(&Header::from_block_number(1u64)).join(&tx()))); + let r = NativeExecutor.call(&mut t, BLOATY_CODE, "execute_transaction", &vec![].join(&Header::from_block_number(1u64)).join(&tx())); assert!(r.is_err()); } @@ -101,7 +100,7 @@ mod tests { twox_128(&one.to_keyed_vec(b"sta:bal:")).to_vec() => vec![68u8, 0, 0, 0, 0, 0, 0, 0] ], }; - let r = NativeExecutor.call(&mut t, COMPACT_CODE, "execute_transaction", &CallData(vec![].join(&Header::from_block_number(1u64)).join(&tx()))); + let r = NativeExecutor.call(&mut t, COMPACT_CODE, "execute_transaction", &vec![].join(&Header::from_block_number(1u64)).join(&tx())); assert!(r.is_err()); } @@ -114,7 +113,7 @@ mod tests { twox_128(&one.to_keyed_vec(b"sta:bal:")).to_vec() => vec![111u8, 0, 0, 0, 0, 0, 0, 0] ], }; - let r = NativeExecutor.call(&mut t, COMPACT_CODE, "execute_transaction", &CallData(vec![].join(&Header::from_block_number(1u64)).join(&tx()))); + let r = NativeExecutor.call(&mut t, COMPACT_CODE, "execute_transaction", &vec![].join(&Header::from_block_number(1u64)).join(&tx())); assert!(r.is_ok()); runtime_std::with_externalities(&mut t, || { @@ -132,7 +131,7 @@ mod tests { twox_128(&one.to_keyed_vec(b"sta:bal:")).to_vec() => vec![111u8, 0, 0, 0, 0, 0, 0, 0] ], }; - let r = NativeExecutor.call(&mut t, BLOATY_CODE, "execute_transaction", &CallData(vec![].join(&Header::from_block_number(1u64)).join(&tx()))); + let r = NativeExecutor.call(&mut t, BLOATY_CODE, "execute_transaction", &vec![].join(&Header::from_block_number(1u64)).join(&tx())); assert!(r.is_ok()); runtime_std::with_externalities(&mut t, || { @@ -234,7 +233,7 @@ mod tests { fn test_execution_works() { let mut t = new_test_ext(); println!("Testing Wasm..."); - let r = WasmExecutor.call(&mut t, COMPACT_CODE, "run_tests", &CallData(block2().0)); + let r = WasmExecutor.call(&mut t, COMPACT_CODE, "run_tests", &block2().0); assert!(r.is_ok()); } @@ -242,14 +241,14 @@ mod tests { fn full_native_block_import_works() { let mut t = new_test_ext(); - NativeExecutor.call(&mut t, COMPACT_CODE, "execute_block", &CallData(block1().0)).unwrap(); + NativeExecutor.call(&mut t, COMPACT_CODE, "execute_block", &block1().0).unwrap(); runtime_std::with_externalities(&mut t, || { assert_eq!(balance(&one()), 42); assert_eq!(balance(&two()), 69); }); - NativeExecutor.call(&mut t, COMPACT_CODE, "execute_block", &CallData(block2().0)).unwrap(); + NativeExecutor.call(&mut t, COMPACT_CODE, "execute_block", &block2().0).unwrap(); runtime_std::with_externalities(&mut t, || { assert_eq!(balance(&one()), 32); @@ -261,14 +260,14 @@ mod tests { fn full_wasm_block_import_works() { let mut t = new_test_ext(); - WasmExecutor.call(&mut t, COMPACT_CODE, "execute_block", &CallData(block1().0)).unwrap(); + WasmExecutor.call(&mut t, COMPACT_CODE, "execute_block", &block1().0).unwrap(); runtime_std::with_externalities(&mut t, || { assert_eq!(balance(&one()), 42); assert_eq!(balance(&two()), 69); }); - WasmExecutor.call(&mut t, COMPACT_CODE, "execute_block", &CallData(block2().0)).unwrap(); + WasmExecutor.call(&mut t, COMPACT_CODE, "execute_block", &block2().0).unwrap(); runtime_std::with_externalities(&mut t, || { assert_eq!(balance(&one()), 32); diff --git a/substrate/executor/src/wasm_executor.rs b/substrate/executor/src/wasm_executor.rs index 00eb9e67d7..b8a3367f03 100644 --- a/substrate/executor/src/wasm_executor.rs +++ b/substrate/executor/src/wasm_executor.rs @@ -22,7 +22,6 @@ use std::collections::HashMap; use parity_wasm::{deserialize_buffer, ModuleInstanceInterface, ProgramInstance}; use parity_wasm::interpreter::{ItemIndex, DummyUserError}; use parity_wasm::RuntimeValue::{I32, I64}; -use primitives::contract::CallData; use state_machine::{Externalities, CodeExecutor}; use error::{Error, ErrorKind, Result}; use wasm_utils::{MemoryInstance, UserDefinedElements, @@ -250,7 +249,7 @@ impl CodeExecutor for WasmExecutor { ext: &mut E, code: &[u8], method: &str, - data: &CallData, + data: &[u8], ) -> Result> { // TODO: handle all expects as errors to be returned. @@ -262,9 +261,9 @@ impl CodeExecutor for WasmExecutor { let memory = module.memory(ItemIndex::Internal(0)).expect("all modules compiled with rustc include memory segments; qed"); let mut fec = FunctionExecutor::new(&memory, ext); - let size = data.0.len() as u32; + let size = data.len() as u32; let offset = fec.heap.allocate(size); - memory.set(offset, &data.0).expect("heap always gives a sensible offset to write"); + memory.set(offset, &data).expect("heap always gives a sensible offset to write"); let returned = program .params_with_external("env", &mut fec) @@ -323,7 +322,7 @@ mod tests { let mut ext = TestExternalities::default(); let test_code = include_bytes!("../../wasm-runtime/target/wasm32-unknown-unknown/release/runtime_test.compact.wasm"); - let output = WasmExecutor.call(&mut ext, &test_code[..], "test_empty_return", &CallData(vec![])).unwrap(); + let output = WasmExecutor.call(&mut ext, &test_code[..], "test_empty_return", &[]).unwrap(); assert_eq!(output, vec![0u8; 0]); } @@ -332,10 +331,10 @@ mod tests { let mut ext = TestExternalities::default(); let test_code = include_bytes!("../../wasm-runtime/target/wasm32-unknown-unknown/release/runtime_test.compact.wasm"); - let output = WasmExecutor.call(&mut ext, &test_code[..], "test_panic", &CallData(vec![])); + let output = WasmExecutor.call(&mut ext, &test_code[..], "test_panic", &[]); assert!(output.is_err()); - let output = WasmExecutor.call(&mut ext, &test_code[..], "test_conditional_panic", &CallData(vec![2])); + let output = WasmExecutor.call(&mut ext, &test_code[..], "test_conditional_panic", &[2]); assert!(output.is_err()); } @@ -345,7 +344,7 @@ mod tests { ext.set_storage(b"foo".to_vec(), b"bar".to_vec()); let test_code = include_bytes!("../../wasm-runtime/target/wasm32-unknown-unknown/release/runtime_test.compact.wasm"); - let output = WasmExecutor.call(&mut ext, &test_code[..], "test_data_in", &CallData(b"Hello world".to_vec())).unwrap(); + let output = WasmExecutor.call(&mut ext, &test_code[..], "test_data_in", b"Hello world").unwrap(); assert_eq!(output, b"all ok!".to_vec()); @@ -362,11 +361,11 @@ mod tests { let mut ext = TestExternalities::default(); let test_code = include_bytes!("../../wasm-runtime/target/wasm32-unknown-unknown/release/runtime_test.compact.wasm"); assert_eq!( - WasmExecutor.call(&mut ext, &test_code[..], "test_blake2_256", &CallData(b"".to_vec())).unwrap(), + WasmExecutor.call(&mut ext, &test_code[..], "test_blake2_256", &[]).unwrap(), blake2_256(&b""[..]).to_vec() ); assert_eq!( - WasmExecutor.call(&mut ext, &test_code[..], "test_blake2_256", &CallData(b"Hello world!".to_vec())).unwrap(), + WasmExecutor.call(&mut ext, &test_code[..], "test_blake2_256", b"Hello world!").unwrap(), blake2_256(&b"Hello world!"[..]).to_vec() ); } @@ -376,11 +375,11 @@ mod tests { let mut ext = TestExternalities::default(); let test_code = include_bytes!("../../wasm-runtime/target/wasm32-unknown-unknown/release/runtime_test.compact.wasm"); assert_eq!( - WasmExecutor.call(&mut ext, &test_code[..], "test_twox_256", &CallData(b"".to_vec())).unwrap(), + WasmExecutor.call(&mut ext, &test_code[..], "test_twox_256", &[]).unwrap(), FromHex::from_hex("99e9d85137db46ef4bbea33613baafd56f963c64b1f3685a4eb4abd67ff6203a").unwrap() ); assert_eq!( - WasmExecutor.call(&mut ext, &test_code[..], "test_twox_256", &CallData(b"Hello world!".to_vec())).unwrap(), + WasmExecutor.call(&mut ext, &test_code[..], "test_twox_256", b"Hello world!").unwrap(), FromHex::from_hex("b27dfd7f223f177f2a13647b533599af0c07f68bda23d96d059da2b451a35a74").unwrap() ); } @@ -390,11 +389,11 @@ mod tests { let mut ext = TestExternalities::default(); let test_code = include_bytes!("../../wasm-runtime/target/wasm32-unknown-unknown/release/runtime_test.compact.wasm"); assert_eq!( - WasmExecutor.call(&mut ext, &test_code[..], "test_twox_128", &CallData(b"".to_vec())).unwrap(), + WasmExecutor.call(&mut ext, &test_code[..], "test_twox_128", &[]).unwrap(), FromHex::from_hex("99e9d85137db46ef4bbea33613baafd5").unwrap() ); assert_eq!( - WasmExecutor.call(&mut ext, &test_code[..], "test_twox_128", &CallData(b"Hello world!".to_vec())).unwrap(), + WasmExecutor.call(&mut ext, &test_code[..], "test_twox_128", b"Hello world!").unwrap(), FromHex::from_hex("b27dfd7f223f177f2a13647b533599af").unwrap() ); } @@ -409,7 +408,7 @@ mod tests { calldata.extend_from_slice(key.public().as_ref()); calldata.extend_from_slice(sig.as_ref()); assert_eq!( - WasmExecutor.call(&mut ext, &test_code[..], "test_ed25519_verify", &CallData(calldata)).unwrap(), + WasmExecutor.call(&mut ext, &test_code[..], "test_ed25519_verify", &calldata).unwrap(), vec![0] ); } @@ -419,7 +418,7 @@ mod tests { let mut ext = TestExternalities::default(); let test_code = include_bytes!("../../wasm-runtime/target/wasm32-unknown-unknown/release/runtime_test.compact.wasm"); assert_eq!( - WasmExecutor.call(&mut ext, &test_code[..], "test_enumerated_trie_root", &CallData(vec![])).unwrap(), + WasmExecutor.call(&mut ext, &test_code[..], "test_enumerated_trie_root", &[]).unwrap(), ordered_trie_root(vec![b"zero".to_vec(), b"one".to_vec(), b"two".to_vec()]).0.to_vec() ); } @@ -432,7 +431,7 @@ mod tests { ], }; let foreign_code = include_bytes!("../../wasm-runtime/target/wasm32-unknown-unknown/release/runtime_polkadot.wasm"); - let r = WasmExecutor.call(&mut t, &foreign_code[..], "execute_transaction", &CallData(vec![].join(&Header::from_block_number(1u64)).join(&tx()))); + let r = WasmExecutor.call(&mut t, &foreign_code[..], "execute_transaction", &vec![].join(&Header::from_block_number(1u64)).join(&tx())); assert!(r.is_err()); } @@ -446,7 +445,7 @@ mod tests { ], }; let foreign_code = include_bytes!("../../wasm-runtime/target/wasm32-unknown-unknown/release/runtime_polkadot.compact.wasm"); - let r = WasmExecutor.call(&mut t, &foreign_code[..], "execute_transaction", &CallData(vec![].join(&Header::from_block_number(1u64)).join(&tx()))); + let r = WasmExecutor.call(&mut t, &foreign_code[..], "execute_transaction", &vec![].join(&Header::from_block_number(1u64)).join(&tx())); assert!(r.is_ok()); runtime_std::with_externalities(&mut t, || { diff --git a/substrate/polkadot-primitives/Cargo.toml b/substrate/polkadot-primitives/Cargo.toml new file mode 100644 index 0000000000..c81bd3a1a6 --- /dev/null +++ b/substrate/polkadot-primitives/Cargo.toml @@ -0,0 +1,35 @@ +[package] +name = "polkadot-primitives" +version = "0.1.0" +authors = ["Parity Technologies "] + +[dependencies] +crunchy = "0.1" +fixed-hash = { git = "https://github.com/rphmeier/primitives.git", branch = "compile-for-wasm", default_features = false } +rustc-hex = { git = "https://github.com/rphmeier/rustc-hex.git", version = "2.0", default_features = false } +serde = { version = "1.0", default_features = false } +serde_derive = { version = "1.0", optional = true } +uint = { git = "https://github.com/rphmeier/primitives.git", branch = "compile-for-wasm" } +twox-hash = { version = "1.1.0", optional = true } +byteorder = { version = "1.1", default_features = false } +blake2-rfc = { version = "0.2.18", optional = true } +substrate-codec = { path = "../codec", default_features = false } +substrate-primitives = { path = "../primitives", default_features = false } + +[dev-dependencies] +substrate-serializer = { path = "../serializer" } +pretty_assertions = "0.4" + +[features] +default = ["std"] +std = [ + "uint/std", + "fixed-hash/std", + "substrate-codec/std", + "serde/std", + "rustc-hex/std", + "twox-hash", + "blake2-rfc", + "serde_derive", + "byteorder/std" +] diff --git a/substrate/polkadot-primitives/src/lib.rs b/substrate/polkadot-primitives/src/lib.rs new file mode 100644 index 0000000000..196ef89fd3 --- /dev/null +++ b/substrate/polkadot-primitives/src/lib.rs @@ -0,0 +1,56 @@ +// Copyright 2017 Parity Technologies (UK) Ltd. +// This file is part of Polkadot. + +// Polkadot 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. + +// Polkadot 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 Polkadot. If not, see . + +//! Shareable Polkadot types. + +#![warn(missing_docs)] + +#![cfg_attr(not(feature = "std"), no_std)] +#![cfg_attr(not(feature = "std"), feature(alloc))] + +extern crate rustc_hex; + +extern crate serde; +extern crate byteorder; + +#[cfg(feature = "std")] +extern crate twox_hash; +#[cfg(feature = "std")] +extern crate blake2_rfc; + +#[macro_use] +extern crate crunchy; +#[macro_use] +extern crate fixed_hash; +#[cfg(feature = "std")] +#[macro_use] +extern crate serde_derive; +#[macro_use] +extern crate uint as uint_crate; + +#[cfg(feature = "std")] +extern crate core; +extern crate substrate_codec as codec; +extern crate substrate_primitives as primitives; +#[cfg(test)] +extern crate substrate_serializer; +#[cfg(test)] +#[macro_use] +extern crate pretty_assertions; + +#[cfg(not(feature = "std"))] +#[macro_use] +extern crate alloc; diff --git a/substrate/primitives/src/contract.rs b/substrate/primitives/src/contract.rs index 771381b85b..e8e22fc3f7 100644 --- a/substrate/primitives/src/contract.rs +++ b/substrate/primitives/src/contract.rs @@ -20,16 +20,6 @@ use bytes; use bytes::Vec; -/// Contract call data. -#[derive(Debug, PartialEq, Eq)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] -pub struct CallData(#[cfg_attr(feature = "std", serde(with="bytes"))] pub Vec); - -/// Contract output data. -#[derive(Debug, PartialEq, Eq)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] -pub struct OutData(#[cfg_attr(feature = "std", serde(with="bytes"))] pub Vec); - /// Contract storage key. #[derive(Debug, PartialEq, Eq)] #[cfg_attr(feature = "std", derive(Serialize, Deserialize))] diff --git a/substrate/rpc/src/state/mod.rs b/substrate/rpc/src/state/mod.rs index 07b78a97c8..dd5ba7d7cb 100644 --- a/substrate/rpc/src/state/mod.rs +++ b/substrate/rpc/src/state/mod.rs @@ -23,7 +23,7 @@ mod tests; use client::{self, Client}; use primitives::relay::block; -use primitives::contract::{CallData, StorageKey, StorageData}; +use primitives::contract::{StorageKey, StorageData}; use state_machine; use self::error::Result; @@ -37,7 +37,7 @@ build_rpc_trait! { /// Call a contract. #[rpc(name = "state_call")] - fn call(&self, String, CallData, block::HeaderHash) -> Result>; + fn call(&self, String, Vec, block::HeaderHash) -> Result>; } } @@ -50,7 +50,7 @@ impl StateApi for Client where Ok(self.storage(&block, &key)?) } - fn call(&self, method: String, data: CallData, block: block::HeaderHash) -> Result> { + fn call(&self, method: String, data: Vec, block: block::HeaderHash) -> Result> { Ok(self.call(&block, &method, &data)?.return_data) } } diff --git a/substrate/rpc/src/state/tests.rs b/substrate/rpc/src/state/tests.rs index 2360ce9e45..8bc0d6ec5f 100644 --- a/substrate/rpc/src/state/tests.rs +++ b/substrate/rpc/src/state/tests.rs @@ -39,7 +39,7 @@ fn should_call_contract() { let genesis_hash = "af65e54217fb213853703d57b80fc5b2bb834bf923046294d7a49bff62f0a8b2".into(); assert_matches!( - StateApi::call(&client, "balanceOf".into(), CallData(vec![1,2,3]), genesis_hash), + StateApi::call(&client, "balanceOf".into(), vec![1,2,3], genesis_hash), Err(Error(ErrorKind::Client(client::error::ErrorKind::Execution(_)), _)) ) } diff --git a/substrate/runtime-std/src/lib.rs b/substrate/runtime-std/src/lib.rs index 0c080a743b..357fa7313b 100644 --- a/substrate/runtime-std/src/lib.rs +++ b/substrate/runtime-std/src/lib.rs @@ -24,8 +24,6 @@ #![cfg_attr(feature = "std", doc = "Polkadot runtime standard library as compiled when linked with Rust's standard library.")] #![cfg_attr(not(feature = "std"), doc = "Polkadot's runtime standard library as compiled without Rust's standard library.")] -extern crate substrate_codec as codec; - #[cfg(feature = "std")] include!("../with_std.rs"); @@ -39,47 +37,3 @@ pub mod prelude { pub use ::vec::Vec; pub use ::boxed::Box; } - -/// Type definitions and helpers for transactions. -pub mod transaction { - pub use primitives::relay::{Transaction, UncheckedTransaction}; - use primitives::relay::Signature; - - #[cfg(feature = "std")] - use std::ops; - - #[cfg(not(feature = "std"))] - use core::ops; - - /// A type-safe indicator that a transaction has been checked. - #[derive(PartialEq, Eq, Clone)] - #[cfg_attr(feature = "std", derive(Debug))] - pub struct CheckedTransaction(UncheckedTransaction); - - impl CheckedTransaction { - /// Get a reference to the checked signature. - pub fn signature(&self) -> &Signature { - &self.0.signature - } - } - - impl ops::Deref for CheckedTransaction { - type Target = Transaction; - - fn deref(&self) -> &Transaction { - &self.0.transaction - } - } - - /// Check the signature on a transaction. - /// - /// On failure, return the transaction back. - pub fn check(tx: UncheckedTransaction) -> Result { - let msg = ::codec::Slicable::to_vec(&tx.transaction); - if ::ed25519_verify(&tx.signature.0, &msg, &tx.transaction.signed) { - Ok(CheckedTransaction(tx)) - } else { - Err(tx) - } - } -} diff --git a/substrate/state-machine/src/lib.rs b/substrate/state-machine/src/lib.rs index 8a7af31a05..db1f0ef533 100644 --- a/substrate/state-machine/src/lib.rs +++ b/substrate/state-machine/src/lib.rs @@ -34,8 +34,6 @@ extern crate byteorder; use std::collections::HashMap; use std::fmt; -use primitives::contract::CallData; - pub mod backend; mod ext; mod testing; @@ -177,7 +175,7 @@ pub trait CodeExecutor: Sized + Send + Sync { ext: &mut E, code: &[u8], method: &str, - data: &CallData, + data: &[u8], ) -> Result, Self::Error>; } @@ -192,7 +190,7 @@ pub fn execute( overlay: &mut OverlayedChanges, exec: &Exec, method: &str, - call_data: &CallData, + call_data: &[u8], ) -> Result, Box> { let result = { diff --git a/substrate/wasm-runtime/polkadot/src/lib.rs b/substrate/wasm-runtime/polkadot/src/lib.rs index 81b0e0c032..656a8a7b2f 100644 --- a/substrate/wasm-runtime/polkadot/src/lib.rs +++ b/substrate/wasm-runtime/polkadot/src/lib.rs @@ -42,6 +42,50 @@ use runtime_std::prelude::*; use codec::Slicable; use primitives::relay::{Header, Block, UncheckedTransaction}; +/// Type definitions and helpers for transactions. +pub mod transaction { + pub use primitives::relay::{Transaction, UncheckedTransaction}; + use primitives::relay::Signature; + + #[cfg(feature = "std")] + use std::ops; + + #[cfg(not(feature = "std"))] + use core::ops; + + /// A type-safe indicator that a transaction has been checked. + #[derive(PartialEq, Eq, Clone)] + #[cfg_attr(feature = "std", derive(Debug))] + pub struct CheckedTransaction(UncheckedTransaction); + + impl CheckedTransaction { + /// Get a reference to the checked signature. + pub fn signature(&self) -> &Signature { + &self.0.signature + } + } + + impl ops::Deref for CheckedTransaction { + type Target = Transaction; + + fn deref(&self) -> &Transaction { + &self.0.transaction + } + } + + /// Check the signature on a transaction. + /// + /// On failure, return the transaction back. + pub fn check(tx: UncheckedTransaction) -> Result { + let msg = ::codec::Slicable::to_vec(&tx.transaction); + if ::runtime_std::ed25519_verify(&tx.signature.0, &msg, &tx.transaction.signed) { + Ok(CheckedTransaction(tx)) + } else { + Err(tx) + } + } +} + /// Execute a block, with `input` being the canonical serialisation of the block. Returns the /// empty vector. pub fn execute_block(mut input: &[u8]) -> Vec { diff --git a/substrate/wasm-runtime/polkadot/src/runtime/system.rs b/substrate/wasm-runtime/polkadot/src/runtime/system.rs index 9f8edbb92e..5f40feccf5 100644 --- a/substrate/wasm-runtime/polkadot/src/runtime/system.rs +++ b/substrate/wasm-runtime/polkadot/src/runtime/system.rs @@ -145,7 +145,7 @@ pub mod internal { } fn execute_transaction(utx: UncheckedTransaction) { - use runtime_std::transaction; + use ::transaction; // Verify the signature is good. let tx = match transaction::check(utx) { diff --git a/substrate/wasm-runtime/target/wasm32-unknown-unknown/release/runtime_polkadot.compact.wasm b/substrate/wasm-runtime/target/wasm32-unknown-unknown/release/runtime_polkadot.compact.wasm index 8772bd974e05f427cdeea76cb9c54504ca9f8dfc..ce296a5814d474f42ad7dd50b99647b9088f7a7f 100644 GIT bin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ndD{|G-LdM7im{|#&den?eyin=)e^2-Wm zV4Koc7_Eb+fLFv&HNyjJF8u~wjuE0GSd`lKUMwosH<*YtyYU%5R3Ew3O;};H{>!S_ KSmYr$srY}Y<=JWg diff --git a/substrate/wasm-runtime/target/wasm32-unknown-unknown/release/runtime_polkadot.wasm b/substrate/wasm-runtime/target/wasm32-unknown-unknown/release/runtime_polkadot.wasm index 07e49ec59d94f646bcb4f5b524e29490a96fe876..a6831997d4080456b4afa7bd7478586393e926bc 100644 GIT binary patch delta 8706 zcmbVS3w%`7nZM`Go#&k-H_0TK$%CA^c}+4&2nrD*m0ThaUJ|Lcs}v!G0TS{u2@ju) zEnR6<9DB5b+ghg;wp3Av4%Kv}m}+EWt8Em1YaeV)-E_q*TT-Ph6(9Ydb7ztu_1FDv z@Sg9U?{&WOo$q|-J9qqMOnE4#L{?ZNa_0lfeTTQ)L>8)6tKxJztyUSWQ+6tDMV9bq zw-Q1mLYxXApjn;HG^fid%Pwa+{@fWZBB!SlDuT-n>}it%%BH?hNUCI=@(Sf zMr{de{m}uXSyEqQu46hWWi`hNiH|Kib{Opk$7Yd2R{OjU@6FGbfZF+d^Xk%knqfFP z(2Q9+jD18a&0k3T9xA61x2&3Iv@wz-;(bKEh#eRq544bHwxKJR3$@T_vYUEMHE1VC z!uz05_6yRXOU5A4N@zwv9+Y(lheNV1Ybz4>4h4uZQmvIF27jDS$Phd6!WZUzpc}9F z4Tq+4#xaX-;qbIYTk4nPM*co-S(GMGi)P`I*k|pavbKtCd~x6ZPckuUcma&CX;-kD zew@eddFkqP!+z7+Jyu=j14gWRy0%=`sOP#gS8_~qt|`uaR@2OwRVUhVev@0alm@q+15xw&!7`BSuXqf=BsfF6KIc&)*|CxUA_=(G2oll6L_53W4 z;zv_P=i)dS0msI5kl4Ey3V zLLCO_@H@Z}!6aSA`N=?a83z@P0p5&1#D$Z(0`eKM1d-t~PLmGJ%R1c^flmx9b^*0h zC*(R)gL5Q%&b=S|W_{XBw2`y{b=0oShD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CqUa<~#Zsi^%>8I-r zcj~!s5bl(!$Mu5g+~D8B&xqE^EbQ~ZHsXh!G$`s~&(()CoP}+fKDu}VJOsQvW@!{*N#H+g*~NOMbU;ALPCWME*p0HlS1 z^eH9=22LQ&;J87WTQE7XATc?!q*5WjEVU>tC%>G*@q#qBa871YVopwevVKuwd3;%F IvR+X!0E~k+UH||9 delta 166 zcmbP{HzRMuY8J)^lh?4c0!bs*e#Qrz53y=70jam_tHn7MNDD|Xa67h4ULdauRB%lG zH;_D}5CxQ%Rb0jh|k_dCewBb4zUCWnd6wU|_faq=kX> pDJBL6P9V+TxIvm*FgdXxF*&oOQX#)AwJ0qoznsDG!sL2$F#x6rEf4?z delta 148 zcmbQ5KQ(`Y1}o!($(pRKKyp26KjVYV_H0^AKq`x4wK&HDX#qI~ZpW6%vI?p|1)l From 9fe85fc9f4192005b8565208beb5cde4dc0420a0 Mon Sep 17 00:00:00 2001 From: Gav Date: Wed, 7 Feb 2018 15:24:54 +0100 Subject: [PATCH 10/15] Split out substrate-primitives from polkadot-primitives. Bottom half minus tests builds. --- substrate/Cargo.lock | 56 +++-- substrate/Cargo.toml | 1 + substrate/codec/Cargo.toml | 3 +- substrate/codec/src/lib.rs | 1 + substrate/executor/Cargo.toml | 2 +- substrate/executor/src/lib.rs | 2 +- substrate/executor/src/native_executor.rs | 16 +- substrate/executor/src/wasm_executor.rs | 14 +- substrate/native-runtime/Cargo.toml | 6 +- substrate/polkadot-primitives/Cargo.toml | 18 +- .../src}/block.rs | 28 +-- substrate/polkadot-primitives/src/lib.rs | 68 ++++-- .../src/parachain.rs | 51 ++--- .../src}/transaction.rs | 104 +++++---- .../src/validator.rs | 20 +- substrate/primitives/Cargo.toml | 4 +- substrate/primitives/src/block.rs | 210 +++++++++++++++++ substrate/primitives/src/bytes.rs | 5 +- substrate/primitives/src/hash.rs | 12 +- substrate/primitives/src/lib.rs | 57 ++--- substrate/primitives/src/relay/mod.rs | 33 --- .../src/{contract.rs => storage.rs} | 10 +- substrate/primitives/src/tests.rs | 212 ------------------ substrate/primitives/src/uint.rs | 6 +- substrate/runtime-io/Cargo.toml | 33 +++ substrate/runtime-io/build.rs | 14 ++ substrate/runtime-io/src/lib.rs | 31 +++ substrate/runtime-io/with_std.rs | 183 +++++++++++++++ substrate/runtime-io/without_std.rs | 208 +++++++++++++++++ substrate/runtime-std/Cargo.toml | 19 +- substrate/runtime-std/src/lib.rs | 11 +- substrate/runtime-std/with_std.rs | 170 +------------- substrate/runtime-std/without_std.rs | 200 ++--------------- substrate/wasm-runtime/Cargo.lock | 45 +++- substrate/wasm-runtime/polkadot/Cargo.toml | 6 +- substrate/wasm-runtime/polkadot/src/lib.rs | 27 ++- .../polkadot/src/runtime/consensus.rs | 4 +- .../polkadot/src/runtime/genesismap.rs | 4 +- .../polkadot/src/runtime/governance.rs | 44 ++-- .../polkadot/src/runtime/parachains.rs | 6 +- .../polkadot/src/runtime/session.rs | 6 +- .../polkadot/src/runtime/staking.rs | 10 +- .../polkadot/src/runtime/system.rs | 10 +- .../polkadot/src/runtime/timestamp.rs | 2 +- .../polkadot/src/support/environment.rs | 10 +- .../polkadot/src/support/hashable.rs | 2 +- .../polkadot/src/support/storage.rs | 38 ++-- .../polkadot/src/support/testing.rs | 2 +- substrate/wasm-runtime/test/Cargo.toml | 2 +- substrate/wasm-runtime/test/src/lib.rs | 4 +- 50 files changed, 1102 insertions(+), 928 deletions(-) rename substrate/{primitives/src/relay => polkadot-primitives/src}/block.rs (90%) rename substrate/{primitives => polkadot-primitives}/src/parachain.rs (78%) rename substrate/{primitives/src/relay => polkadot-primitives/src}/transaction.rs (78%) rename substrate/{primitives => polkadot-primitives}/src/validator.rs (82%) create mode 100644 substrate/primitives/src/block.rs delete mode 100644 substrate/primitives/src/relay/mod.rs rename substrate/primitives/src/{contract.rs => storage.rs} (83%) create mode 100644 substrate/runtime-io/Cargo.toml create mode 100644 substrate/runtime-io/build.rs create mode 100644 substrate/runtime-io/src/lib.rs create mode 100644 substrate/runtime-io/with_std.rs create mode 100644 substrate/runtime-io/without_std.rs diff --git a/substrate/Cargo.lock b/substrate/Cargo.lock index 595ca2ff32..61890f0510 100644 --- a/substrate/Cargo.lock +++ b/substrate/Cargo.lock @@ -827,10 +827,12 @@ version = "0.1.0" dependencies = [ "hex-literal 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "polkadot-runtime-std 0.1.0", + "polkadot-primitives 0.1.0", "rustc-hex 1.0.0 (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]] @@ -1048,19 +1050,13 @@ dependencies = [ name = "polkadot-primitives" version = "0.1.0" dependencies = [ - "blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", - "byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "fixed-hash 0.1.3 (git+https://github.com/rphmeier/primitives.git?branch=compile-for-wasm)", "pretty_assertions 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-hex 2.0.0 (git+https://github.com/rphmeier/rustc-hex.git)", "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.27 (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-serializer 0.1.0", - "twox-hash 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "uint 0.1.2 (git+https://github.com/rphmeier/primitives.git?branch=compile-for-wasm)", ] [[package]] @@ -1086,21 +1082,6 @@ dependencies = [ "polkadot-rpc 0.1.0", ] -[[package]] -name = "polkadot-runtime-std" -version = "0.1.0" -dependencies = [ - "ed25519 0.1.0", - "environmental 0.1.0", - "pwasm-alloc 0.1.0", - "pwasm-libc 0.1.0", - "rustc_version 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "substrate-codec 0.1.0", - "substrate-primitives 0.1.0", - "substrate-state-machine 0.1.0", - "triehash 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "polkadot-validator" version = "0.1.0" @@ -1431,6 +1412,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "substrate-codec" version = "0.1.0" +dependencies = [ + "substrate-runtime-std 0.1.0", +] [[package]] name = "substrate-executor" @@ -1444,12 +1428,12 @@ dependencies = [ "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "native-runtime 0.1.0", "parity-wasm 0.15.4 (registry+https://github.com/rust-lang/crates.io-index)", - "polkadot-runtime-std 0.1.0", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.27 (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-serializer 0.1.0", "substrate-state-machine 0.1.0", "triehash 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1468,11 +1452,35 @@ dependencies = [ "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", "substrate-codec 0.1.0", + "substrate-runtime-std 0.1.0", "substrate-serializer 0.1.0", "twox-hash 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "uint 0.1.2 (git+https://github.com/rphmeier/primitives.git?branch=compile-for-wasm)", ] +[[package]] +name = "substrate-runtime-io" +version = "0.1.0" +dependencies = [ + "ed25519 0.1.0", + "environmental 0.1.0", + "pwasm-alloc 0.1.0", + "pwasm-libc 0.1.0", + "rustc_version 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "substrate-codec 0.1.0", + "substrate-primitives 0.1.0", + "substrate-runtime-std 0.1.0", + "substrate-state-machine 0.1.0", + "triehash 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "substrate-runtime-std" +version = "0.1.0" +dependencies = [ + "rustc_version 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "substrate-serializer" version = "0.1.0" diff --git a/substrate/Cargo.toml b/substrate/Cargo.toml index ce8281310a..4780426456 100644 --- a/substrate/Cargo.toml +++ b/substrate/Cargo.toml @@ -22,6 +22,7 @@ members = [ "rpc", "codec", "polkadot-primitives", + "runtime-io", "runtime-std", "serializer", "state-machine", diff --git a/substrate/codec/Cargo.toml b/substrate/codec/Cargo.toml index c780c9bd63..e813ff4bca 100644 --- a/substrate/codec/Cargo.toml +++ b/substrate/codec/Cargo.toml @@ -5,7 +5,8 @@ version = "0.1.0" authors = ["Parity Technologies "] [dependencies] +substrate-runtime-std = { path = "../runtime-std", default_features = false } [features] -std = [] default = ["std"] +std = ["substrate-runtime-std/std"] diff --git a/substrate/codec/src/lib.rs b/substrate/codec/src/lib.rs index 4a3fae781c..805c786bc4 100644 --- a/substrate/codec/src/lib.rs +++ b/substrate/codec/src/lib.rs @@ -30,6 +30,7 @@ pub use self::slicable::{Slicable, NonTrivialSlicable}; pub use self::joiner::Joiner; pub use self::keyedvec::KeyedVec; +// TODO: move these into runtime-std and `extern crate runtime_std as std;` #[cfg(not(feature = "std"))] mod std { extern crate alloc; diff --git a/substrate/executor/Cargo.toml b/substrate/executor/Cargo.toml index 4852f173ed..577b237240 100644 --- a/substrate/executor/Cargo.toml +++ b/substrate/executor/Cargo.toml @@ -6,7 +6,7 @@ authors = ["Parity Technologies "] [dependencies] error-chain = "0.11" substrate-codec = { path = "../codec" } -polkadot-runtime-std = { path = "../runtime-std" } +substrate-runtime-io = { path = "../runtime-io" } substrate-primitives = { path = "../primitives" } substrate-serializer = { path = "../serializer" } substrate-state-machine = { path = "../state-machine" } diff --git a/substrate/executor/src/lib.rs b/substrate/executor/src/lib.rs index 6b2858dd31..e324bdf111 100644 --- a/substrate/executor/src/lib.rs +++ b/substrate/executor/src/lib.rs @@ -28,7 +28,7 @@ #![warn(missing_docs)] extern crate substrate_codec as codec; -extern crate polkadot_runtime_std as runtime_std; +extern crate substrate_runtime_io as runtime_io; extern crate substrate_primitives as primitives; extern crate substrate_serializer as serializer; extern crate substrate_state_machine as state_machine; diff --git a/substrate/executor/src/native_executor.rs b/substrate/executor/src/native_executor.rs index 64aa7b4986..a89b436402 100644 --- a/substrate/executor/src/native_executor.rs +++ b/substrate/executor/src/native_executor.rs @@ -16,7 +16,7 @@ use error::{Error, ErrorKind, Result}; use native_runtime as runtime; -use runtime_std; +use runtime_io; use state_machine::{Externalities, CodeExecutor}; use wasm_executor::WasmExecutor; @@ -42,7 +42,7 @@ impl CodeExecutor for NativeExecutor { // get a proper build script, this must be strictly adhered to or things will go wrong. let native_equivalent = include_bytes!("../../wasm-runtime/target/wasm32-unknown-unknown/release/runtime_polkadot.compact.wasm"); if code == &native_equivalent[..] { - runtime_std::with_externalities(ext, || match method { + runtime_io::with_externalities(ext, || match method { "execute_block" => safe_call(|| runtime::execute_block(data)), "execute_transaction" => safe_call(|| runtime::execute_transaction(data)), "finalise_block" => safe_call(|| runtime::finalise_block(data)), @@ -116,7 +116,7 @@ mod tests { let r = NativeExecutor.call(&mut t, COMPACT_CODE, "execute_transaction", &vec![].join(&Header::from_block_number(1u64)).join(&tx())); assert!(r.is_ok()); - runtime_std::with_externalities(&mut t, || { + runtime_io::with_externalities(&mut t, || { assert_eq!(balance(&one), 42); assert_eq!(balance(&two), 69); }); @@ -134,7 +134,7 @@ mod tests { let r = NativeExecutor.call(&mut t, BLOATY_CODE, "execute_transaction", &vec![].join(&Header::from_block_number(1u64)).join(&tx())); assert!(r.is_ok()); - runtime_std::with_externalities(&mut t, || { + runtime_io::with_externalities(&mut t, || { assert_eq!(balance(&one), 42); assert_eq!(balance(&two), 69); }); @@ -243,14 +243,14 @@ mod tests { NativeExecutor.call(&mut t, COMPACT_CODE, "execute_block", &block1().0).unwrap(); - runtime_std::with_externalities(&mut t, || { + runtime_io::with_externalities(&mut t, || { assert_eq!(balance(&one()), 42); assert_eq!(balance(&two()), 69); }); NativeExecutor.call(&mut t, COMPACT_CODE, "execute_block", &block2().0).unwrap(); - runtime_std::with_externalities(&mut t, || { + runtime_io::with_externalities(&mut t, || { assert_eq!(balance(&one()), 32); assert_eq!(balance(&two()), 79); }); @@ -262,14 +262,14 @@ mod tests { WasmExecutor.call(&mut t, COMPACT_CODE, "execute_block", &block1().0).unwrap(); - runtime_std::with_externalities(&mut t, || { + runtime_io::with_externalities(&mut t, || { assert_eq!(balance(&one()), 42); assert_eq!(balance(&two()), 69); }); WasmExecutor.call(&mut t, COMPACT_CODE, "execute_block", &block2().0).unwrap(); - runtime_std::with_externalities(&mut t, || { + runtime_io::with_externalities(&mut t, || { assert_eq!(balance(&one()), 32); assert_eq!(balance(&two()), 79); }); diff --git a/substrate/executor/src/wasm_executor.rs b/substrate/executor/src/wasm_executor.rs index b8a3367f03..76f9d851ff 100644 --- a/substrate/executor/src/wasm_executor.rs +++ b/substrate/executor/src/wasm_executor.rs @@ -117,29 +117,29 @@ impl_function_executor!(this: FunctionExecutor<'e, E>, ext_memcpy(dest: *mut u8, src: *const u8, count: usize) -> *mut u8 => { this.memory.copy_nonoverlapping(src as usize, dest as usize, count as usize) .map_err(|_| DummyUserError)?; - trace!(target: "runtime-std", "memcpy {} from {}, {} bytes", dest, src, count); + trace!(target: "runtime-io", "memcpy {} from {}, {} bytes", dest, src, count); dest }, ext_memmove(dest: *mut u8, src: *const u8, count: usize) -> *mut u8 => { this.memory.copy(src as usize, dest as usize, count as usize) .map_err(|_| DummyUserError)?; - trace!(target: "runtime-std", "memmove {} from {}, {} bytes", dest, src, count); + trace!(target: "runtime-io", "memmove {} from {}, {} bytes", dest, src, count); dest }, ext_memset(dest: *mut u8, val: u32, count: usize) -> *mut u8 => { this.memory.clear(dest as usize, val as u8, count as usize) .map_err(|_| DummyUserError)?; - trace!(target: "runtime-std", "memset {} with {}, {} bytes", dest, val, count); + trace!(target: "runtime-io", "memset {} with {}, {} bytes", dest, val, count); dest }, ext_malloc(size: usize) -> *mut u8 => { let r = this.heap.allocate(size); - trace!(target: "runtime-std", "malloc {} bytes at {}", size, r); + trace!(target: "runtime-io", "malloc {} bytes at {}", size, r); r }, ext_free(addr: *mut u8) => { this.heap.deallocate(addr); - trace!(target: "runtime-std", "free {}", addr) + trace!(target: "runtime-io", "free {}", addr) }, ext_set_storage(key_data: *const u8, key_len: u32, value_data: *const u8, value_len: u32) => { let key = this.memory.get(key_data, key_len as usize).map_err(|_| DummyUserError)?; @@ -294,7 +294,7 @@ mod tests { use state_machine::TestExternalities; use primitives::twox_128; use primitives::relay::{Header, Transaction, UncheckedTransaction, Function, AccountId}; - use runtime_std; + use runtime_io; use ed25519::Pair; fn secret_for(who: &AccountId) -> Option { @@ -448,7 +448,7 @@ mod tests { let r = WasmExecutor.call(&mut t, &foreign_code[..], "execute_transaction", &vec![].join(&Header::from_block_number(1u64)).join(&tx())); assert!(r.is_ok()); - runtime_std::with_externalities(&mut t, || { + runtime_io::with_externalities(&mut t, || { assert_eq!(balance(&one), 42); assert_eq!(balance(&two), 69); }); diff --git a/substrate/native-runtime/Cargo.toml b/substrate/native-runtime/Cargo.toml index 90c4bdee72..5666a80ce7 100644 --- a/substrate/native-runtime/Cargo.toml +++ b/substrate/native-runtime/Cargo.toml @@ -5,12 +5,14 @@ authors = ["Parity Technologies "] [dependencies] substrate-codec = { path = "../codec", version = "0.1" } -polkadot-runtime-std = { path = "../runtime-std", 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", "polkadot-runtime-std/std", "substrate-primitives/std", "log"] +std = ["substrate-codec/std", "substrate-runtime-std/std", "substrate-runtime-io/std", "substrate-primitives/std", "polkadot-primitives/std", "log"] diff --git a/substrate/polkadot-primitives/Cargo.toml b/substrate/polkadot-primitives/Cargo.toml index c81bd3a1a6..dde8e9d476 100644 --- a/substrate/polkadot-primitives/Cargo.toml +++ b/substrate/polkadot-primitives/Cargo.toml @@ -4,17 +4,11 @@ version = "0.1.0" authors = ["Parity Technologies "] [dependencies] -crunchy = "0.1" -fixed-hash = { git = "https://github.com/rphmeier/primitives.git", branch = "compile-for-wasm", default_features = false } -rustc-hex = { git = "https://github.com/rphmeier/rustc-hex.git", version = "2.0", default_features = false } serde = { version = "1.0", default_features = false } serde_derive = { version = "1.0", optional = true } -uint = { git = "https://github.com/rphmeier/primitives.git", branch = "compile-for-wasm" } -twox-hash = { version = "1.1.0", optional = true } -byteorder = { version = "1.1", default_features = false } -blake2-rfc = { version = "0.2.18", 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 } [dev-dependencies] substrate-serializer = { path = "../serializer" } @@ -23,13 +17,9 @@ pretty_assertions = "0.4" [features] default = ["std"] std = [ - "uint/std", - "fixed-hash/std", "substrate-codec/std", - "serde/std", - "rustc-hex/std", - "twox-hash", - "blake2-rfc", + "substrate-primitives/std", + "substrate-runtime-std/std", "serde_derive", - "byteorder/std" + "serde/std", ] diff --git a/substrate/primitives/src/relay/block.rs b/substrate/polkadot-primitives/src/block.rs similarity index 90% rename from substrate/primitives/src/relay/block.rs rename to substrate/polkadot-primitives/src/block.rs index 16810bf8a0..2cfa7578e1 100644 --- a/substrate/primitives/src/relay/block.rs +++ b/substrate/polkadot-primitives/src/block.rs @@ -17,12 +17,12 @@ //! Block and header type definitions. #[cfg(feature = "std")] -use bytes; -use bytes::Vec; +use primitives::bytes; +use primitives::H256; +use rstd::vec::Vec; use codec::Slicable; -use hash::H256; use parachain; -use relay::transaction::UncheckedTransaction; +use transaction::UncheckedTransaction; /// Used to refer to a block number. pub type Number = u64; @@ -34,8 +34,8 @@ pub type HeaderHash = H256; pub type TransactionHash = H256; /// Execution log (event) -#[derive(Debug, PartialEq, Eq, Clone)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] +#[derive(PartialEq, Eq, Clone)] +#[cfg_attr(feature = "std", derive(Serialize, Deserialize, Debug))] pub struct Log(#[cfg_attr(feature = "std", serde(with="bytes"))] pub Vec); impl Slicable for Log { @@ -51,8 +51,8 @@ impl Slicable for Log { impl ::codec::NonTrivialSlicable for Log { } /// The digest of a block, useful for light-clients. -#[derive(Debug, Clone, Default, PartialEq, Eq)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] +#[derive(Clone, Default, PartialEq, Eq)] +#[cfg_attr(feature = "std", derive(Serialize, Deserialize, Debug))] pub struct Digest { /// All logs that have happened in the block. pub logs: Vec, @@ -69,8 +69,8 @@ impl Slicable for Digest { } /// A Polkadot relay chain block. -#[derive(Debug, PartialEq, Eq, Clone)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] +#[derive(PartialEq, Eq, Clone)] +#[cfg_attr(feature = "std", derive(Serialize, Deserialize, Debug))] pub struct Block { /// The block header. pub header: Header, @@ -103,8 +103,8 @@ impl Slicable for Block { /// A relay chain block header. /// /// https://github.com/w3f/polkadot-spec/blob/master/spec.md#header -#[derive(Debug, PartialEq, Eq, Clone)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] +#[derive(PartialEq, Eq, Clone)] +#[cfg_attr(feature = "std", derive(Serialize, Deserialize, Debug))] #[cfg_attr(feature = "std", serde(rename_all = "camelCase"))] #[cfg_attr(feature = "std", serde(deny_unknown_fields))] pub struct Header { @@ -165,8 +165,8 @@ impl Slicable for Header { /// /// Included candidates should be sorted by parachain ID, and without duplicate /// IDs. -#[derive(Debug, PartialEq, Eq, Clone)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] +#[derive(PartialEq, Eq, Clone)] +#[cfg_attr(feature = "std", derive(Serialize, Deserialize, Debug))] #[cfg_attr(feature = "std", serde(rename_all = "camelCase"))] #[cfg_attr(feature = "std", serde(deny_unknown_fields))] pub struct Body { diff --git a/substrate/polkadot-primitives/src/lib.rs b/substrate/polkadot-primitives/src/lib.rs index 196ef89fd3..83cb3be1cd 100644 --- a/substrate/polkadot-primitives/src/lib.rs +++ b/substrate/polkadot-primitives/src/lib.rs @@ -21,36 +21,58 @@ #![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(not(feature = "std"), feature(alloc))] -extern crate rustc_hex; -extern crate serde; -extern crate byteorder; - -#[cfg(feature = "std")] -extern crate twox_hash; -#[cfg(feature = "std")] -extern crate blake2_rfc; - -#[macro_use] -extern crate crunchy; -#[macro_use] -extern crate fixed_hash; #[cfg(feature = "std")] #[macro_use] extern crate serde_derive; -#[macro_use] -extern crate uint as uint_crate; - #[cfg(feature = "std")] -extern crate core; +extern crate serde; + +extern crate substrate_runtime_std as rstd; extern crate substrate_codec as codec; extern crate substrate_primitives as primitives; #[cfg(test)] extern crate substrate_serializer; -#[cfg(test)] -#[macro_use] -extern crate pretty_assertions; -#[cfg(not(feature = "std"))] -#[macro_use] -extern crate alloc; +macro_rules! try_opt { + ($e: expr) => { + match $e { + Some(x) => x, + None => return None, + } + } +} + +pub mod parachain; +pub mod validator; +pub mod block; +pub mod transaction; + +pub use self::block::{Header, Block, Log, Digest}; +pub use self::block::Number as BlockNumber; +pub use self::transaction::{Transaction, UncheckedTransaction, Function, Proposal}; + +/// Virtual account ID that represents the idea of a dispatch/statement being signed by everybody +/// (who matters). Essentially this means that a majority of validators have decided it is +/// "correct". +pub const EVERYBODY: AccountId = [255u8; 32]; + +/// Alias to Ed25519 pubkey that identifies an account on the relay chain. This will almost +/// certainly continue to be the same as the substrate's `AuthorityId`. +pub type AccountId = primitives::AuthorityId; + +/// The Ed25519 pub key of an session that belongs to an authority of the relay chain. This is +/// exactly equivalent to what the substrate calls an "authority". +pub type SessionKey = primitives::AuthorityId; + +/// Indentifier for a chain. +pub type ChainID = u64; + +/// Index of a transaction in the relay chain. +pub type TxOrder = u64; + +/// A hash of some data used by the relay chain. +pub type Hash = primitives::H256; + +/// Alias to 520-bit hash when used in the context of a signature on the relay chain. +pub type Signature = primitives::hash::H512; diff --git a/substrate/primitives/src/parachain.rs b/substrate/polkadot-primitives/src/parachain.rs similarity index 78% rename from substrate/primitives/src/parachain.rs rename to substrate/polkadot-primitives/src/parachain.rs index 710b044162..75d5b6a326 100644 --- a/substrate/primitives/src/parachain.rs +++ b/substrate/polkadot-primitives/src/parachain.rs @@ -17,12 +17,13 @@ //! Parachain data types. #[cfg(feature = "std")] -use bytes; -use bytes::Vec; +use primitives::bytes; +use primitives; +use rstd::vec::Vec; /// Unique identifier of a parachain. -#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] +#[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)] +#[cfg_attr(feature = "std", derive(Serialize, Deserialize, Debug))] pub struct Id(u64); impl From for u64 { @@ -46,15 +47,15 @@ impl ::codec::Slicable for Id { /// Candidate parachain block. /// /// https://github.com/w3f/polkadot-spec/blob/master/spec.md#candidate-para-chain-block -#[derive(Debug, PartialEq, Eq, Clone)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] +#[derive(PartialEq, Eq, Clone)] +#[cfg_attr(feature = "std", derive(Serialize, Deserialize, Debug))] #[cfg_attr(feature = "std", serde(rename_all = "camelCase"))] #[cfg_attr(feature = "std", serde(deny_unknown_fields))] pub struct Candidate { /// The ID of the parachain this is a proposal for. pub parachain_index: Id, /// Collator's signature - pub collator_signature: ::relay::Signature, + pub collator_signature: ::Signature, /// Unprocessed ingress queue. /// /// Ordered by parachain ID and block number. @@ -72,55 +73,55 @@ pub struct CandidateReceipt { /// The ID of the parachain this is a candidate for. pub parachain_index: Id, /// The collator's relay-chain account ID - pub collator: ::relay::AccountId, + pub collator: ::AccountId, /// The head-data pub head_data: HeadData, /// Balance uploads to the relay chain. - pub balance_uploads: Vec<(::relay::AccountId, ::uint::U256)>, + pub balance_uploads: Vec<(::AccountId, u64)>, /// Egress queue roots. - pub egress_queue_roots: Vec<(Id, ::hash::H256)>, + pub egress_queue_roots: Vec<(Id, primitives::H256)>, /// Fees paid from the chain to the relay chain validators - pub fees: ::uint::U256, + pub fees: u64, } /// Parachain ingress queue message. -#[derive(Debug, PartialEq, Eq, Clone)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] +#[derive(PartialEq, Eq, Clone)] +#[cfg_attr(feature = "std", derive(Serialize, Deserialize, Debug))] pub struct Message(#[cfg_attr(feature = "std", serde(with="bytes"))] pub Vec); /// Consolidated ingress queue data. /// /// This is just an ordered vector of other parachains' egress queues, /// obtained according to the routing rules. -#[derive(Debug, Default, PartialEq, Eq, Clone)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] +#[derive(Default, PartialEq, Eq, Clone)] +#[cfg_attr(feature = "std", derive(Serialize, Deserialize, Debug))] pub struct ConsolidatedIngress(pub Vec<(Id, Vec)>); /// Parachain block data. /// /// contains everything required to validate para-block, may contain block and witness data -#[derive(Debug, PartialEq, Eq, Clone)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] +#[derive(PartialEq, Eq, Clone)] +#[cfg_attr(feature = "std", derive(Serialize, Deserialize, Debug))] pub struct BlockData(#[cfg_attr(feature = "std", serde(with="bytes"))] pub Vec); /// Parachain header raw bytes wrapper type. -#[derive(Debug, PartialEq, Eq)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] +#[derive(PartialEq, Eq)] +#[cfg_attr(feature = "std", derive(Serialize, Deserialize, Debug))] pub struct Header(#[cfg_attr(feature = "std", serde(with="bytes"))] pub Vec); /// Parachain head data included in the chain. -#[derive(Debug, PartialEq, Eq, Clone)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] +#[derive(PartialEq, Eq, Clone)] +#[cfg_attr(feature = "std", derive(Serialize, Deserialize, Debug))] pub struct HeadData(#[cfg_attr(feature = "std", serde(with="bytes"))] pub Vec); /// Parachain validation code. -#[derive(Debug, PartialEq, Eq)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] +#[derive(PartialEq, Eq)] +#[cfg_attr(feature = "std", derive(Serialize, Deserialize, Debug))] pub struct ValidationCode(#[cfg_attr(feature = "std", serde(with="bytes"))] pub Vec); /// Activitiy bit field -#[derive(Debug, PartialEq, Eq, Clone, Default)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] +#[derive(PartialEq, Eq, Clone, Default)] +#[cfg_attr(feature = "std", derive(Serialize, Deserialize, Debug))] pub struct Activity(#[cfg_attr(feature = "std", serde(with="bytes"))] pub Vec); impl ::codec::Slicable for Activity { diff --git a/substrate/primitives/src/relay/transaction.rs b/substrate/polkadot-primitives/src/transaction.rs similarity index 78% rename from substrate/primitives/src/relay/transaction.rs rename to substrate/polkadot-primitives/src/transaction.rs index fc7216737e..a711b58bec 100644 --- a/substrate/primitives/src/relay/transaction.rs +++ b/substrate/polkadot-primitives/src/transaction.rs @@ -16,19 +16,16 @@ //! Transaction type. -use bytes::Vec; +use rstd::vec::Vec; use codec::Slicable; #[cfg(feature = "std")] use std::fmt; -#[cfg(not(feature = "std"))] -use alloc::fmt; +use block::Number as BlockNumber; -use relay::block::Number as BlockNumber; - -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] +#[derive(Clone, Copy, PartialEq, Eq)] +#[cfg_attr(feature = "std", derive(Serialize, Deserialize, Debug))] #[repr(u8)] enum InternalFunctionId { /// Set the system's code. @@ -71,9 +68,9 @@ impl InternalFunctionId { } /// Internal functions that can be dispatched to. -#[derive(Debug, Clone, PartialEq, Eq)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] -pub enum InternalFunction { +#[derive(Clone, PartialEq, Eq)] +#[cfg_attr(feature = "std", derive(Serialize, Deserialize, Debug))] +pub enum Proposal { /// Set the system's code. SystemSetCode(Vec), /// Set the session length. @@ -93,67 +90,59 @@ pub enum InternalFunction { } -/// An internal function. -#[derive(Debug, Clone, PartialEq, Eq)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] -pub struct Proposal { - /// The privileged function to call. - pub function: InternalFunction, -} - impl Slicable for Proposal { fn from_slice(value: &mut &[u8]) -> Option { let id = try_opt!(u8::from_slice(value).and_then(InternalFunctionId::from_u8)); let function = match id { InternalFunctionId::SystemSetCode => - InternalFunction::SystemSetCode(try_opt!(Slicable::from_slice(value))), + Proposal::SystemSetCode(try_opt!(Slicable::from_slice(value))), InternalFunctionId::SessionSetLength => - InternalFunction::SessionSetLength(try_opt!(Slicable::from_slice(value))), - InternalFunctionId::SessionForceNewSession => InternalFunction::SessionForceNewSession, + Proposal::SessionSetLength(try_opt!(Slicable::from_slice(value))), + InternalFunctionId::SessionForceNewSession => Proposal::SessionForceNewSession, InternalFunctionId::StakingSetSessionsPerEra => - InternalFunction::StakingSetSessionsPerEra(try_opt!(Slicable::from_slice(value))), + Proposal::StakingSetSessionsPerEra(try_opt!(Slicable::from_slice(value))), InternalFunctionId::StakingSetBondingDuration => - InternalFunction::StakingSetBondingDuration(try_opt!(Slicable::from_slice(value))), + Proposal::StakingSetBondingDuration(try_opt!(Slicable::from_slice(value))), InternalFunctionId::StakingSetValidatorCount => - InternalFunction::StakingSetValidatorCount(try_opt!(Slicable::from_slice(value))), - InternalFunctionId::StakingForceNewEra => InternalFunction::StakingForceNewEra, + Proposal::StakingSetValidatorCount(try_opt!(Slicable::from_slice(value))), + InternalFunctionId::StakingForceNewEra => Proposal::StakingForceNewEra, InternalFunctionId::GovernanceSetApprovalPpmRequired => - InternalFunction::GovernanceSetApprovalPpmRequired(try_opt!(Slicable::from_slice(value))), + Proposal::GovernanceSetApprovalPpmRequired(try_opt!(Slicable::from_slice(value))), }; - Some(Proposal { function }) + Some(function) } fn to_vec(&self) -> Vec { let mut v = Vec::new(); - match self.function { - InternalFunction::SystemSetCode(ref data) => { + match *self { + Proposal::SystemSetCode(ref data) => { (InternalFunctionId::SystemSetCode as u8).as_slice_then(|s| v.extend(s)); data.as_slice_then(|s| v.extend(s)); } - InternalFunction::SessionSetLength(ref data) => { + Proposal::SessionSetLength(ref data) => { (InternalFunctionId::SessionSetLength as u8).as_slice_then(|s| v.extend(s)); data.as_slice_then(|s| v.extend(s)); } - InternalFunction::SessionForceNewSession => { + Proposal::SessionForceNewSession => { (InternalFunctionId::SessionForceNewSession as u8).as_slice_then(|s| v.extend(s)); } - InternalFunction::StakingSetSessionsPerEra(ref data) => { + Proposal::StakingSetSessionsPerEra(ref data) => { (InternalFunctionId::StakingSetSessionsPerEra as u8).as_slice_then(|s| v.extend(s)); data.as_slice_then(|s| v.extend(s)); } - InternalFunction::StakingSetBondingDuration(ref data) => { + Proposal::StakingSetBondingDuration(ref data) => { (InternalFunctionId::StakingSetBondingDuration as u8).as_slice_then(|s| v.extend(s)); data.as_slice_then(|s| v.extend(s)); } - InternalFunction::StakingSetValidatorCount(ref data) => { + Proposal::StakingSetValidatorCount(ref data) => { (InternalFunctionId::StakingSetValidatorCount as u8).as_slice_then(|s| v.extend(s)); data.as_slice_then(|s| v.extend(s)); } - InternalFunction::StakingForceNewEra => { + Proposal::StakingForceNewEra => { (InternalFunctionId::StakingForceNewEra as u8).as_slice_then(|s| v.extend(s)); } - InternalFunction::GovernanceSetApprovalPpmRequired(ref data) => { + Proposal::GovernanceSetApprovalPpmRequired(ref data) => { (InternalFunctionId::GovernanceSetApprovalPpmRequired as u8).as_slice_then(|s| v.extend(s)); data.as_slice_then(|s| v.extend(s)); } @@ -169,8 +158,8 @@ impl Slicable for Proposal { /// Public functions that can be dispatched to. -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] +#[derive(Clone, Copy, PartialEq, Eq)] +#[cfg_attr(feature = "std", derive(Serialize, Deserialize, Debug))] #[repr(u8)] enum FunctionId { /// Set the timestamp. @@ -201,19 +190,19 @@ impl FunctionId { } /// Functions on the runtime. -#[derive(Debug, Clone, PartialEq, Eq)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] +#[derive(Clone, PartialEq, Eq)] +#[cfg_attr(feature = "std", derive(Serialize, Deserialize, Debug))] pub enum Function { /// Set the timestamp. TimestampSet(u64), /// Set temporary session key as a validator. - SessionSetKey(::relay::SessionKey), + SessionSetKey(::SessionKey), /// Staking subsystem: begin staking. StakingStake, /// Staking subsystem: stop staking. StakingUnstake, /// Staking subsystem: transfer stake. - StakingTransfer(::relay::AccountId, u64), + StakingTransfer(::AccountId, u64), /// Make a proposal for the governance system. GovernancePropose(Proposal), /// Approve a proposal for the governance system. @@ -284,8 +273,8 @@ impl Slicable for Function { } /// A vetted and verified transaction from the external world. -#[derive(Debug, PartialEq, Eq, Clone)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] +#[derive(PartialEq, Eq, Clone)] +#[cfg_attr(feature = "std", derive(Serialize, Deserialize, Debug))] pub struct Transaction { /// Who signed it (note this is not a signature). pub signed: super::AccountId, @@ -297,6 +286,12 @@ pub struct Transaction { impl Slicable for Transaction { fn from_slice(value: &mut &[u8]) -> Option { + // This is a little more complicated than usua since the binary format must be compatible + // with substrate's generic `Vec` type. Basically this just means accepting that there + // will be a prefix of u32, which has the total number of bytes following (we don't need + // to use this). + let _length_do_not_remove_me_see_above: u32 = try_opt!(Slicable::from_slice(value)); + Some(Transaction { signed: try_opt!(Slicable::from_slice(value)), nonce: try_opt!(Slicable::from_slice(value)), @@ -319,6 +314,8 @@ impl Slicable for Transaction { } } +impl ::codec::NonTrivialSlicable for Transaction {} + /// A transactions right from the external world. Unchecked. #[derive(Eq, Clone)] #[cfg_attr(feature = "std", derive(Serialize, Deserialize))] @@ -331,8 +328,14 @@ pub struct UncheckedTransaction { impl Slicable for UncheckedTransaction { fn from_slice(value: &mut &[u8]) -> Option { + // This is a little more complicated than usua since the binary format must be compatible + // with substrate's generic `Vec` type. Basically this just means accepting that there + // will be a prefix of u32, which has the total number of bytes following (we don't need + // to use this). + let _length_do_not_remove_me_see_above: u32 = try_opt!(Slicable::from_slice(value)); + Some(UncheckedTransaction { - transaction: try_opt!(Transaction::from_slice(value)), + transaction: try_opt!(Slicable::from_slice(value)), signature: try_opt!(Slicable::from_slice(value)), }) } @@ -340,11 +343,18 @@ impl Slicable for UncheckedTransaction { fn to_vec(&self) -> Vec { let mut v = Vec::new(); + // need to prefix with the total length as u32 to ensure it's binary comptible with + // Vec. we'll make room for it here, then overwrite once we know the length. + v.extend(&[0u8; 4]); + self.transaction.signed.as_slice_then(|s| v.extend(s)); self.transaction.nonce.as_slice_then(|s| v.extend(s)); self.transaction.function.as_slice_then(|s| v.extend(s)); self.signature.as_slice_then(|s| v.extend(s)); + let length = (v.len() - 4) as u32; + length.as_slice_then(|s| v[0..4].copy_from_slice(s)); + v } @@ -361,6 +371,7 @@ impl PartialEq for UncheckedTransaction { } } +#[cfg(feature = "std")] impl fmt::Debug for UncheckedTransaction { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "UncheckedTransaction({:?})", self.transaction) @@ -370,6 +381,7 @@ impl fmt::Debug for UncheckedTransaction { #[cfg(test)] mod tests { use ::codec::Slicable; + use primitives; use super::*; #[test] @@ -380,7 +392,7 @@ mod tests { nonce: 999u64, function: Function::TimestampSet(135135), }, - signature: ::hash::H512([0; 64]), + signature: primitives::hash::H512([0; 64]), }; let v = Slicable::to_vec(&tx); diff --git a/substrate/primitives/src/validator.rs b/substrate/polkadot-primitives/src/validator.rs similarity index 82% rename from substrate/primitives/src/validator.rs rename to substrate/polkadot-primitives/src/validator.rs index acf78f9f3c..fa622fb629 100644 --- a/substrate/primitives/src/validator.rs +++ b/substrate/polkadot-primitives/src/validator.rs @@ -17,28 +17,28 @@ //! Validator primitives. #[cfg(feature = "std")] -use bytes; -use bytes::Vec; +use primitives::bytes; +use rstd::vec::Vec; use parachain; /// Parachain outgoing message. -#[derive(Debug, PartialEq, Eq)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] +#[derive(PartialEq, Eq)] +#[cfg_attr(feature = "std", derive(Serialize, Deserialize, Debug))] pub struct EgressPost(#[cfg_attr(feature = "std", serde(with="bytes"))] pub Vec); /// Balance upload. -#[derive(Debug, PartialEq, Eq)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] +#[derive(PartialEq, Eq)] +#[cfg_attr(feature = "std", derive(Serialize, Deserialize, Debug))] pub struct BalanceUpload(#[cfg_attr(feature = "std", serde(with="bytes"))] pub Vec); /// Balance download. -#[derive(Debug, PartialEq, Eq)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] +#[derive(PartialEq, Eq)] +#[cfg_attr(feature = "std", derive(Serialize, Deserialize, Debug))] pub struct BalanceDownload(#[cfg_attr(feature = "std", serde(with="bytes"))] pub Vec); /// The result of parachain validation. -#[derive(Debug, PartialEq, Eq)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] +#[derive(PartialEq, Eq)] +#[cfg_attr(feature = "std", derive(Serialize, Deserialize, Debug))] #[cfg_attr(feature = "std", serde(rename_all = "camelCase"))] #[cfg_attr(feature = "std", serde(deny_unknown_fields))] pub struct ValidationResult { diff --git a/substrate/primitives/Cargo.toml b/substrate/primitives/Cargo.toml index 558989c76a..359d76c81b 100644 --- a/substrate/primitives/Cargo.toml +++ b/substrate/primitives/Cargo.toml @@ -5,6 +5,8 @@ authors = ["Parity Technologies "] [dependencies] crunchy = "0.1" +substrate-runtime-std = { path = "../runtime-std", default_features = false } +substrate-codec = { path = "../codec", default_features = false } fixed-hash = { git = "https://github.com/rphmeier/primitives.git", branch = "compile-for-wasm", default_features = false } rustc-hex = { git = "https://github.com/rphmeier/rustc-hex.git", version = "2.0", default_features = false } serde = { version = "1.0", default_features = false } @@ -13,7 +15,6 @@ uint = { git = "https://github.com/rphmeier/primitives.git", branch = "compile-f twox-hash = { version = "1.1.0", optional = true } byteorder = { version = "1.1", default_features = false } blake2-rfc = { version = "0.2.18", optional = true } -substrate-codec = { path = "../codec", default_features = false } [dev-dependencies] substrate-serializer = { path = "../serializer" } @@ -25,6 +26,7 @@ std = [ "uint/std", "fixed-hash/std", "substrate-codec/std", + "substrate-runtime-std/std", "serde/std", "rustc-hex/std", "twox-hash", diff --git a/substrate/primitives/src/block.rs b/substrate/primitives/src/block.rs new file mode 100644 index 0000000000..057c3c9a56 --- /dev/null +++ b/substrate/primitives/src/block.rs @@ -0,0 +1,210 @@ +// Copyright 2017 Parity Technologies (UK) Ltd. +// This file is part of Polkadot. + +// Polkadot 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. + +// Polkadot 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 Polkadot. If not, see . + +//! Block and header type definitions. + +#[cfg(feature = "std")] +use bytes; +use rstd::vec::Vec; +use codec::Slicable; +use hash::H256; + +/// Used to refer to a block number. +pub type Number = u64; + +/// Hash used to refer to a block hash. +pub type HeaderHash = H256; + +/// Hash used to refer to a transaction hash. +pub type TransactionHash = H256; + +/// Simple generic transaction type. +#[derive(PartialEq, Eq, Clone)] +#[cfg_attr(feature = "std", derive(Serialize, Deserialize, Debug))] +pub struct Transaction(#[cfg_attr(feature = "std", serde(with="bytes"))] pub Vec); + +impl Slicable for Transaction { + fn from_slice(value: &mut &[u8]) -> Option { + Vec::::from_slice(value).map(Transaction) + } + + fn as_slice_then R>(&self, f: F) -> R { + self.0.as_slice_then(f) + } +} + +impl ::codec::NonTrivialSlicable for Transaction { } + +/// Execution log (event) +#[derive(PartialEq, Eq, Clone)] +#[cfg_attr(feature = "std", derive(Serialize, Deserialize, Debug))] +pub struct Log(#[cfg_attr(feature = "std", serde(with="bytes"))] pub Vec); + +impl Slicable for Log { + fn from_slice(value: &mut &[u8]) -> Option { + Vec::::from_slice(value).map(Log) + } + + fn as_slice_then R>(&self, f: F) -> R { + self.0.as_slice_then(f) + } +} + +impl ::codec::NonTrivialSlicable for Log { } + +/// The digest of a block, useful for light-clients. +#[derive(Clone, Default, PartialEq, Eq)] +#[cfg_attr(feature = "std", derive(Serialize, Deserialize, Debug))] +pub struct Digest { + /// All logs that have happened in the block. + pub logs: Vec, +} + +impl Slicable for Digest { + fn from_slice(value: &mut &[u8]) -> Option { + Vec::::from_slice(value).map(|logs| Digest { logs }) + } + + fn as_slice_then R>(&self, f: F) -> R { + self.logs.as_slice_then(f) + } +} + +/// A Substrate relay chain block. +#[derive(PartialEq, Eq, Clone)] +#[cfg_attr(feature = "std", derive(Serialize, Deserialize, Debug))] +pub struct Block { + /// The block header. + pub header: Header, + /// All relay-chain transactions. + pub transactions: Vec, +} + +impl Slicable for Block { + fn from_slice(value: &mut &[u8]) -> Option { + Some(Block { + header: try_opt!(Slicable::from_slice(value)), + transactions: try_opt!(Slicable::from_slice(value)), + }) + } + + fn to_vec(&self) -> Vec { + let mut v = Vec::new(); + + v.extend(self.header.to_vec()); + v.extend(self.transactions.to_vec()); + + v + } + + fn as_slice_then R>(&self, f: F) -> R { + f(self.to_vec().as_slice()) + } +} + +/// A relay chain block header. +/// +/// https://github.com/w3f/polkadot-spec/blob/master/spec.md#header +#[derive(PartialEq, Eq, Clone)] +#[cfg_attr(feature = "std", derive(Serialize, Deserialize, Debug))] +#[cfg_attr(feature = "std", serde(rename_all = "camelCase"))] +#[cfg_attr(feature = "std", serde(deny_unknown_fields))] +pub struct Header { + /// Block parent's hash. + pub parent_hash: HeaderHash, + /// Block number. + pub number: Number, + /// State root after this transition. + pub state_root: H256, + /// The root of the trie that represents this block's transactions, indexed by a 32-byte integer. + pub transaction_root: H256, + /// The digest of activity on the block. + pub digest: Digest, +} + +impl Header { + /// Create a new instance with default fields except `number`, which is given as an argument. + pub fn from_block_number(number: Number) -> Self { + Header { + parent_hash: Default::default(), + number, + state_root: Default::default(), + transaction_root: Default::default(), + digest: Default::default(), + } + } +} + +impl Slicable for Header { + fn from_slice(value: &mut &[u8]) -> Option { + Some(Header { + parent_hash: try_opt!(Slicable::from_slice(value)), + number: try_opt!(Slicable::from_slice(value)), + state_root: try_opt!(Slicable::from_slice(value)), + transaction_root: try_opt!(Slicable::from_slice(value)), + digest: try_opt!(Slicable::from_slice(value)), + }) + } + + fn to_vec(&self) -> Vec { + let mut v = Vec::new(); + + self.parent_hash.as_slice_then(|s| v.extend(s)); + self.number.as_slice_then(|s| v.extend(s)); + self.state_root.as_slice_then(|s| v.extend(s)); + self.transaction_root.as_slice_then(|s| v.extend(s)); + self.digest.as_slice_then(|s| v.extend(s)); + + v + } + + fn as_slice_then R>(&self, f: F) -> R { + f(self.to_vec().as_slice()) + } +} + +#[cfg(test)] +mod tests { + use super::*; + use codec::Slicable; + use substrate_serializer as ser; + + #[test] + fn test_header_serialization() { + let header = Header { + parent_hash: 5.into(), + number: 67, + state_root: 3.into(), + transaction_root: 6.into(), + digest: Digest { logs: vec![Log(vec![1])] }, + }; + + assert_eq!(ser::to_string_pretty(&header), r#"{ + "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000005", + "number": 67, + "stateRoot": "0x0000000000000000000000000000000000000000000000000000000000000003", + "transactionRoot": "0x0000000000000000000000000000000000000000000000000000000000000006", + "digest": { + "logs": [ + "0x01" + ] + } +}"#); + + let v = header.to_vec(); + assert_eq!(Header::from_slice(&mut &v[..]).unwrap(), header); + } +} diff --git a/substrate/primitives/src/bytes.rs b/substrate/primitives/src/bytes.rs index f8c33c5a8c..a8dc902310 100644 --- a/substrate/primitives/src/bytes.rs +++ b/substrate/primitives/src/bytes.rs @@ -14,6 +14,8 @@ // You should have received a copy of the GNU General Public License // along with Polkadot. If not, see . +//! Simply type for representing Vec with regards to serde. + use core::fmt; use serde::{de, Serializer, Deserializer}; @@ -60,7 +62,8 @@ pub fn serialize_uint(bytes: &[u8], serializer: S) -> Result } /// Expected length of bytes vector. -#[derive(Debug, PartialEq, Eq)] +#[derive(PartialEq, Eq)] +#[cfg_attr(feature = "std", derive(Debug))] pub enum ExpectedLen { /// Any length in bytes. #[cfg_attr(not(feature = "std"), allow(unused))] diff --git a/substrate/primitives/src/hash.rs b/substrate/primitives/src/hash.rs index 788641ed04..7a529b1a0c 100644 --- a/substrate/primitives/src/hash.rs +++ b/substrate/primitives/src/hash.rs @@ -16,18 +16,22 @@ //! A fixed hash type. +#[cfg(feature = "std")] use serde::{Serialize, Serializer, Deserialize, Deserializer}; +#[cfg(feature = "std")] use bytes; -macro_rules! impl_serde { +macro_rules! impl_rest { ($name: ident, $len: expr) => { + #[cfg(feature = "std")] impl Serialize for $name { fn serialize(&self, serializer: S) -> Result where S: Serializer { bytes::serialize(&self.0, serializer) } } + #[cfg(feature = "std")] impl<'de> Deserialize<'de> for $name { fn deserialize(deserializer: D) -> Result where D: Deserializer<'de> { bytes::deserialize_check_len(deserializer, bytes::ExpectedLen::Exact($len)) @@ -48,11 +52,11 @@ macro_rules! impl_serde { } construct_hash!(H160, 20); -impl_serde!(H160, 20); construct_hash!(H256, 32); -impl_serde!(H256, 32); construct_hash!(H512, 64); -impl_serde!(H512, 64); +impl_rest!(H160, 20); +impl_rest!(H256, 32); +impl_rest!(H512, 64); #[cfg(test)] mod tests { diff --git a/substrate/primitives/src/lib.rs b/substrate/primitives/src/lib.rs index bbeaa40036..452889d74b 100644 --- a/substrate/primitives/src/lib.rs +++ b/substrate/primitives/src/lib.rs @@ -22,38 +22,37 @@ #![cfg_attr(not(feature = "std"), feature(alloc))] extern crate rustc_hex; - -extern crate serde; extern crate byteorder; - -#[cfg(feature = "std")] -extern crate twox_hash; -#[cfg(feature = "std")] -extern crate blake2_rfc; - #[macro_use] extern crate crunchy; #[macro_use] extern crate fixed_hash; +#[macro_use] +extern crate uint as uint_crate; +extern crate substrate_codec as codec; + +#[cfg(feature = "std")] +extern crate serde; +#[cfg(feature = "std")] +extern crate twox_hash; +#[cfg(feature = "std")] +extern crate blake2_rfc; #[cfg(feature = "std")] #[macro_use] extern crate serde_derive; -#[macro_use] -extern crate uint as uint_crate; - #[cfg(feature = "std")] extern crate core; -extern crate substrate_codec as codec; + +#[macro_use] +extern crate substrate_runtime_std as rstd; + #[cfg(test)] extern crate substrate_serializer; + #[cfg(test)] #[macro_use] extern crate pretty_assertions; -#[cfg(not(feature = "std"))] -#[macro_use] -extern crate alloc; - // TODO: factor out to separate crate. macro_rules! try_opt { ($e: expr) => { @@ -64,23 +63,27 @@ macro_rules! try_opt { } } -mod bytes; -pub mod contract; -pub mod hash; +#[cfg(feature = "std")] +pub mod bytes; +#[cfg(feature = "std")] +pub mod hashing; +#[cfg(feature = "std")] +pub use hashing::{blake2_256, twox_128, twox_256}; +#[cfg(feature = "std")] pub mod hexdisplay; -pub mod parachain; -pub mod relay; + +pub mod storage; +pub mod hash; pub mod uint; -pub mod validator; +pub mod block; #[cfg(test)] mod tests; -#[cfg(feature = "std")] -pub mod hashing; - pub use self::hash::{H160, H256}; pub use self::uint::{U256, U512}; -#[cfg(feature = "std")] -pub use hashing::{blake2_256, twox_128, twox_256}; +pub use block::{Block, Header}; + +/// An identifier for an authority in the consensus algorithm. The same as ed25519::Public. +pub type AuthorityId = [u8; 32]; diff --git a/substrate/primitives/src/relay/mod.rs b/substrate/primitives/src/relay/mod.rs deleted file mode 100644 index a7a5f3cff9..0000000000 --- a/substrate/primitives/src/relay/mod.rs +++ /dev/null @@ -1,33 +0,0 @@ -//! Relay chain primitives. - -pub mod block; -pub mod transaction; - -pub use self::block::*; -pub use self::transaction::*; - -pub use self::block::Number as BlockNumber; - -/// Virtual account ID that represents the idea of a dispatch/statement being signed by everybody -/// (who matters). Essentially this means that a majority of validators have decided it is -/// "correct". -pub const EVERYBODY: AccountId = [255u8; 32]; - -/// Alias to Ed25519 pubkey that identifies an account on the relay chain. -pub type AccountId = [u8; 32]; - -/// The Ed25519 pub key of an session that belongs to an authority of the relay chain. This is -/// used as what the external environment/consensus algorithm calls an "authority". -pub type SessionKey = AccountId; - -/// Indentifier for a chain. -pub type ChainID = u64; - -/// Index of a transaction in the relay chain. -pub type TxOrder = u64; - -/// A hash of some data used by the relay chain. -pub type Hash = ::hash::H256; - -/// Alias to 520-bit hash when used in the context of a signature on the relay chain. -pub type Signature = ::hash::H512; diff --git a/substrate/primitives/src/contract.rs b/substrate/primitives/src/storage.rs similarity index 83% rename from substrate/primitives/src/contract.rs rename to substrate/primitives/src/storage.rs index e8e22fc3f7..6444a1206a 100644 --- a/substrate/primitives/src/contract.rs +++ b/substrate/primitives/src/storage.rs @@ -18,14 +18,14 @@ #[cfg(feature = "std")] use bytes; -use bytes::Vec; +use rstd::vec::Vec; /// Contract storage key. -#[derive(Debug, PartialEq, Eq)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] +#[derive(PartialEq, Eq)] +#[cfg_attr(feature = "std", derive(Serialize, Deserialize, Debug))] pub struct StorageKey(#[cfg_attr(feature = "std", serde(with="bytes"))] pub Vec); /// Contract storage entry data. -#[derive(Debug, PartialEq, Eq)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] +#[derive(PartialEq, Eq)] +#[cfg_attr(feature = "std", derive(Serialize, Deserialize, Debug))] pub struct StorageData(#[cfg_attr(feature = "std", serde(with="bytes"))] pub Vec); diff --git a/substrate/primitives/src/tests.rs b/substrate/primitives/src/tests.rs index 1dd8f4d3f8..ba8e97054d 100644 --- a/substrate/primitives/src/tests.rs +++ b/substrate/primitives/src/tests.rs @@ -15,215 +15,3 @@ // along with Polkadot. If not, see . //! Tests. - -use codec::Slicable; -use relay::{AccountId, Block, Header, Digest, Log, UncheckedTransaction, Transaction, Function}; - -#[test] -fn serialise_transaction_works() { - let one: AccountId = [1u8; 32]; - let two: AccountId = [2u8; 32]; - let tx = Transaction { - signed: one.clone(), - nonce: 69, - function: Function::StakingTransfer(two, 69), - }; - - let serialised = tx.to_vec(); - assert_eq!(serialised, vec![ - 1u8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 69, 0, 0, 0, 0, 0, 0, 0, - 34, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 69, 0, 0, 0, 0, 0, 0, 0 - ]); -} - -#[test] -fn deserialise_transaction_works() { - let one: AccountId = [1u8; 32]; - let two: AccountId = [2u8; 32]; - let tx = Transaction { - signed: one.clone(), - nonce: 69, - function: Function::StakingTransfer(two, 69), - }; - - let data = [ - 1u8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 69, 0, 0, 0, 0, 0, 0, 0, - 34, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 69, 0, 0, 0, 0, 0, 0, 0 - ]; - let deserialised = Transaction::from_slice(&mut &data[..]).unwrap(); - assert_eq!(deserialised, tx); -} - -#[test] -fn serialise_header_works() { - let h = Header { - parent_hash: [4u8; 32].into(), - number: 42, - state_root: [5u8; 32].into(), - transaction_root: [6u8; 32].into(), - digest: Digest { logs: vec![ Log(b"one log".to_vec()), Log(b"another log".to_vec()) ], }, - }; - let serialised = h.to_vec(); - assert_eq!(serialised, vec![ - 4u8, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 42, 0, 0, 0, 0, 0, 0, 0, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 2, 0, 0, 0, - 7, 0, 0, 0, - 111, 110, 101, 32, 108, 111, 103, - 11, 0, 0, 0, - 97, 110, 111, 116, 104, 101, 114, 32, 108, 111, 103 - ]); -} - -#[test] -fn deserialise_header_works() { - let h = Header { - parent_hash: [4u8; 32].into(), - number: 42, - state_root: [5u8; 32].into(), - transaction_root: [6u8; 32].into(), - digest: Digest { logs: vec![ Log(b"one log".to_vec()), Log(b"another log".to_vec()) ], }, - }; - let data = [ - 4u8, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 42, 0, 0, 0, 0, 0, 0, 0, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 2, 0, 0, 0, - 7, 0, 0, 0, - 111, 110, 101, 32, 108, 111, 103, - 11, 0, 0, 0, - 97, 110, 111, 116, 104, 101, 114, 32, 108, 111, 103 - ]; - let deserialised = Header::from_slice(&mut &data[..]).unwrap(); - assert_eq!(deserialised, h); -} - -#[test] -fn serialise_block_works() { - let one: AccountId = [1u8; 32]; - let two: AccountId = [2u8; 32]; - let tx1 = UncheckedTransaction { - transaction: Transaction { - signed: one.clone(), - nonce: 69, - function: Function::StakingTransfer(two, 69), - }, - signature: [1u8; 64].into(), - }; - let tx2 = UncheckedTransaction { - transaction: Transaction { - signed: two.clone(), - nonce: 42, - function: Function::StakingStake, - }, - signature: [2u8; 64].into(), - }; - let h = Header { - parent_hash: [4u8; 32].into(), - number: 42, - state_root: [5u8; 32].into(), - transaction_root: [6u8; 32].into(), - digest: Digest { logs: vec![ Log(b"one log".to_vec()), Log(b"another log".to_vec()) ], }, - }; - let b = Block { - header: h, - transactions: vec![tx1, tx2], - }; - let serialised = b.to_vec(); - assert_eq!(serialised, vec![ - // header - 4u8, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 42, 0, 0, 0, 0, 0, 0, 0, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 2, 0, 0, 0, - 7, 0, 0, 0, - 111, 110, 101, 32, 108, 111, 103, - 11, 0, 0, 0, - 97, 110, 111, 116, 104, 101, 114, 32, 108, 111, 103, - // transactions - 2, 0, 0, 0, - // tx1 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 69, 0, 0, 0, 0, 0, 0, 0, - 34, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 69, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - // tx2 - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 42, 0, 0, 0, 0, 0, 0, 0, - 32, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - ]); -} - -#[test] -fn deserialise_block_works() { - let one: AccountId = [1u8; 32]; - let two: AccountId = [2u8; 32]; - let tx1 = UncheckedTransaction { - transaction: Transaction { - signed: one.clone(), - nonce: 69, - function: Function::StakingTransfer(two, 69), - }, - signature: [1u8; 64].into(), - }; - let tx2 = UncheckedTransaction { - transaction: Transaction { - signed: two.clone(), - nonce: 42, - function: Function::StakingStake, - }, - signature: [2u8; 64].into(), - }; - let h = Header { - parent_hash: [4u8; 32].into(), - number: 42, - state_root: [5u8; 32].into(), - transaction_root: [6u8; 32].into(), - digest: Digest { logs: vec![ Log(b"one log".to_vec()), Log(b"another log".to_vec()) ], }, - }; - let b = Block { - header: h, - transactions: vec![tx1, tx2], - }; - let data = [ - // header - 4u8, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 42, 0, 0, 0, 0, 0, 0, 0, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 2, 0, 0, 0, - 7, 0, 0, 0, - 111, 110, 101, 32, 108, 111, 103, - 11, 0, 0, 0, - 97, 110, 111, 116, 104, 101, 114, 32, 108, 111, 103, - // transactions - 2, 0, 0, 0, - // tx1 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 69, 0, 0, 0, 0, 0, 0, 0, - 34, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 69, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - // tx2 - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 42, 0, 0, 0, 0, 0, 0, 0, - 32, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - ]; - let deserialised = Block::from_slice(&mut &data[..]).unwrap(); - assert_eq!(deserialised, b); -} diff --git a/substrate/primitives/src/uint.rs b/substrate/primitives/src/uint.rs index 724779a269..b14a8aa4fd 100644 --- a/substrate/primitives/src/uint.rs +++ b/substrate/primitives/src/uint.rs @@ -16,12 +16,15 @@ //! An unsigned fixed-size integer. +#[cfg(feature = "std")] use serde::{Serialize, Serializer, Deserialize, Deserializer}; +#[cfg(feature = "std")] use bytes; macro_rules! impl_serde { ($name: ident, $len: expr) => { + #[cfg(feature = "std")] impl Serialize for $name { fn serialize(&self, serializer: S) -> Result where S: Serializer { let mut bytes = [0u8; $len * 8]; @@ -30,6 +33,7 @@ macro_rules! impl_serde { } } + #[cfg(feature = "std")] impl<'de> Deserialize<'de> for $name { fn deserialize(deserializer: D) -> Result where D: Deserializer<'de> { bytes::deserialize_check_len(deserializer, bytes::ExpectedLen::Between(0, $len * 8)) @@ -40,8 +44,8 @@ macro_rules! impl_serde { } construct_uint!(U256, 4); -impl_serde!(U256, 4); construct_uint!(U512, 8); +impl_serde!(U256, 4); impl_serde!(U512, 8); #[cfg(test)] diff --git a/substrate/runtime-io/Cargo.toml b/substrate/runtime-io/Cargo.toml new file mode 100644 index 0000000000..e975b063a6 --- /dev/null +++ b/substrate/runtime-io/Cargo.toml @@ -0,0 +1,33 @@ +[package] +name = "substrate-runtime-io" +version = "0.1.0" +authors = ["Parity Technologies "] +build = "build.rs" + +[build-dependencies] +rustc_version = "0.2" + +[dependencies] +pwasm-alloc = { path = "../wasm-runtime/pwasm-alloc" } +pwasm-libc = { path = "../wasm-runtime/pwasm-libc" } +substrate-runtime-std = { path = "../runtime-std" } +environmental = { path = "../environmental", optional = true } +substrate-state-machine = { path = "../state-machine", optional = true } +substrate-primitives = { path = "../primitives", default_features = false } +substrate-codec = { path = "../codec", default_features = false } +triehash = { version = "0.1", optional = true } +ed25519 = { path = "../ed25519", optional = true } + +[features] +default = ["std"] +std = [ + "environmental", + "substrate-state-machine", + "triehash", + "substrate-primitives/std", + "substrate-codec/std", + "substrate-runtime-std/std", + "ed25519", +] +nightly = [] +strict = [] diff --git a/substrate/runtime-io/build.rs b/substrate/runtime-io/build.rs new file mode 100644 index 0000000000..35eb154f3a --- /dev/null +++ b/substrate/runtime-io/build.rs @@ -0,0 +1,14 @@ +//! Set a nightly feature + +extern crate rustc_version; +use rustc_version::{version, version_meta, Channel}; + +fn main() { + // Assert we haven't travelled back in time + assert!(version().unwrap().major >= 1); + + // Set cfg flags depending on release channel + if let Channel::Nightly = version_meta().unwrap().channel { + println!("cargo:rustc-cfg=feature=\"nightly\""); + } +} diff --git a/substrate/runtime-io/src/lib.rs b/substrate/runtime-io/src/lib.rs new file mode 100644 index 0000000000..5a165c62e5 --- /dev/null +++ b/substrate/runtime-io/src/lib.rs @@ -0,0 +1,31 @@ +// 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 . + +//! This is part of the Substrate runtime. + +#![cfg_attr(not(feature = "std"), no_std)] +#![cfg_attr(not(feature = "std"), feature(lang_items))] +#![cfg_attr(not(feature = "std"), feature(core_intrinsics))] +#![cfg_attr(not(feature = "std"), feature(alloc))] + +#![cfg_attr(feature = "std", doc = "Substrate runtime standard library as compiled when linked with Rust's standard library.")] +#![cfg_attr(not(feature = "std"), doc = "Substrate's runtime standard library as compiled without Rust's standard library.")] + +#[cfg(feature = "std")] +include!("../with_std.rs"); + +#[cfg(not(feature = "std"))] +include!("../without_std.rs"); diff --git a/substrate/runtime-io/with_std.rs b/substrate/runtime-io/with_std.rs new file mode 100644 index 0000000000..63db356cbd --- /dev/null +++ b/substrate/runtime-io/with_std.rs @@ -0,0 +1,183 @@ +// 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; + +extern crate substrate_state_machine; +extern crate substrate_primitives as primitives; +extern crate triehash; +extern crate ed25519; + +pub use std::vec; +pub use std::rc; +pub use std::cell; +pub use std::boxed; +pub use std::slice; +pub use std::mem; + +// re-export hashing functions. +pub use primitives::{blake2_256, twox_128, twox_256}; + +pub use substrate_state_machine::{Externalities, ExternalitiesError, TestExternalities}; +use primitives::hexdisplay::HexDisplay; + +// 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]) -> Vec { + ext::with(|ext| ext.storage(key).ok().map(|s| s.to_vec())) + .expect("read_storage cannot be called outside of an Externalities-provided environment.") + .unwrap_or_else(Vec::new) +} + +/// Get `key` from storage, placing the value into `value_out` (as much as possible) and return +/// the number of bytes that the key in storage was. +pub fn read_storage(key: &[u8], value_out: &mut [u8], value_offset: usize) -> usize { + ext::with(|ext| { + if let Ok(value) = ext.storage(key) { + 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() + } else { + // no-entry is treated as an empty vector of bytes. + // TODO: consider allowing empty-vector to exist separately to no-entry (i.e. return + // Option) + 0 + } + }).expect("read_storage cannot be called outside of an Externalities-provided environment.") +} + +/// Set the storage to some particular key. +pub fn set_storage(key: &[u8], value: &[u8]) { + ext::with(|ext| + ext.set_storage(key.to_vec(), value.to_vec()) + ); +} + +/// The current relay chain identifier. +pub fn chain_id() -> u64 { + ext::with(|ext| + ext.chain_id() + ).unwrap_or(0) +} + +/// "Commit" all existing operations and get the resultant storage root. +pub fn storage_root() -> [u8; 32] { + ext::with(|ext| + ext.storage_root() + ).unwrap_or([0u8; 32]) +} + +/// "Commit" all existing operations and get the resultant storage root. +pub fn enumerated_trie_root(serialised_values: &[&[u8]]) -> [u8; 32] { + triehash::ordered_trie_root(serialised_values.iter().map(|s| s.to_vec())).0 +} + +/// Verify a ed25519 signature. +pub fn ed25519_verify(sig: &[u8; 64], msg: &[u8], pubkey: &[u8; 32]) -> 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. +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 { + ($( $name:ident ),*) => {} +} + +#[cfg(test)] +mod std_tests { + use super::*; + + macro_rules! map { + ($( $name:expr => $value:expr ),*) => ( + vec![ $( ( $name, $value ) ),* ].into_iter().collect() + ) + } + + #[test] + fn storage_works() { + let mut t = TestExternalities { storage: map![], }; + assert!(with_externalities(&mut t, || { + assert_eq!(storage(b"hello"), b"".to_vec()); + set_storage(b"hello", b"world"); + assert_eq!(storage(b"hello"), b"world".to_vec()); + assert_eq!(storage(b"foo"), b"".to_vec()); + set_storage(b"foo", &[1, 2, 3][..]); + true + })); + + t.storage = map![b"foo".to_vec() => b"bar".to_vec()]; + + assert!(!with_externalities(&mut t, || { + assert_eq!(storage(b"hello"), b"".to_vec()); + assert_eq!(storage(b"foo"), b"bar".to_vec()); + false + })); + } + + #[test] + fn read_storage_works() { + let mut t = TestExternalities { storage: 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) >= 4); + assert_eq!(v, [11u8, 0, 0, 0]); + let mut w = [0u8; 11]; + assert!(read_storage(b":test", &mut w[..], 4) >= 11); + assert_eq!(&w, b"Hello world"); + }); + } +} diff --git a/substrate/runtime-io/without_std.rs b/substrate/runtime-io/without_std.rs new file mode 100644 index 0000000000..472b135beb --- /dev/null +++ b/substrate/runtime-io/without_std.rs @@ -0,0 +1,208 @@ +// 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 . + +#[cfg(feature = "nightly")] +extern crate alloc; + +#[cfg(feature = "nightly")] +extern crate pwasm_libc; +#[cfg(feature = "nightly")] +extern crate pwasm_alloc; + +extern crate substrate_primitives as primitives; + +pub use alloc::vec; +pub use alloc::boxed; +pub use alloc::rc; +pub use core::mem; +pub use core::slice; +pub use core::cell; + +use alloc::vec::Vec; + +#[lang = "panic_fmt"] +#[no_mangle] +pub extern fn panic_fmt(_fmt: ::core::fmt::Arguments, _file: &'static str, _line: u32, _col: u32) { + unsafe { + ext_print_utf8(_file.as_ptr() as *const u8, _file.len() as u32); + ext_print_num(_line as u64); + ext_print_num(_col as u64); + ::core::intrinsics::abort() + } +} + +extern "C" { + fn ext_print_utf8(utf8_data: *const u8, utf8_len: u32); + fn ext_print_hex(data: *const u8, len: u32); + fn ext_print_num(value: u64); + fn ext_set_storage(key_data: *const u8, key_len: u32, value_data: *const u8, value_len: u32); + fn ext_get_allocated_storage(key_data: *const u8, key_len: u32, written_out: *mut u32) -> *mut u8; + fn ext_get_storage_into(key_data: *const u8, key_len: u32, value_data: *mut u8, value_len: u32, value_offset: u32) -> u32; + fn ext_storage_root(result: *mut u8); + fn ext_enumerated_trie_root(values_data: *const u8, lens_data: *const u32, lens_len: u32, result: *mut u8); + fn ext_chain_id() -> u64; + fn ext_blake2_256(data: *const u8, len: u32, out: *mut u8); + fn ext_twox_128(data: *const u8, len: u32, out: *mut u8); + fn ext_twox_256(data: *const u8, len: u32, out: *mut u8); + fn ext_ed25519_verify(msg_data: *const u8, msg_len: u32, sig_data: *const u8, pubkey_data: *const u8) -> u32; +} + +/// Get `key` from storage and return a `Vec`, empty if there's a problem. +pub fn storage(key: &[u8]) -> Vec { + let mut length: u32 = 0; + unsafe { + let ptr = ext_get_allocated_storage(key.as_ptr(), key.len() as u32, &mut length); + Vec::from_raw_parts(ptr, length as usize, length as usize) + } +} + +/// Set the storage to some particular key. +pub fn set_storage(key: &[u8], value: &[u8]) { + unsafe { + ext_set_storage( + key.as_ptr(), key.len() as u32, + value.as_ptr(), value.len() as u32 + ); + } +} + +/// Get `key` from storage, placing the value into `value_out` (as much as possible) and return +/// the number of bytes that the key in storage was. +pub fn read_storage(key: &[u8], value_out: &mut [u8], value_offset: usize) -> usize { + unsafe { + ext_get_storage_into(key.as_ptr(), key.len() as u32, value_out.as_mut_ptr(), value_out.len() as u32, value_offset as u32) as usize + } +} + +/// The current storage's root. +pub fn storage_root() -> [u8; 32] { + let mut result: [u8; 32] = Default::default(); + unsafe { + ext_storage_root(result.as_mut_ptr()); + } + result +} + +/// A trie root calculated from enumerated values. +pub fn enumerated_trie_root(values: &[&[u8]]) -> [u8; 32] { + let lens = values.iter().map(|v| (v.len() as u32).to_le()).collect::>(); + let values = values.iter().fold(Vec::new(), |mut acc, sl| { acc.extend_from_slice(sl); acc }); + let mut result: [u8; 32] = Default::default(); + unsafe { + ext_enumerated_trie_root( + values.as_ptr(), + lens.as_ptr(), lens.len() as u32, + result.as_mut_ptr() + ); + } + result +} + +/// The current relay chain identifier. +pub fn chain_id() -> u64 { + unsafe { + ext_chain_id() + } +} + +/// Conduct a 256-bit Blake2 hash. +pub fn blake2_256(data: &[u8]) -> [u8; 32] { + let mut result: [u8; 32] = Default::default(); + unsafe { + ext_blake2_256(data.as_ptr(), data.len() as u32, result.as_mut_ptr()); + } + result +} + +/// Conduct four XX hashes to give a 256-bit result. +pub fn twox_256(data: &[u8]) -> [u8; 32] { + let mut result: [u8; 32] = Default::default(); + unsafe { + ext_twox_256(data.as_ptr(), data.len() as u32, result.as_mut_ptr()); + } + result +} + +/// Conduct two XX hashes to give a 128-bit result. +pub fn twox_128(data: &[u8]) -> [u8; 16] { + let mut result: [u8; 16] = Default::default(); + unsafe { + ext_twox_128(data.as_ptr(), data.len() as u32, result.as_mut_ptr()); + } + result +} + +/// Verify a ed25519 signature. +pub fn ed25519_verify(sig: &[u8], msg: &[u8], pubkey: &[u8]) -> bool { + sig.len() == 64 && pubkey.len() == 32 && unsafe { + ext_ed25519_verify(msg.as_ptr(), msg.len() as u32, sig.as_ptr(), pubkey.as_ptr()) + } == 0 +} + +/// Trait for things which can be printed. +pub trait Printable { + fn print(self); +} + +impl<'a> Printable for &'a [u8] { + fn print(self) { + unsafe { + ext_print_hex(self.as_ptr(), self.len() as u32); + } + } +} + +impl<'a> Printable for &'a str { + fn print(self) { + unsafe { + ext_print_utf8(self.as_ptr() as *const u8, self.len() as u32); + } + } +} + +impl Printable for u64 { + fn print(self) { + unsafe { ext_print_num(self); } + } +} + +/// Print a printable value. +pub fn print(value: T) { + value.print(); +} + +#[macro_export] +macro_rules! impl_stubs { + ( $( $name:ident ),* ) => { + pub mod _internal { + $( + #[no_mangle] + pub fn $name(input_data: *mut u8, input_len: usize) -> u64 { + let input = if input_len == 0 { + &[0u8; 0] + } else { + unsafe { + $crate::slice::from_raw_parts(input_data, input_len) + } + }; + + let output = super::$name(input); + output.as_ptr() as u64 + ((output.len() as u64) << 32) + } + )* + } + } +} diff --git a/substrate/runtime-std/Cargo.toml b/substrate/runtime-std/Cargo.toml index 4429017974..e619a9b5d4 100644 --- a/substrate/runtime-std/Cargo.toml +++ b/substrate/runtime-std/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "polkadot-runtime-std" +name = "substrate-runtime-std" version = "0.1.0" authors = ["Parity Technologies "] build = "build.rs" @@ -8,24 +8,9 @@ build = "build.rs" rustc_version = "0.2" [dependencies] -pwasm-alloc = { path = "../wasm-runtime/pwasm-alloc", version = "0.1" } -pwasm-libc = { path = "../wasm-runtime/pwasm-libc", version = "0.1" } -environmental = { path = "../environmental", version = "0.1", optional = true } -substrate-state-machine = { path = "../state-machine", version = "0.1", optional = true } -substrate-primitives = { path = "../primitives", version = "0.1", default_features = false } -substrate-codec = { path = "../codec", version = "0.1", default_features = false } -triehash = { version = "0.1", optional = true } -ed25519 = { path = "../ed25519", version = "0.1", optional = true } [features] default = ["std"] -std = [ - "environmental", - "substrate-state-machine", - "triehash", - "substrate-primitives/std", - "substrate-codec/std", - "ed25519", -] +std = [] nightly = [] strict = [] diff --git a/substrate/runtime-std/src/lib.rs b/substrate/runtime-std/src/lib.rs index 357fa7313b..2dde712473 100644 --- a/substrate/runtime-std/src/lib.rs +++ b/substrate/runtime-std/src/lib.rs @@ -1,20 +1,21 @@ // Copyright 2017 Parity Technologies (UK) Ltd. -// This file is part of Polkadot. +// This file is part of Substrate. -// Polkadot 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. -// Polkadot 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 Polkadot. If not, see . +// along with Substrate. If not, see . -//! This is part of the Polkadot runtime. +//! Lowest-abstraction level for the Substrate runtime: just exports useful primitives from std +//! or core/alloc to be used with any code that depends on the runtime. #![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(not(feature = "std"), feature(lang_items))] diff --git a/substrate/runtime-std/with_std.rs b/substrate/runtime-std/with_std.rs index 88bfbd940c..1d5b779a03 100644 --- a/substrate/runtime-std/with_std.rs +++ b/substrate/runtime-std/with_std.rs @@ -1,26 +1,18 @@ // Copyright 2017 Parity Technologies (UK) Ltd. -// This file is part of Polkadot. +// This file is part of Substrate. -// Polkadot 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. -// Polkadot 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 Polkadot. If not, see . - -#[macro_use] -extern crate environmental; - -extern crate substrate_state_machine; -extern crate substrate_primitives as primitives; -extern crate triehash; -extern crate ed25519; +// along with Substrate. If not, see . pub use std::vec; pub use std::rc; @@ -28,156 +20,4 @@ pub use std::cell; pub use std::boxed; pub use std::slice; pub use std::mem; - -// re-export hashing functions. -pub use primitives::{blake2_256, twox_128, twox_256}; - -pub use substrate_state_machine::{Externalities, ExternalitiesError, TestExternalities}; -use primitives::hexdisplay::HexDisplay; - -// 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]) -> Vec { - ext::with(|ext| ext.storage(key).ok().map(|s| s.to_vec())) - .expect("read_storage cannot be called outside of an Externalities-provided environment.") - .unwrap_or_else(Vec::new) -} - -/// Get `key` from storage, placing the value into `value_out` (as much as possible) and return -/// the number of bytes that the key in storage was. -pub fn read_storage(key: &[u8], value_out: &mut [u8], value_offset: usize) -> usize { - ext::with(|ext| { - if let Ok(value) = ext.storage(key) { - 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() - } else { - // no-entry is treated as an empty vector of bytes. - // TODO: consider allowing empty-vector to exist separately to no-entry (i.e. return - // Option) - 0 - } - }).expect("read_storage cannot be called outside of an Externalities-provided environment.") -} - -/// Set the storage to some particular key. -pub fn set_storage(key: &[u8], value: &[u8]) { - ext::with(|ext| - ext.set_storage(key.to_vec(), value.to_vec()) - ); -} - -/// The current relay chain identifier. -pub fn chain_id() -> u64 { - ext::with(|ext| - ext.chain_id() - ).unwrap_or(0) -} - -/// "Commit" all existing operations and get the resultant storage root. -pub fn storage_root() -> [u8; 32] { - ext::with(|ext| - ext.storage_root() - ).unwrap_or([0u8; 32]) -} - -/// "Commit" all existing operations and get the resultant storage root. -pub fn enumerated_trie_root(serialised_values: &[&[u8]]) -> [u8; 32] { - triehash::ordered_trie_root(serialised_values.iter().map(|s| s.to_vec())).0 -} - -/// Verify a ed25519 signature. -pub fn ed25519_verify(sig: &[u8; 64], msg: &[u8], pubkey: &[u8; 32]) -> 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. -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 { - ($( $name:ident ),*) => {} -} - -#[cfg(test)] -mod std_tests { - use super::*; - - macro_rules! map { - ($( $name:expr => $value:expr ),*) => ( - vec![ $( ( $name, $value ) ),* ].into_iter().collect() - ) - } - - #[test] - fn storage_works() { - let mut t = TestExternalities { storage: map![], }; - assert!(with_externalities(&mut t, || { - assert_eq!(storage(b"hello"), b"".to_vec()); - set_storage(b"hello", b"world"); - assert_eq!(storage(b"hello"), b"world".to_vec()); - assert_eq!(storage(b"foo"), b"".to_vec()); - set_storage(b"foo", &[1, 2, 3][..]); - true - })); - - t.storage = map![b"foo".to_vec() => b"bar".to_vec()]; - - assert!(!with_externalities(&mut t, || { - assert_eq!(storage(b"hello"), b"".to_vec()); - assert_eq!(storage(b"foo"), b"bar".to_vec()); - false - })); - } - - #[test] - fn read_storage_works() { - let mut t = TestExternalities { storage: 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) >= 4); - assert_eq!(v, [11u8, 0, 0, 0]); - let mut w = [0u8; 11]; - assert!(read_storage(b":test", &mut w[..], 4) >= 11); - assert_eq!(&w, b"Hello world"); - }); - } -} +pub use std::ops; diff --git a/substrate/runtime-std/without_std.rs b/substrate/runtime-std/without_std.rs index 6176012370..203ee02e82 100644 --- a/substrate/runtime-std/without_std.rs +++ b/substrate/runtime-std/without_std.rs @@ -1,192 +1,26 @@ +// 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 . + #[cfg(feature = "nightly")] extern crate alloc; -#[cfg(feature = "nightly")] -extern crate pwasm_libc; -#[cfg(feature = "nightly")] -extern crate pwasm_alloc; - -extern crate substrate_primitives as primitives; - pub use alloc::vec; pub use alloc::boxed; pub use alloc::rc; pub use core::mem; pub use core::slice; pub use core::cell; - -use alloc::vec::Vec; - -#[lang = "panic_fmt"] -#[no_mangle] -pub extern fn panic_fmt(_fmt: ::core::fmt::Arguments, _file: &'static str, _line: u32, _col: u32) { - unsafe { - ext_print_utf8(_file.as_ptr() as *const u8, _file.len() as u32); - ext_print_num(_line as u64); - ext_print_num(_col as u64); - ::core::intrinsics::abort() - } -} - -extern "C" { - fn ext_print_utf8(utf8_data: *const u8, utf8_len: u32); - fn ext_print_hex(data: *const u8, len: u32); - fn ext_print_num(value: u64); - fn ext_set_storage(key_data: *const u8, key_len: u32, value_data: *const u8, value_len: u32); - fn ext_get_allocated_storage(key_data: *const u8, key_len: u32, written_out: *mut u32) -> *mut u8; - fn ext_get_storage_into(key_data: *const u8, key_len: u32, value_data: *mut u8, value_len: u32, value_offset: u32) -> u32; - fn ext_storage_root(result: *mut u8); - fn ext_enumerated_trie_root(values_data: *const u8, lens_data: *const u32, lens_len: u32, result: *mut u8); - fn ext_chain_id() -> u64; - fn ext_blake2_256(data: *const u8, len: u32, out: *mut u8); - fn ext_twox_128(data: *const u8, len: u32, out: *mut u8); - fn ext_twox_256(data: *const u8, len: u32, out: *mut u8); - fn ext_ed25519_verify(msg_data: *const u8, msg_len: u32, sig_data: *const u8, pubkey_data: *const u8) -> u32; -} - -/// Get `key` from storage and return a `Vec`, empty if there's a problem. -pub fn storage(key: &[u8]) -> Vec { - let mut length: u32 = 0; - unsafe { - let ptr = ext_get_allocated_storage(key.as_ptr(), key.len() as u32, &mut length); - Vec::from_raw_parts(ptr, length as usize, length as usize) - } -} - -/// Set the storage to some particular key. -pub fn set_storage(key: &[u8], value: &[u8]) { - unsafe { - ext_set_storage( - key.as_ptr(), key.len() as u32, - value.as_ptr(), value.len() as u32 - ); - } -} - -/// Get `key` from storage, placing the value into `value_out` (as much as possible) and return -/// the number of bytes that the key in storage was. -pub fn read_storage(key: &[u8], value_out: &mut [u8], value_offset: usize) -> usize { - unsafe { - ext_get_storage_into(key.as_ptr(), key.len() as u32, value_out.as_mut_ptr(), value_out.len() as u32, value_offset as u32) as usize - } -} - -/// The current storage's root. -pub fn storage_root() -> [u8; 32] { - let mut result: [u8; 32] = Default::default(); - unsafe { - ext_storage_root(result.as_mut_ptr()); - } - result -} - -/// A trie root calculated from enumerated values. -pub fn enumerated_trie_root(values: &[&[u8]]) -> [u8; 32] { - let lens = values.iter().map(|v| (v.len() as u32).to_le()).collect::>(); - let values = values.iter().fold(Vec::new(), |mut acc, sl| { acc.extend_from_slice(sl); acc }); - let mut result: [u8; 32] = Default::default(); - unsafe { - ext_enumerated_trie_root( - values.as_ptr(), - lens.as_ptr(), lens.len() as u32, - result.as_mut_ptr() - ); - } - result -} - -/// The current relay chain identifier. -pub fn chain_id() -> u64 { - unsafe { - ext_chain_id() - } -} - -/// Conduct a 256-bit Blake2 hash. -pub fn blake2_256(data: &[u8]) -> [u8; 32] { - let mut result: [u8; 32] = Default::default(); - unsafe { - ext_blake2_256(data.as_ptr(), data.len() as u32, result.as_mut_ptr()); - } - result -} - -/// Conduct four XX hashes to give a 256-bit result. -pub fn twox_256(data: &[u8]) -> [u8; 32] { - let mut result: [u8; 32] = Default::default(); - unsafe { - ext_twox_256(data.as_ptr(), data.len() as u32, result.as_mut_ptr()); - } - result -} - -/// Conduct two XX hashes to give a 128-bit result. -pub fn twox_128(data: &[u8]) -> [u8; 16] { - let mut result: [u8; 16] = Default::default(); - unsafe { - ext_twox_128(data.as_ptr(), data.len() as u32, result.as_mut_ptr()); - } - result -} - -/// Verify a ed25519 signature. -pub fn ed25519_verify(sig: &[u8], msg: &[u8], pubkey: &[u8]) -> bool { - sig.len() == 64 && pubkey.len() == 32 && unsafe { - ext_ed25519_verify(msg.as_ptr(), msg.len() as u32, sig.as_ptr(), pubkey.as_ptr()) - } == 0 -} - -/// Trait for things which can be printed. -pub trait Printable { - fn print(self); -} - -impl<'a> Printable for &'a [u8] { - fn print(self) { - unsafe { - ext_print_hex(self.as_ptr(), self.len() as u32); - } - } -} - -impl<'a> Printable for &'a str { - fn print(self) { - unsafe { - ext_print_utf8(self.as_ptr() as *const u8, self.len() as u32); - } - } -} - -impl Printable for u64 { - fn print(self) { - unsafe { ext_print_num(self); } - } -} - -/// Print a printable value. -pub fn print(value: T) { - value.print(); -} - -#[macro_export] -macro_rules! impl_stubs { - ( $( $name:ident ),* ) => { - pub mod _internal { - $( - #[no_mangle] - pub fn $name(input_data: *mut u8, input_len: usize) -> u64 { - let input = if input_len == 0 { - &[0u8; 0] - } else { - unsafe { - $crate::slice::from_raw_parts(input_data, input_len) - } - }; - - let output = super::$name(input); - output.as_ptr() as u64 + ((output.len() as u64) << 32) - } - )* - } - } -} +pub use core::ops; diff --git a/substrate/wasm-runtime/Cargo.lock b/substrate/wasm-runtime/Cargo.lock index 96a286f124..a6777c28db 100644 --- a/substrate/wasm-runtime/Cargo.lock +++ b/substrate/wasm-runtime/Cargo.lock @@ -376,18 +376,14 @@ dependencies = [ ] [[package]] -name = "polkadot-runtime-std" +name = "polkadot-primitives" version = "0.1.0" dependencies = [ - "ed25519 0.1.0", - "environmental 0.1.0", - "pwasm-alloc 0.1.0", - "pwasm-libc 0.1.0", - "rustc_version 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", "substrate-codec 0.1.0", "substrate-primitives 0.1.0", - "substrate-state-machine 0.1.0", - "triehash 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "substrate-runtime-std 0.1.0", ] [[package]] @@ -518,16 +514,18 @@ dependencies = [ name = "runtime-polkadot" version = "0.1.0" dependencies = [ - "polkadot-runtime-std 0.1.0", + "polkadot-primitives 0.1.0", "substrate-codec 0.1.0", "substrate-primitives 0.1.0", + "substrate-runtime-io 0.1.0", + "substrate-runtime-std 0.1.0", ] [[package]] name = "runtime-test" version = "0.1.0" dependencies = [ - "polkadot-runtime-std 0.1.0", + "substrate-runtime-io 0.1.0", ] [[package]] @@ -603,6 +601,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "substrate-codec" version = "0.1.0" +dependencies = [ + "substrate-runtime-std 0.1.0", +] [[package]] name = "substrate-primitives" @@ -616,10 +617,34 @@ dependencies = [ "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", "substrate-codec 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.1.2 (git+https://github.com/rphmeier/primitives.git?branch=compile-for-wasm)", ] +[[package]] +name = "substrate-runtime-io" +version = "0.1.0" +dependencies = [ + "ed25519 0.1.0", + "environmental 0.1.0", + "pwasm-alloc 0.1.0", + "pwasm-libc 0.1.0", + "rustc_version 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "substrate-codec 0.1.0", + "substrate-primitives 0.1.0", + "substrate-runtime-std 0.1.0", + "substrate-state-machine 0.1.0", + "triehash 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "substrate-runtime-std" +version = "0.1.0" +dependencies = [ + "rustc_version 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "substrate-state-machine" version = "0.1.0" diff --git a/substrate/wasm-runtime/polkadot/Cargo.toml b/substrate/wasm-runtime/polkadot/Cargo.toml index 1bd0618a91..bde7c47729 100644 --- a/substrate/wasm-runtime/polkadot/Cargo.toml +++ b/substrate/wasm-runtime/polkadot/Cargo.toml @@ -8,9 +8,11 @@ crate-type = ["cdylib"] [dependencies] substrate-codec = { path = "../../codec", version = "0.1", default-features = false } -polkadot-runtime-std = { path = "../../runtime-std", version = "0.1", default-features = false } +substrate-runtime-std = { path = "../../runtime-std", version = "0.1", default-features = false } +substrate-runtime-io = { path = "../../runtime-io", version = "0.1", default-features = false } substrate-primitives = { path = "../../primitives", version = "0.1", default-features = false } +polkadot-primitives = { path = "../../polkadot-primitives", version = "0.1", default-features = false } [features] default = [] -std = ["substrate-codec/std", "polkadot-runtime-std/std", "substrate-primitives/std"] +std = ["substrate-codec/std", "substrate-runtime-io/std", "substrate-runtime-std/std", "substrate-primitives/std", "polkadot-primitives/std"] diff --git a/substrate/wasm-runtime/polkadot/src/lib.rs b/substrate/wasm-runtime/polkadot/src/lib.rs index 656a8a7b2f..e277c23f14 100644 --- a/substrate/wasm-runtime/polkadot/src/lib.rs +++ b/substrate/wasm-runtime/polkadot/src/lib.rs @@ -19,7 +19,10 @@ #![cfg_attr(not(feature = "std"), no_std)] #[macro_use] -extern crate polkadot_runtime_std as runtime_std; +extern crate substrate_runtime_std as rstd; + +#[macro_use] +extern crate substrate_runtime_io as runtime_io; #[cfg(feature = "std")] extern crate rustc_hex; @@ -28,7 +31,8 @@ extern crate rustc_hex; extern crate log; extern crate substrate_codec as codec; -extern crate substrate_primitives as primitives; +extern crate substrate_primitives; +extern crate polkadot_primitives; #[cfg(test)] #[macro_use] @@ -38,20 +42,15 @@ extern crate hex_literal; pub mod support; pub mod runtime; -use runtime_std::prelude::*; +use rstd::prelude::*; use codec::Slicable; -use primitives::relay::{Header, Block, UncheckedTransaction}; +use polkadot_primitives::{Header, Block, UncheckedTransaction}; /// Type definitions and helpers for transactions. pub mod transaction { - pub use primitives::relay::{Transaction, UncheckedTransaction}; - use primitives::relay::Signature; - - #[cfg(feature = "std")] - use std::ops; - - #[cfg(not(feature = "std"))] - use core::ops; + use rstd::ops; + use polkadot_primitives::Signature; + pub use polkadot_primitives::{Transaction, UncheckedTransaction}; /// A type-safe indicator that a transaction has been checked. #[derive(PartialEq, Eq, Clone)] @@ -78,7 +77,7 @@ pub mod transaction { /// On failure, return the transaction back. pub fn check(tx: UncheckedTransaction) -> Result { let msg = ::codec::Slicable::to_vec(&tx.transaction); - if ::runtime_std::ed25519_verify(&tx.signature.0, &msg, &tx.transaction.signed) { + if ::runtime_io::ed25519_verify(&tx.signature.0, &msg, &tx.transaction.signed) { Ok(CheckedTransaction(tx)) } else { Err(tx) @@ -110,7 +109,7 @@ pub fn finalise_block(mut input: &[u8]) -> Vec { /// Run whatever tests we have. pub fn run_tests(mut input: &[u8]) -> Vec { - use runtime_std::print; + use runtime_io::print; print("run_tests..."); let block = Block::from_slice(&mut input).unwrap(); diff --git a/substrate/wasm-runtime/polkadot/src/runtime/consensus.rs b/substrate/wasm-runtime/polkadot/src/runtime/consensus.rs index 6f0552368b..bbc62eeba0 100644 --- a/substrate/wasm-runtime/polkadot/src/runtime/consensus.rs +++ b/substrate/wasm-runtime/polkadot/src/runtime/consensus.rs @@ -16,9 +16,9 @@ //! Conensus module for runtime; manages the authority set ready for the native code. -use runtime_std::prelude::*; +use rstd::prelude::*; use support::storage::unhashed::StorageVec; -use primitives::relay::SessionKey; +use polkadot_primitives::SessionKey; struct AuthorityStorageVec {} impl StorageVec for AuthorityStorageVec { diff --git a/substrate/wasm-runtime/polkadot/src/runtime/genesismap.rs b/substrate/wasm-runtime/polkadot/src/runtime/genesismap.rs index 5fa27d1a8f..8f55e0c073 100644 --- a/substrate/wasm-runtime/polkadot/src/runtime/genesismap.rs +++ b/substrate/wasm-runtime/polkadot/src/runtime/genesismap.rs @@ -17,10 +17,10 @@ //! Tool for creating the genesis block. use std::collections::HashMap; -use runtime_std::twox_128; +use runtime_io::twox_128; use codec::{KeyedVec, Joiner}; use support::Hashable; -use primitives::relay::{Number as BlockNumber, Block, AccountId}; +use polkadot_primitives::{BlockNumber, Block, AccountId}; use runtime::staking::Balance; /// Configuration of a general Polkadot genesis block. diff --git a/substrate/wasm-runtime/polkadot/src/runtime/governance.rs b/substrate/wasm-runtime/polkadot/src/runtime/governance.rs index 8e830b7e14..53c4369ffd 100644 --- a/substrate/wasm-runtime/polkadot/src/runtime/governance.rs +++ b/substrate/wasm-runtime/polkadot/src/runtime/governance.rs @@ -25,10 +25,10 @@ //! At the end of the era, all validators approvals are tallied and if there are sufficient to pass //! the proposal then it is enacted. All items in storage concerning the proposal are reset. -use runtime_std::prelude::*; +use rstd::prelude::*; use codec::KeyedVec; use support::storage; -use primitives::relay::{Proposal, AccountId, Hash, BlockNumber}; +use polkadot_primitives::{Proposal, AccountId, Hash, BlockNumber}; use runtime::{staking, system, session}; const APPROVALS_REQUIRED: &[u8] = b"gov:apr"; @@ -94,7 +94,7 @@ pub mod privileged { pub mod internal { use super::*; - use primitives::relay::{Proposal, InternalFunction}; + use polkadot_primitives::Proposal; /// Current era is ending; we should finish up any proposals. pub fn end_of_an_era() { @@ -112,29 +112,29 @@ pub mod internal { } fn enact_proposal(proposal: Proposal) { - match proposal.function { - InternalFunction::SystemSetCode(code) => { + match proposal { + Proposal::SystemSetCode(code) => { system::privileged::set_code(&code); } - InternalFunction::SessionSetLength(value) => { + Proposal::SessionSetLength(value) => { session::privileged::set_length(value); } - InternalFunction::SessionForceNewSession => { + Proposal::SessionForceNewSession => { session::privileged::force_new_session(); } - InternalFunction::StakingSetSessionsPerEra(value) => { + Proposal::StakingSetSessionsPerEra(value) => { staking::privileged::set_sessions_per_era(value); } - InternalFunction::StakingSetBondingDuration(value) => { + Proposal::StakingSetBondingDuration(value) => { staking::privileged::set_bonding_duration(value); } - InternalFunction::StakingSetValidatorCount(value) => { + Proposal::StakingSetValidatorCount(value) => { staking::privileged::set_validator_count(value); } - InternalFunction::StakingForceNewEra => { + Proposal::StakingForceNewEra => { staking::privileged::force_new_era() } - InternalFunction::GovernanceSetApprovalPpmRequired(value) => { + Proposal::GovernanceSetApprovalPpmRequired(value) => { self::privileged::set_approval_ppm_required(value); } @@ -145,7 +145,7 @@ pub mod internal { #[cfg(test)] mod tests { use super::*; - use runtime_std::{with_externalities, twox_128, TestExternalities}; + use runtime_io::{with_externalities, twox_128, TestExternalities}; use codec::{KeyedVec, Joiner}; use support::{one, two, with_env}; use primitives::relay::{AccountId, InternalFunction}; @@ -190,7 +190,7 @@ mod tests { // Block 1: Make proposal. Approve it. Era length changes. with_env(|e| e.block_number = 1); public::propose(&one, &Proposal { - function: InternalFunction::StakingSetSessionsPerEra(2), + function: Proposal::StakingSetSessionsPerEra(2), }); public::approve(&two, 1); staking::internal::check_new_era(); @@ -215,7 +215,7 @@ mod tests { // Block 1: Make proposal. Fail it. with_env(|e| e.block_number = 1); public::propose(&one, &Proposal { - function: InternalFunction::StakingSetSessionsPerEra(2), + function: Proposal::StakingSetSessionsPerEra(2), }); staking::internal::check_new_era(); assert_eq!(staking::era_length(), 1); @@ -223,7 +223,7 @@ mod tests { // Block 2: Make proposal. Approve it. It should change era length. with_env(|e| e.block_number = 2); public::propose(&one, &Proposal { - function: InternalFunction::StakingSetSessionsPerEra(2), + function: Proposal::StakingSetSessionsPerEra(2), }); public::approve(&two, 2); staking::internal::check_new_era(); @@ -248,7 +248,7 @@ mod tests { // Block 1: Make proposal. Will have only 1 vote. No change. with_env(|e| e.block_number = 1); public::propose(&one, &Proposal { - function: InternalFunction::StakingSetSessionsPerEra(2), + function: Proposal::StakingSetSessionsPerEra(2), }); staking::internal::check_new_era(); assert_eq!(staking::era_length(), 1); @@ -273,7 +273,7 @@ mod tests { // Block 1: Make proposal. Will have only 1 vote. No change. with_env(|e| e.block_number = 1); public::propose(&one, &Proposal { - function: InternalFunction::StakingSetSessionsPerEra(2), + function: Proposal::StakingSetSessionsPerEra(2), }); public::approve(&two, 0); staking::internal::check_new_era(); @@ -299,7 +299,7 @@ mod tests { // Block 1: Make proposal. Will have only 1 vote. No change. with_env(|e| e.block_number = 1); public::propose(&one, &Proposal { - function: InternalFunction::StakingSetSessionsPerEra(2), + function: Proposal::StakingSetSessionsPerEra(2), }); public::approve(&two, 1); public::approve(&two, 1); @@ -326,10 +326,10 @@ mod tests { // Block 1: Make proposal. Will have only 1 vote. No change. with_env(|e| e.block_number = 1); public::propose(&one, &Proposal { - function: InternalFunction::StakingSetSessionsPerEra(2), + function: Proposal::StakingSetSessionsPerEra(2), }); public::propose(&two, &Proposal { - function: InternalFunction::StakingSetSessionsPerEra(2), + function: Proposal::StakingSetSessionsPerEra(2), }); staking::internal::check_new_era(); assert_eq!(staking::era_length(), 1); @@ -378,7 +378,7 @@ mod tests { // Block 1: Make proposal. Will have only 1 vote. No change. with_env(|e| e.block_number = 1); public::propose(&one, &Proposal { - function: InternalFunction::StakingSetSessionsPerEra(2), + function: Proposal::StakingSetSessionsPerEra(2), }); public::approve(&four, 1); staking::internal::check_new_era(); diff --git a/substrate/wasm-runtime/polkadot/src/runtime/parachains.rs b/substrate/wasm-runtime/polkadot/src/runtime/parachains.rs index 96e395cfa3..222448467a 100644 --- a/substrate/wasm-runtime/polkadot/src/runtime/parachains.rs +++ b/substrate/wasm-runtime/polkadot/src/runtime/parachains.rs @@ -16,8 +16,8 @@ //! Main parachains logic. For now this is just the determination of which validators do what. -use runtime_std::prelude::*; -use runtime_std::mem; +use rstd::prelude::*; +use runtime_io::mem; use codec::{Slicable, Joiner}; use support::{Hashable, with_env, storage}; use runtime::session; @@ -96,7 +96,7 @@ pub fn calculate_duty_roster() -> DutyRoster { #[cfg(test)] mod tests { use super::*; - use runtime_std::{with_externalities, twox_128, TestExternalities}; + use runtime_io::{with_externalities, twox_128, TestExternalities}; use codec::{KeyedVec, Joiner}; use support::{one, two, with_env}; use runtime::{consensus, session}; diff --git a/substrate/wasm-runtime/polkadot/src/runtime/session.rs b/substrate/wasm-runtime/polkadot/src/runtime/session.rs index 7e94eaf308..302919ac2a 100644 --- a/substrate/wasm-runtime/polkadot/src/runtime/session.rs +++ b/substrate/wasm-runtime/polkadot/src/runtime/session.rs @@ -17,10 +17,10 @@ //! Session manager: is told the validators and allows them to manage their session keys for the //! consensus module. -use runtime_std::prelude::*; +use rstd::prelude::*; use codec::KeyedVec; use support::{storage, StorageVec}; -use primitives::relay::{AccountId, SessionKey, BlockNumber}; +use polkadot_primitives::{AccountId, SessionKey, BlockNumber}; use runtime::{system, staking, consensus}; const SESSION_LENGTH: &[u8] = b"ses:len"; @@ -137,7 +137,7 @@ mod tests { use super::public::*; use super::privileged::*; use super::internal::*; - use runtime_std::{with_externalities, twox_128, TestExternalities}; + use runtime_io::{with_externalities, twox_128, TestExternalities}; use codec::{KeyedVec, Joiner}; use support::{one, two, with_env}; use primitives::relay::AccountId; diff --git a/substrate/wasm-runtime/polkadot/src/runtime/staking.rs b/substrate/wasm-runtime/polkadot/src/runtime/staking.rs index d3577b9f6b..356d778733 100644 --- a/substrate/wasm-runtime/polkadot/src/runtime/staking.rs +++ b/substrate/wasm-runtime/polkadot/src/runtime/staking.rs @@ -16,12 +16,12 @@ //! Staking manager: Handles balances and periodically determines the best set of validators. -use runtime_std::prelude::*; -use runtime_std::cell::RefCell; -use runtime_std::print; +use rstd::prelude::*; +use runtime_io::cell::RefCell; +use runtime_io::print; use codec::KeyedVec; use support::{storage, StorageVec}; -use primitives::relay::{BlockNumber, AccountId}; +use polkadot_primitives::{BlockNumber, AccountId}; use runtime::{system, session, governance}; /// The balance of an account. @@ -213,7 +213,7 @@ mod tests { use super::public::*; use super::privileged::*; - use runtime_std::{with_externalities, twox_128, TestExternalities}; + use runtime_io::{with_externalities, twox_128, TestExternalities}; use codec::{KeyedVec, Joiner}; use support::{one, two, with_env}; use primitives::relay::AccountId; diff --git a/substrate/wasm-runtime/polkadot/src/runtime/system.rs b/substrate/wasm-runtime/polkadot/src/runtime/system.rs index 5f40feccf5..aa66c47152 100644 --- a/substrate/wasm-runtime/polkadot/src/runtime/system.rs +++ b/substrate/wasm-runtime/polkadot/src/runtime/system.rs @@ -17,12 +17,12 @@ //! System manager: Handles all of the top-level stuff; executing block/transaction, setting code //! and depositing logs. -use runtime_std::prelude::*; -use runtime_std::{mem, storage_root, enumerated_trie_root}; +use rstd::prelude::*; +use runtime_io::{mem, storage_root, enumerated_trie_root}; use codec::{KeyedVec, Slicable}; use support::{Hashable, storage, with_env}; -use primitives::relay::{AccountId, Hash, TxOrder, BlockNumber, Block, Header, UncheckedTransaction, - Function, Log}; +use polkadot_primitives::{AccountId, Hash, TxOrder, BlockNumber, Block, Header, + UncheckedTransaction, Function, Log}; use runtime::{staking, session}; const NONCE_OF: &[u8] = b"sys:non:"; @@ -218,7 +218,7 @@ mod tests { use super::*; use super::internal::*; - use runtime_std::{with_externalities, twox_128, TestExternalities}; + use runtime_io::{with_externalities, twox_128, TestExternalities}; use codec::{Joiner, KeyedVec, Slicable}; use support::{StaticHexInto, HexDisplay, one, two}; use primitives::relay::{Header, Digest, UncheckedTransaction, Transaction, Function}; diff --git a/substrate/wasm-runtime/polkadot/src/runtime/timestamp.rs b/substrate/wasm-runtime/polkadot/src/runtime/timestamp.rs index 2b316f17af..45ebdcbe70 100644 --- a/substrate/wasm-runtime/polkadot/src/runtime/timestamp.rs +++ b/substrate/wasm-runtime/polkadot/src/runtime/timestamp.rs @@ -41,7 +41,7 @@ mod tests { use super::*; use super::public::*; - use runtime_std::{with_externalities, twox_128, TestExternalities}; + use runtime_io::{with_externalities, twox_128, TestExternalities}; use runtime::timestamp; use codec::{Joiner, KeyedVec}; diff --git a/substrate/wasm-runtime/polkadot/src/support/environment.rs b/substrate/wasm-runtime/polkadot/src/support/environment.rs index b2d0e737e1..63ab4277d1 100644 --- a/substrate/wasm-runtime/polkadot/src/support/environment.rs +++ b/substrate/wasm-runtime/polkadot/src/support/environment.rs @@ -16,12 +16,12 @@ //! Environment API: Allows certain information to be accessed throughout the runtime. -use runtime_std::boxed::Box; -use runtime_std::mem; -use runtime_std::cell::RefCell; -use runtime_std::rc::Rc; +use runtime_io::boxed::Box; +use runtime_io::mem; +use runtime_io::cell::RefCell; +use runtime_io::rc::Rc; -use primitives::relay::{BlockNumber, Digest, Hash}; +use polkadot_primitives::{BlockNumber, Digest, Hash}; #[derive(Default)] /// The information that can be accessed globally. diff --git a/substrate/wasm-runtime/polkadot/src/support/hashable.rs b/substrate/wasm-runtime/polkadot/src/support/hashable.rs index 66c3844fda..b6ad775396 100644 --- a/substrate/wasm-runtime/polkadot/src/support/hashable.rs +++ b/substrate/wasm-runtime/polkadot/src/support/hashable.rs @@ -17,7 +17,7 @@ //! Hashable trait. use codec::Slicable; -use runtime_std::{blake2_256, twox_128, twox_256}; +use runtime_io::{blake2_256, twox_128, twox_256}; pub trait Hashable: Sized { fn blake2_256(&self) -> [u8; 32]; diff --git a/substrate/wasm-runtime/polkadot/src/support/storage.rs b/substrate/wasm-runtime/polkadot/src/support/storage.rs index f0e5f1c82e..e46d48cf1a 100644 --- a/substrate/wasm-runtime/polkadot/src/support/storage.rs +++ b/substrate/wasm-runtime/polkadot/src/support/storage.rs @@ -16,15 +16,15 @@ //! Stuff to do with the runtime's storage. -use runtime_std::prelude::*; -use runtime_std::{self, twox_128}; +use rstd::prelude::*; +use runtime_io::{self, twox_128}; use codec::{Slicable, KeyedVec}; // TODO: consider using blake256 to avoid possible preimage attack. /// Return the value of the item in storage under `key`, or `None` if there is no explicit entry. pub fn get(key: &[u8]) -> Option { - let raw = runtime_std::storage(&twox_128(key)[..]); + let raw = runtime_io::storage(&twox_128(key)[..]); Slicable::from_slice(&mut &raw[..]) } @@ -48,12 +48,12 @@ pub fn get_or_else T>(key: &[u8], default_va /// Please `value` in storage under `key`. pub fn put(key: &[u8], value: &T) { - value.as_slice_then(|slice| runtime_std::set_storage(&twox_128(key)[..], slice)); + value.as_slice_then(|slice| runtime_io::set_storage(&twox_128(key)[..], slice)); } /// Please `value` in storage under `key`. pub fn place(key: &[u8], value: T) { - value.as_slice_then(|slice| runtime_std::set_storage(&twox_128(key)[..], slice)); + value.as_slice_then(|slice| runtime_io::set_storage(&twox_128(key)[..], slice)); } /// Remove `key` from storage, returning its value if it had an explicit entry or `None` otherwise. @@ -86,22 +86,22 @@ pub fn take_or_else T>(key: &[u8], default_v /// Check to see if `key` has an explicit entry in storage. pub fn exists(key: &[u8]) -> bool { let mut x = [0u8; 1]; - runtime_std::read_storage(&twox_128(key)[..], &mut x[..], 0) >= 1 + runtime_io::read_storage(&twox_128(key)[..], &mut x[..], 0) >= 1 } /// Ensure `key` has no explicit entry in storage. pub fn kill(key: &[u8]) { - runtime_std::set_storage(&twox_128(key)[..], b""); + runtime_io::set_storage(&twox_128(key)[..], b""); } /// Get a Vec of bytes from storage. pub fn get_raw(key: &[u8]) -> Vec { - runtime_std::storage(&twox_128(key)[..]) + runtime_io::storage(&twox_128(key)[..]) } /// Put a raw byte slice into storage. pub fn put_raw(key: &[u8], value: &[u8]) { - runtime_std::set_storage(&twox_128(key)[..], value) + runtime_io::set_storage(&twox_128(key)[..], value) } /// A trait to conveniently store a vector of storable data. @@ -142,11 +142,11 @@ pub trait StorageVec { } pub mod unhashed { - use super::{runtime_std, Slicable, KeyedVec, Vec}; + use super::{runtime_io, Slicable, KeyedVec, Vec}; /// Return the value of the item in storage under `key`, or `None` if there is no explicit entry. pub fn get(key: &[u8]) -> Option { - let raw = runtime_std::storage(key); + let raw = runtime_io::storage(key); T::from_slice(&mut &raw[..]) } @@ -170,12 +170,12 @@ pub mod unhashed { /// Please `value` in storage under `key`. pub fn put(key: &[u8], value: &T) { - value.as_slice_then(|slice| runtime_std::set_storage(key, slice)); + value.as_slice_then(|slice| runtime_io::set_storage(key, slice)); } /// Please `value` in storage under `key`. pub fn place(key: &[u8], value: T) { - value.as_slice_then(|slice| runtime_std::set_storage(key, slice)); + value.as_slice_then(|slice| runtime_io::set_storage(key, slice)); } /// Remove `key` from storage, returning its value if it had an explicit entry or `None` otherwise. @@ -208,22 +208,22 @@ pub mod unhashed { /// Check to see if `key` has an explicit entry in storage. pub fn exists(key: &[u8]) -> bool { let mut x = [0u8; 1]; - runtime_std::read_storage(key, &mut x[..], 0) >= 1 + runtime_io::read_storage(key, &mut x[..], 0) >= 1 } /// Ensure `key` has no explicit entry in storage. pub fn kill(key: &[u8]) { - runtime_std::set_storage(key, b""); + runtime_io::set_storage(key, b""); } /// Get a Vec of bytes from storage. pub fn get_raw(key: &[u8]) -> Vec { - runtime_std::storage(key) + runtime_io::storage(key) } /// Put a raw byte slice into storage. pub fn put_raw(key: &[u8], value: &[u8]) { - runtime_std::set_storage(key, value) + runtime_io::set_storage(key, value) } /// A trait to conveniently store a vector of storable data. @@ -269,7 +269,7 @@ mod tests { use super::*; use std::collections::HashMap; use support::HexDisplay; - use runtime_std::{storage, twox_128, TestExternalities, with_externalities}; + use runtime_io::{storage, twox_128, TestExternalities, with_externalities}; #[test] fn integers_can_be_stored() { @@ -310,7 +310,7 @@ mod tests { fn vecs_can_be_retrieved() { let mut t = TestExternalities { storage: HashMap::new(), }; with_externalities(&mut t, || { - runtime_std::set_storage(&twox_128(b":test"), b"\x0b\0\0\0Hello world"); + runtime_io::set_storage(&twox_128(b":test"), b"\x0b\0\0\0Hello world"); let x = b"Hello world".to_vec(); println!("Hex: {}", HexDisplay::from(&storage(&twox_128(b":test")))); let y = get::>(b":test").unwrap(); diff --git a/substrate/wasm-runtime/polkadot/src/support/testing.rs b/substrate/wasm-runtime/polkadot/src/support/testing.rs index 89510e0212..a230ded26f 100644 --- a/substrate/wasm-runtime/polkadot/src/support/testing.rs +++ b/substrate/wasm-runtime/polkadot/src/support/testing.rs @@ -16,7 +16,7 @@ //! Testing helpers. -use primitives::relay::AccountId; +use polkadot_primitives::AccountId; use super::statichex::StaticHexInto; #[macro_export] diff --git a/substrate/wasm-runtime/test/Cargo.toml b/substrate/wasm-runtime/test/Cargo.toml index 10ae9ba2fb..3df27c9c11 100644 --- a/substrate/wasm-runtime/test/Cargo.toml +++ b/substrate/wasm-runtime/test/Cargo.toml @@ -7,4 +7,4 @@ authors = ["Parity Technologies "] crate-type = ["cdylib"] [dependencies] -polkadot-runtime-std = { path = "../../runtime-std", version = "0.1", default_features = false } +substrate-runtime-io = { path = "../../runtime-io", version = "0.1", default_features = false } diff --git a/substrate/wasm-runtime/test/src/lib.rs b/substrate/wasm-runtime/test/src/lib.rs index a97f5029f1..2002d3cefc 100644 --- a/substrate/wasm-runtime/test/src/lib.rs +++ b/substrate/wasm-runtime/test/src/lib.rs @@ -7,8 +7,8 @@ extern crate alloc; use alloc::vec::Vec; #[macro_use] -extern crate polkadot_runtime_std as runtime_std; -use runtime_std::{ +extern crate substrate_runtime_io as runtime_io; +use runtime_io::{ set_storage, storage, print, blake2_256, twox_128, twox_256, ed25519_verify, enumerated_trie_root }; From dcff8f1a2f621790cbc253e0993cc6ac938c5d8c Mon Sep 17 00:00:00 2001 From: Gav Date: Wed, 7 Feb 2018 15:54:18 +0100 Subject: [PATCH 11/15] Full native build with new structure. No tests yet. Wasm build still pulls in std. --- substrate/Cargo.lock | 2 ++ substrate/client/Cargo.toml | 1 + substrate/client/src/backend.rs | 3 +-- substrate/client/src/blockchain.rs | 3 +-- substrate/client/src/genesis.rs | 4 ++-- substrate/client/src/in_mem.rs | 3 +-- substrate/client/src/lib.rs | 5 +++-- substrate/codec/src/joiner.rs | 2 +- substrate/codec/src/keyedvec.rs | 4 ++-- substrate/codec/src/lib.rs | 11 ++--------- substrate/codec/src/slicable.rs | 8 ++++---- substrate/collator/src/lib.rs | 2 +- substrate/executor/src/native_executor.rs | 2 +- substrate/executor/src/wasm_executor.rs | 2 +- substrate/network/Cargo.toml | 1 + substrate/network/src/blocks.rs | 5 ++--- substrate/network/src/chain.rs | 4 +--- substrate/network/src/lib.rs | 8 +++++--- substrate/network/src/message.rs | 7 ++++--- substrate/network/src/protocol.rs | 5 +---- substrate/network/src/service.rs | 2 +- substrate/network/src/sync.rs | 6 +----- substrate/polkadot-primitives/src/block.rs | 15 +-------------- substrate/primitives/src/block.rs | 5 ++++- substrate/rpc/src/chain/mod.rs | 2 +- substrate/rpc/src/state/mod.rs | 4 ++-- substrate/runtime-std/with_std.rs | 2 ++ substrate/runtime-std/without_std.rs | 2 ++ .../polkadot/src/runtime/governance.rs | 2 +- .../wasm-runtime/polkadot/src/runtime/session.rs | 2 +- .../wasm-runtime/polkadot/src/runtime/staking.rs | 2 +- .../wasm-runtime/polkadot/src/runtime/system.rs | 2 +- .../wasm-runtime/polkadot/src/support/storage.rs | 2 +- 33 files changed, 56 insertions(+), 74 deletions(-) diff --git a/substrate/Cargo.lock b/substrate/Cargo.lock index 61890f0510..eadfdd27c4 100644 --- a/substrate/Cargo.lock +++ b/substrate/Cargo.lock @@ -1005,6 +1005,7 @@ dependencies = [ "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "native-runtime 0.1.0", "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "polkadot-primitives 0.1.0", "substrate-codec 0.1.0", "substrate-executor 0.1.0", "substrate-primitives 0.1.0", @@ -1035,6 +1036,7 @@ dependencies = [ "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)", "polkadot-client 0.1.0", + "polkadot-primitives 0.1.0", "rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", "semver 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/substrate/client/Cargo.toml b/substrate/client/Cargo.toml index 1239525530..b5ee065dbb 100644 --- a/substrate/client/Cargo.toml +++ b/substrate/client/Cargo.toml @@ -7,6 +7,7 @@ authors = ["Parity Technologies "] error-chain = "0.11" log = "0.3" parking_lot = "0.4" +polkadot-primitives = { path = "../polkadot-primitives", version = "0.1" } substrate-primitives = { path = "../primitives", version = "0.1" } substrate-state-machine = { path = "../state-machine", version = "0.1" } substrate-serializer = { path = "../serializer" } diff --git a/substrate/client/src/backend.rs b/substrate/client/src/backend.rs index 2af11f3254..563dd03699 100644 --- a/substrate/client/src/backend.rs +++ b/substrate/client/src/backend.rs @@ -18,7 +18,7 @@ use state_machine; use error; -use primitives::relay::block; +use primitives::block; use blockchain::{self, BlockId}; /// Block insertion transction. Keeps hold if the inseted block state and data. @@ -50,4 +50,3 @@ pub trait Backend { /// Returns state backend for specified block. fn state_at(&self, block: BlockId) -> error::Result; } - diff --git a/substrate/client/src/blockchain.rs b/substrate/client/src/blockchain.rs index 0b5e715731..6eb9061eb7 100644 --- a/substrate/client/src/blockchain.rs +++ b/substrate/client/src/blockchain.rs @@ -17,7 +17,7 @@ //! Polkadot blockchain trait use std::fmt::{Display, Formatter, Error as FmtError}; -use primitives::relay::block; +use primitives::block; use error::Result; /// Block indentification. @@ -83,4 +83,3 @@ pub enum BlockStatus { /// Not in the queue or the blockchain. Unknown, } - diff --git a/substrate/client/src/genesis.rs b/substrate/client/src/genesis.rs index 6815f6b2b5..5a48f947dd 100644 --- a/substrate/client/src/genesis.rs +++ b/substrate/client/src/genesis.rs @@ -17,7 +17,7 @@ //! Tool for creating the genesis block. use std::collections::HashMap; -use primitives::relay::{Block, Header}; +use primitives::{Block, Header}; use triehash::trie_root; /// Create a genesis block, given the initial storage. @@ -46,7 +46,7 @@ mod tests { use state_machine::OverlayedChanges; use state_machine::backend::InMemory; use substrate_executor::executor; - use primitives::relay::{AccountId, Hash, BlockNumber, Header, Digest, UncheckedTransaction, + use polkadot_primitives::{AccountId, Hash, BlockNumber, Header, Digest, UncheckedTransaction, Transaction, Function}; use ed25519::Pair; diff --git a/substrate/client/src/in_mem.rs b/substrate/client/src/in_mem.rs index c1f9d113a4..34475886c4 100644 --- a/substrate/client/src/in_mem.rs +++ b/substrate/client/src/in_mem.rs @@ -23,7 +23,7 @@ use error; use backend; use primitives; use ser; -use primitives::relay::block::{self, HeaderHash}; +use primitives::block::{self, HeaderHash}; use blockchain::{self, BlockId, BlockStatus}; fn header_hash(header: &block::Header) -> block::HeaderHash { @@ -201,4 +201,3 @@ impl backend::Backend for Backend { } } } - diff --git a/substrate/client/src/lib.rs b/substrate/client/src/lib.rs index edf4d22c3e..f0d1fd1a63 100644 --- a/substrate/client/src/lib.rs +++ b/substrate/client/src/lib.rs @@ -18,6 +18,7 @@ #![warn(missing_docs)] +extern crate polkadot_primitives; extern crate substrate_primitives as primitives; extern crate substrate_state_machine as state_machine; extern crate substrate_serializer as ser; @@ -47,8 +48,8 @@ pub use genesis::construct_genesis_block; pub use blockchain::Info as ChainInfo; pub use blockchain::BlockId; -use primitives::relay::block; -use primitives::contract::{StorageKey, StorageData}; +use primitives::block; +use primitives::storage::{StorageKey, StorageData}; use blockchain::Backend as BlockchainBackend; use backend::BlockImportOperation; diff --git a/substrate/codec/src/joiner.rs b/substrate/codec/src/joiner.rs index ac85331012..7df97e5705 100644 --- a/substrate/codec/src/joiner.rs +++ b/substrate/codec/src/joiner.rs @@ -16,7 +16,7 @@ //! Trait -use std::iter::Extend; +use rstd::iter::Extend; use super::slicable::Slicable; /// Trait to allow itself to be serialised into a value which can be extended diff --git a/substrate/codec/src/keyedvec.rs b/substrate/codec/src/keyedvec.rs index 535a616e14..aac1df0f17 100644 --- a/substrate/codec/src/keyedvec.rs +++ b/substrate/codec/src/keyedvec.rs @@ -17,8 +17,8 @@ //! Serialiser and prepender. use slicable::Slicable; -use std::iter::Extend; -use std::vec::Vec; +use rstd::iter::Extend; +use rstd::vec::Vec; /// Trait to allow itselg to be serialised and prepended by a given slice. pub trait KeyedVec { diff --git a/substrate/codec/src/lib.rs b/substrate/codec/src/lib.rs index 805c786bc4..0a672161e9 100644 --- a/substrate/codec/src/lib.rs +++ b/substrate/codec/src/lib.rs @@ -20,6 +20,8 @@ #![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(not(feature = "std"), feature(alloc))] +extern crate substrate_runtime_std as rstd; + mod endiansensitive; mod slicable; mod joiner; @@ -29,12 +31,3 @@ pub use self::endiansensitive::EndianSensitive; pub use self::slicable::{Slicable, NonTrivialSlicable}; pub use self::joiner::Joiner; pub use self::keyedvec::KeyedVec; - -// TODO: move these into runtime-std and `extern crate runtime_std as std;` -#[cfg(not(feature = "std"))] -mod std { - extern crate alloc; - - pub use core::*; - pub use self::alloc::vec; -} diff --git a/substrate/codec/src/slicable.rs b/substrate/codec/src/slicable.rs index 6baa2ebaad..653bbb7b16 100644 --- a/substrate/codec/src/slicable.rs +++ b/substrate/codec/src/slicable.rs @@ -16,8 +16,8 @@ //! Serialisation. -use std::{mem, slice}; -use std::vec::Vec; +use rstd::{mem, slice}; +use rstd::vec::Vec; use super::joiner::Joiner; use super::endiansensitive::EndianSensitive; @@ -44,7 +44,7 @@ impl Slicable for T { let size = mem::size_of::(); assert!(size > 0, "EndianSensitive can never be implemented for a zero-sized type."); if value.len() >= size { - let x: T = unsafe { ::std::ptr::read(value.as_ptr() as *const T) }; + let x: T = unsafe { ::rstd::ptr::read(value.as_ptr() as *const T) }; *value = &value[size..]; Some(x.from_le()) } else { @@ -115,7 +115,7 @@ impl Slicable for Vec { } fn to_vec(&self) -> Vec { - use std::iter::Extend; + use rstd::iter::Extend; let len = self.len(); assert!(len <= u32::max_value() as usize, "Attempted to serialize vec with too many elements."); diff --git a/substrate/collator/src/lib.rs b/substrate/collator/src/lib.rs index da16e7520e..dfc617717f 100644 --- a/substrate/collator/src/lib.rs +++ b/substrate/collator/src/lib.rs @@ -60,7 +60,7 @@ pub trait ParachainContext { fn produce_candidate>( &self, ingress: I, - ) -> (parachain::BlockData, primitives::relay::Signature); + ) -> (parachain::BlockData, ::Signature); } /// Relay chain context needed to collate. diff --git a/substrate/executor/src/native_executor.rs b/substrate/executor/src/native_executor.rs index a89b436402..37a3a18999 100644 --- a/substrate/executor/src/native_executor.rs +++ b/substrate/executor/src/native_executor.rs @@ -63,7 +63,7 @@ mod tests { use native_runtime::runtime::staking::balance; use state_machine::TestExternalities; use primitives::twox_128; - use primitives::relay::{Hash, Header, BlockNumber, Block, Digest, Transaction, + use polkadot_primitives::{Hash, Header, BlockNumber, Block, Digest, Transaction, UncheckedTransaction, Function, AccountId}; use ed25519::Pair; diff --git a/substrate/executor/src/wasm_executor.rs b/substrate/executor/src/wasm_executor.rs index 76f9d851ff..e46991c2c3 100644 --- a/substrate/executor/src/wasm_executor.rs +++ b/substrate/executor/src/wasm_executor.rs @@ -293,7 +293,7 @@ mod tests { use native_runtime::runtime::staking::balance; use state_machine::TestExternalities; use primitives::twox_128; - use primitives::relay::{Header, Transaction, UncheckedTransaction, Function, AccountId}; + use polkadot_primitives::{Header, Transaction, UncheckedTransaction, Function, AccountId}; use runtime_io; use ed25519::Pair; diff --git a/substrate/network/Cargo.toml b/substrate/network/Cargo.toml index 6591ebf919..e1e8310d33 100644 --- a/substrate/network/Cargo.toml +++ b/substrate/network/Cargo.toml @@ -11,6 +11,7 @@ authors = ["Parity Technologies "] ethcore-network = { git = "https://github.com/paritytech/parity.git" } ethcore-io = { git = "https://github.com/paritytech/parity.git" } substrate-primitives = { path = "../primitives" } +polkadot-primitives = { path = "../polkadot-primitives" } polkadot-client = { path = "../client" } substrate-state-machine = { path = "../state-machine" } substrate-serializer = { path = "../serializer" } diff --git a/substrate/network/src/blocks.rs b/substrate/network/src/blocks.rs index e79aff2c65..5b9ca9f6a5 100644 --- a/substrate/network/src/blocks.rs +++ b/substrate/network/src/blocks.rs @@ -20,7 +20,7 @@ use std::ops::Range; use std::collections::{HashMap, BTreeMap}; use std::collections::hash_map::Entry; use network::PeerId; -use primitives::relay::BlockNumber; +use primitives::block::Number as BlockNumber; use message; const MAX_PARALLEL_DOWNLOADS: u32 = 1; @@ -190,7 +190,7 @@ impl BlockCollection { mod test { use super::{BlockCollection, BlockData}; use message; - use primitives::relay::{HeaderHash}; + use primitives::HeaderHash; fn is_empty(bc: &BlockCollection) -> bool { bc.blocks.is_empty() && @@ -260,4 +260,3 @@ mod test { assert_eq!(drained[40..], blocks[121..150].iter().map(|b| BlockData { block: b.clone(), origin: 1 }).collect::>()[..]); } } - diff --git a/substrate/network/src/chain.rs b/substrate/network/src/chain.rs index cd6ebb8563..9390b727ec 100644 --- a/substrate/network/src/chain.rs +++ b/substrate/network/src/chain.rs @@ -19,7 +19,7 @@ use client::{self, Client as PolkadotClient, ImportResult, ClientInfo, BlockStatus}; use client::error::Error; use state_machine; -use primitives::relay::block; +use primitives::block; pub trait Client : Send + Sync { /// Given a hash return a header @@ -55,5 +55,3 @@ impl Client for PolkadotClient where (self as &Client).block_hash(block_number) } } - - diff --git a/substrate/network/src/lib.rs b/substrate/network/src/lib.rs index f1bd64d63f..6feabb0b46 100644 --- a/substrate/network/src/lib.rs +++ b/substrate/network/src/lib.rs @@ -28,11 +28,14 @@ extern crate parking_lot; extern crate smallvec; extern crate ipnetwork; extern crate substrate_primitives as primitives; -extern crate polkadot_client as client; extern crate substrate_state_machine as state_machine; extern crate substrate_serializer as ser; extern crate serde; extern crate serde_json; +// TODO: remove these two; split off dependent logic into polkadot-network and rename this crate +// to substrate-network. +extern crate polkadot_primitives as polkadot_primitives; +extern crate polkadot_client as client; #[macro_use] extern crate serde_derive; #[macro_use] extern crate log; #[macro_use] extern crate bitflags; @@ -56,7 +59,6 @@ pub use protocol::{ProtocolStatus}; pub use network::{NonReservedPeerMode, ConnectionFilter, ConnectionDirection, NetworkConfiguration}; // TODO: move it elsewhere -fn header_hash(header: &primitives::relay::Header) -> primitives::relay::HeaderHash { +fn header_hash(header: &primitives::Header) -> primitives::block::HeaderHash { primitives::hashing::blake2_256(&ser::to_vec(header)).into() } - diff --git a/substrate/network/src/message.rs b/substrate/network/src/message.rs index e3dce5b0f2..feefb56595 100644 --- a/substrate/network/src/message.rs +++ b/substrate/network/src/message.rs @@ -17,9 +17,10 @@ //! Network packet message types. These get serialized and put into the lower level protocol payload. use std::borrow::Borrow; -use primitives::parachain::Id as ParachainId; -use primitives::relay::{AccountId, BlockNumber, HeaderHash, Header, Body}; +use primitives::AuthorityId; +use primitives::block::{Number as BlockNumber, HeaderHash, Header, Body}; use service::Role as RoleFlags; +use polkadot_primitives::parachain::Id as ParachainId; pub type RequestId = u64; type Bytes = Vec; @@ -149,7 +150,7 @@ pub struct Status { /// Signatue of `best_hash` made with validator address. Required for the validator role. pub validator_signature: Option, /// Validator address. Required for the validator role. - pub validator_id: Option, + pub validator_id: Option, /// Parachain id. Required for the collator role. pub parachain_id: Option, } diff --git a/substrate/network/src/protocol.rs b/substrate/network/src/protocol.rs index 3d5d14dbdd..bd9dd614fe 100644 --- a/substrate/network/src/protocol.rs +++ b/substrate/network/src/protocol.rs @@ -20,7 +20,7 @@ use std::sync::Arc; use parking_lot::RwLock; use serde_json; use std::time; -use primitives::relay::{HeaderHash, TransactionHash, BlockNumber, Header}; +use primitives::block::{HeaderHash, TransactionHash, Number as BlockNumber, Header}; use network::{PeerId, NodeId}; use message::{self, Message}; @@ -342,6 +342,3 @@ impl Protocol { &*self.chain } } - - - diff --git a/substrate/network/src/service.rs b/substrate/network/src/service.rs index 565f7f5249..e3832249db 100644 --- a/substrate/network/src/service.rs +++ b/substrate/network/src/service.rs @@ -19,7 +19,7 @@ use std::collections::{BTreeMap}; use std::io; use network::{NetworkProtocolHandler, NetworkService, NetworkContext, HostInfo, PeerId, ProtocolId, NetworkConfiguration , NonReservedPeerMode, ErrorKind}; -use primitives::relay::{TransactionHash, Header}; +use primitives::block::{TransactionHash, Header}; use core_io::{TimerToken}; use io::NetSyncIo; use protocol::{Protocol, ProtocolStatus, PeerInfo as ProtocolPeerInfo, TransactionStats}; diff --git a/substrate/network/src/sync.rs b/substrate/network/src/sync.rs index 6bed7ec6a2..e7d2847b83 100644 --- a/substrate/network/src/sync.rs +++ b/substrate/network/src/sync.rs @@ -19,7 +19,7 @@ use io::SyncIo; use protocol::Protocol; use network::PeerId; use client::{ImportResult, BlockStatus, ClientInfo}; -use primitives::relay::{HeaderHash, BlockNumber, Header}; +use primitives::block::{HeaderHash, Number as BlockNumber, Header}; use blocks::{self, BlockCollection}; use message::{self, Message}; use super::header_hash; @@ -366,7 +366,3 @@ impl ChainSync { protocol.send_message(io, peer_id, Message::BlockRequest(request)); } } - - - - diff --git a/substrate/polkadot-primitives/src/block.rs b/substrate/polkadot-primitives/src/block.rs index 2cfa7578e1..a5d76bf930 100644 --- a/substrate/polkadot-primitives/src/block.rs +++ b/substrate/polkadot-primitives/src/block.rs @@ -21,7 +21,6 @@ use primitives::bytes; use primitives::H256; use rstd::vec::Vec; use codec::Slicable; -use parachain; use transaction::UncheckedTransaction; /// Used to refer to a block number. @@ -161,24 +160,12 @@ impl Slicable for Header { } } -/// A relay chain block body. -/// -/// Included candidates should be sorted by parachain ID, and without duplicate -/// IDs. -#[derive(PartialEq, Eq, Clone)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize, Debug))] -#[cfg_attr(feature = "std", serde(rename_all = "camelCase"))] -#[cfg_attr(feature = "std", serde(deny_unknown_fields))] -pub struct Body { - /// Parachain proposal blocks. - pub candidates: Vec, -} - #[cfg(test)] mod tests { use super::*; use codec::Slicable; use substrate_serializer as ser; + use parachain; #[test] fn test_header_serialization() { diff --git a/substrate/primitives/src/block.rs b/substrate/primitives/src/block.rs index 057c3c9a56..4ac11f9c46 100644 --- a/substrate/primitives/src/block.rs +++ b/substrate/primitives/src/block.rs @@ -83,6 +83,9 @@ impl Slicable for Digest { } } +/// The body of a block is just a bunch of transactions. +pub type Body = Vec; + /// A Substrate relay chain block. #[derive(PartialEq, Eq, Clone)] #[cfg_attr(feature = "std", derive(Serialize, Deserialize, Debug))] @@ -90,7 +93,7 @@ pub struct Block { /// The block header. pub header: Header, /// All relay-chain transactions. - pub transactions: Vec, + pub transactions: Body, } impl Slicable for Block { diff --git a/substrate/rpc/src/chain/mod.rs b/substrate/rpc/src/chain/mod.rs index b69c2af8a0..519bdefb4a 100644 --- a/substrate/rpc/src/chain/mod.rs +++ b/substrate/rpc/src/chain/mod.rs @@ -16,7 +16,7 @@ //! Polkadot blockchain API. -use primitives::relay::block; +use primitives::block; use client; use state_machine; diff --git a/substrate/rpc/src/state/mod.rs b/substrate/rpc/src/state/mod.rs index dd5ba7d7cb..b21b859435 100644 --- a/substrate/rpc/src/state/mod.rs +++ b/substrate/rpc/src/state/mod.rs @@ -22,8 +22,8 @@ mod error; mod tests; use client::{self, Client}; -use primitives::relay::block; -use primitives::contract::{StorageKey, StorageData}; +use primitives::block; +use primitives::storage::{StorageKey, StorageData}; use state_machine; use self::error::Result; diff --git a/substrate/runtime-std/with_std.rs b/substrate/runtime-std/with_std.rs index 1d5b779a03..01212679fc 100644 --- a/substrate/runtime-std/with_std.rs +++ b/substrate/runtime-std/with_std.rs @@ -21,3 +21,5 @@ pub use std::boxed; pub use std::slice; pub use std::mem; pub use std::ops; +pub use std::iter; +pub use std::ptr; diff --git a/substrate/runtime-std/without_std.rs b/substrate/runtime-std/without_std.rs index 203ee02e82..ea0f278d37 100644 --- a/substrate/runtime-std/without_std.rs +++ b/substrate/runtime-std/without_std.rs @@ -24,3 +24,5 @@ pub use core::mem; pub use core::slice; pub use core::cell; pub use core::ops; +pub use core::iter; +pub use core::ptr; diff --git a/substrate/wasm-runtime/polkadot/src/runtime/governance.rs b/substrate/wasm-runtime/polkadot/src/runtime/governance.rs index 53c4369ffd..4b62d11a95 100644 --- a/substrate/wasm-runtime/polkadot/src/runtime/governance.rs +++ b/substrate/wasm-runtime/polkadot/src/runtime/governance.rs @@ -148,7 +148,7 @@ mod tests { use runtime_io::{with_externalities, twox_128, TestExternalities}; use codec::{KeyedVec, Joiner}; use support::{one, two, with_env}; - use primitives::relay::{AccountId, InternalFunction}; + use polkadot_primitives::{AccountId, Proposal}; use runtime::{staking, session}; fn new_test_ext() -> TestExternalities { diff --git a/substrate/wasm-runtime/polkadot/src/runtime/session.rs b/substrate/wasm-runtime/polkadot/src/runtime/session.rs index 302919ac2a..2e3f81b645 100644 --- a/substrate/wasm-runtime/polkadot/src/runtime/session.rs +++ b/substrate/wasm-runtime/polkadot/src/runtime/session.rs @@ -140,7 +140,7 @@ mod tests { use runtime_io::{with_externalities, twox_128, TestExternalities}; use codec::{KeyedVec, Joiner}; use support::{one, two, with_env}; - use primitives::relay::AccountId; + use polkadot_primitives::AccountId; use runtime::{consensus, session}; fn simple_setup() -> TestExternalities { diff --git a/substrate/wasm-runtime/polkadot/src/runtime/staking.rs b/substrate/wasm-runtime/polkadot/src/runtime/staking.rs index 356d778733..d6d4065dc9 100644 --- a/substrate/wasm-runtime/polkadot/src/runtime/staking.rs +++ b/substrate/wasm-runtime/polkadot/src/runtime/staking.rs @@ -216,7 +216,7 @@ mod tests { use runtime_io::{with_externalities, twox_128, TestExternalities}; use codec::{KeyedVec, Joiner}; use support::{one, two, with_env}; - use primitives::relay::AccountId; + use polkadot_primitives::AccountId; use runtime::{staking, session}; #[test] diff --git a/substrate/wasm-runtime/polkadot/src/runtime/system.rs b/substrate/wasm-runtime/polkadot/src/runtime/system.rs index aa66c47152..269a9bc31e 100644 --- a/substrate/wasm-runtime/polkadot/src/runtime/system.rs +++ b/substrate/wasm-runtime/polkadot/src/runtime/system.rs @@ -221,7 +221,7 @@ mod tests { use runtime_io::{with_externalities, twox_128, TestExternalities}; use codec::{Joiner, KeyedVec, Slicable}; use support::{StaticHexInto, HexDisplay, one, two}; - use primitives::relay::{Header, Digest, UncheckedTransaction, Transaction, Function}; + use polkadot_primitives::{Header, Digest, UncheckedTransaction, Transaction, Function}; use runtime::staking; #[test] diff --git a/substrate/wasm-runtime/polkadot/src/support/storage.rs b/substrate/wasm-runtime/polkadot/src/support/storage.rs index e46d48cf1a..3332b7b4cd 100644 --- a/substrate/wasm-runtime/polkadot/src/support/storage.rs +++ b/substrate/wasm-runtime/polkadot/src/support/storage.rs @@ -338,7 +338,7 @@ mod tests { #[test] fn proposals_can_be_stored() { - use primitives::relay::{Proposal, InternalFunction}; + use polkadot_primitives::{Proposal, InternalFunction}; let mut t = TestExternalities { storage: HashMap::new(), }; with_externalities(&mut t, || { let x = Proposal { From 89d8686883a8dd90706044e9028a2fb41b63cb40 Mon Sep 17 00:00:00 2001 From: Gav Date: Wed, 7 Feb 2018 16:09:37 +0100 Subject: [PATCH 12/15] Half of tests fixed. --- substrate/polkadot-primitives/src/block.rs | 31 +++------------- .../polkadot-primitives/src/transaction.rs | 14 +++++--- substrate/wasm-runtime/polkadot/src/lib.rs | 1 - .../polkadot/src/runtime/governance.rs | 36 +++++-------------- .../polkadot/src/support/storage.rs | 6 ++-- 5 files changed, 26 insertions(+), 62 deletions(-) diff --git a/substrate/polkadot-primitives/src/block.rs b/substrate/polkadot-primitives/src/block.rs index a5d76bf930..3b5691011f 100644 --- a/substrate/polkadot-primitives/src/block.rs +++ b/substrate/polkadot-primitives/src/block.rs @@ -67,6 +67,9 @@ impl Slicable for Digest { } } +/// The block "body": A bunch of transactions. +pub type Body = Vec; + /// A Polkadot relay chain block. #[derive(PartialEq, Eq, Clone)] #[cfg_attr(feature = "std", derive(Serialize, Deserialize, Debug))] @@ -74,7 +77,7 @@ pub struct Block { /// The block header. pub header: Header, /// All relay-chain transactions. - pub transactions: Vec, + pub transactions: Body, } impl Slicable for Block { @@ -165,7 +168,7 @@ mod tests { use super::*; use codec::Slicable; use substrate_serializer as ser; - use parachain; + use primitives::hexdisplay::HexDisplay; #[test] fn test_header_serialization() { @@ -192,28 +195,4 @@ mod tests { let v = header.to_vec(); assert_eq!(Header::from_slice(&mut &v[..]).unwrap(), header); } - - #[test] - fn test_body_serialization() { - assert_eq!(ser::to_string_pretty(&Body { - candidates: vec![ - parachain::Candidate { - parachain_index: 10.into(), - collator_signature: Default::default(), - unprocessed_ingress: Default::default(), - block: ::parachain::BlockData(vec![1, 3, 5, 8]), - } - ], - }), r#"{ - "candidates": [ - { - "parachainIndex": 10, - "collatorSignature": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "unprocessedIngress": [], - "block": "0x01030508" - } - ] -}"#); - } - } diff --git a/substrate/polkadot-primitives/src/transaction.rs b/substrate/polkadot-primitives/src/transaction.rs index a711b58bec..4cdd9cd691 100644 --- a/substrate/polkadot-primitives/src/transaction.rs +++ b/substrate/polkadot-primitives/src/transaction.rs @@ -290,8 +290,6 @@ impl Slicable for Transaction { // with substrate's generic `Vec` type. Basically this just means accepting that there // will be a prefix of u32, which has the total number of bytes following (we don't need // to use this). - let _length_do_not_remove_me_see_above: u32 = try_opt!(Slicable::from_slice(value)); - Some(Transaction { signed: try_opt!(Slicable::from_slice(value)), nonce: try_opt!(Slicable::from_slice(value)), @@ -380,9 +378,10 @@ impl fmt::Debug for UncheckedTransaction { #[cfg(test)] mod tests { - use ::codec::Slicable; - use primitives; use super::*; + use primitives; + use ::codec::Slicable; + use primitives::hexdisplay::HexDisplay; #[test] fn serialize_unchecked() { @@ -394,8 +393,15 @@ mod tests { }, signature: primitives::hash::H512([0; 64]), }; + // 71000000 + // 0101010101010101010101010101010101010101010101010101010101010101 + // e703000000000000 + // 00 + // df0f0200 + // 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 let v = Slicable::to_vec(&tx); + println!("{}", HexDisplay::from(&v)); assert_eq!(UncheckedTransaction::from_slice(&mut &v[..]).unwrap(), tx); } } diff --git a/substrate/wasm-runtime/polkadot/src/lib.rs b/substrate/wasm-runtime/polkadot/src/lib.rs index e277c23f14..6c92c8aa13 100644 --- a/substrate/wasm-runtime/polkadot/src/lib.rs +++ b/substrate/wasm-runtime/polkadot/src/lib.rs @@ -18,7 +18,6 @@ #![cfg_attr(not(feature = "std"), no_std)] -#[macro_use] extern crate substrate_runtime_std as rstd; #[macro_use] diff --git a/substrate/wasm-runtime/polkadot/src/runtime/governance.rs b/substrate/wasm-runtime/polkadot/src/runtime/governance.rs index 4b62d11a95..a7d2baf677 100644 --- a/substrate/wasm-runtime/polkadot/src/runtime/governance.rs +++ b/substrate/wasm-runtime/polkadot/src/runtime/governance.rs @@ -189,9 +189,7 @@ mod tests { // Block 1: Make proposal. Approve it. Era length changes. with_env(|e| e.block_number = 1); - public::propose(&one, &Proposal { - function: Proposal::StakingSetSessionsPerEra(2), - }); + public::propose(&one, &Proposal::StakingSetSessionsPerEra(2)); public::approve(&two, 1); staking::internal::check_new_era(); assert_eq!(staking::era_length(), 2); @@ -214,17 +212,13 @@ mod tests { // Block 1: Make proposal. Fail it. with_env(|e| e.block_number = 1); - public::propose(&one, &Proposal { - function: Proposal::StakingSetSessionsPerEra(2), - }); + public::propose(&one, &Proposal::StakingSetSessionsPerEra(2)); staking::internal::check_new_era(); assert_eq!(staking::era_length(), 1); // Block 2: Make proposal. Approve it. It should change era length. with_env(|e| e.block_number = 2); - public::propose(&one, &Proposal { - function: Proposal::StakingSetSessionsPerEra(2), - }); + public::propose(&one, &Proposal::StakingSetSessionsPerEra(2)); public::approve(&two, 2); staking::internal::check_new_era(); assert_eq!(staking::era_length(), 2); @@ -247,9 +241,7 @@ mod tests { // Block 1: Make proposal. Will have only 1 vote. No change. with_env(|e| e.block_number = 1); - public::propose(&one, &Proposal { - function: Proposal::StakingSetSessionsPerEra(2), - }); + public::propose(&one, &Proposal::StakingSetSessionsPerEra(2)); staking::internal::check_new_era(); assert_eq!(staking::era_length(), 1); }); @@ -272,9 +264,7 @@ mod tests { // Block 1: Make proposal. Will have only 1 vote. No change. with_env(|e| e.block_number = 1); - public::propose(&one, &Proposal { - function: Proposal::StakingSetSessionsPerEra(2), - }); + public::propose(&one, &Proposal::StakingSetSessionsPerEra(2)); public::approve(&two, 0); staking::internal::check_new_era(); assert_eq!(staking::era_length(), 1); @@ -298,9 +288,7 @@ mod tests { // Block 1: Make proposal. Will have only 1 vote. No change. with_env(|e| e.block_number = 1); - public::propose(&one, &Proposal { - function: Proposal::StakingSetSessionsPerEra(2), - }); + public::propose(&one, &Proposal::StakingSetSessionsPerEra(2)); public::approve(&two, 1); public::approve(&two, 1); staking::internal::check_new_era(); @@ -325,12 +313,8 @@ mod tests { // Block 1: Make proposal. Will have only 1 vote. No change. with_env(|e| e.block_number = 1); - public::propose(&one, &Proposal { - function: Proposal::StakingSetSessionsPerEra(2), - }); - public::propose(&two, &Proposal { - function: Proposal::StakingSetSessionsPerEra(2), - }); + public::propose(&one, &Proposal::StakingSetSessionsPerEra(2)); + public::propose(&two, &Proposal::StakingSetSessionsPerEra(2)); staking::internal::check_new_era(); assert_eq!(staking::era_length(), 1); }); @@ -377,9 +361,7 @@ mod tests { // Block 1: Make proposal. Will have only 1 vote. No change. with_env(|e| e.block_number = 1); - public::propose(&one, &Proposal { - function: Proposal::StakingSetSessionsPerEra(2), - }); + public::propose(&one, &Proposal::StakingSetSessionsPerEra(2)); public::approve(&four, 1); staking::internal::check_new_era(); assert_eq!(staking::era_length(), 1); diff --git a/substrate/wasm-runtime/polkadot/src/support/storage.rs b/substrate/wasm-runtime/polkadot/src/support/storage.rs index 3332b7b4cd..5878113b13 100644 --- a/substrate/wasm-runtime/polkadot/src/support/storage.rs +++ b/substrate/wasm-runtime/polkadot/src/support/storage.rs @@ -338,12 +338,10 @@ mod tests { #[test] fn proposals_can_be_stored() { - use polkadot_primitives::{Proposal, InternalFunction}; + use polkadot_primitives::Proposal; let mut t = TestExternalities { storage: HashMap::new(), }; with_externalities(&mut t, || { - let x = Proposal { - function: InternalFunction::StakingSetSessionsPerEra(25519), - }; + let x = Proposal::StakingSetSessionsPerEra(25519); put(b":test", &x); let y: Proposal = get(b":test").unwrap(); assert_eq!(x, y); From 4f15a6d4883c66765412c0ea0b3882c2e5efef13 Mon Sep 17 00:00:00 2001 From: Gav Date: Wed, 7 Feb 2018 16:18:20 +0100 Subject: [PATCH 13/15] More tests fixed. --- substrate/Cargo.lock | 1 + substrate/collator/Cargo.toml | 1 + substrate/collator/src/lib.rs | 7 ++++--- substrate/polkadot-primitives/src/block.rs | 1 - substrate/polkadot-primitives/src/transaction.rs | 4 ---- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/substrate/Cargo.lock b/substrate/Cargo.lock index eadfdd27c4..1e31aea13e 100644 --- a/substrate/Cargo.lock +++ b/substrate/Cargo.lock @@ -1019,6 +1019,7 @@ name = "polkadot-collator" version = "0.1.0" dependencies = [ "futures 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", + "polkadot-primitives 0.1.0", "substrate-primitives 0.1.0", ] diff --git a/substrate/collator/Cargo.toml b/substrate/collator/Cargo.toml index 1f612ca85a..e4a91cab66 100644 --- a/substrate/collator/Cargo.toml +++ b/substrate/collator/Cargo.toml @@ -6,4 +6,5 @@ description = "Abstract collation logic" [dependencies] substrate-primitives = { path = "../primitives", version = "0.1" } +polkadot-primitives = { path = "../polkadot-primitives", version = "0.1" } futures = "0.1.17" diff --git a/substrate/collator/src/lib.rs b/substrate/collator/src/lib.rs index dfc617717f..b520b269fc 100644 --- a/substrate/collator/src/lib.rs +++ b/substrate/collator/src/lib.rs @@ -46,11 +46,12 @@ extern crate futures; extern crate substrate_primitives as primitives; +extern crate polkadot_primitives; use std::collections::{BTreeSet, BTreeMap}; use futures::{stream, Stream, Future, IntoFuture}; -use primitives::parachain::{self, ConsolidatedIngress, Message, Id as ParaId}; +use polkadot_primitives::parachain::{self, ConsolidatedIngress, Message, Id as ParaId}; /// Parachain context needed for collation. /// @@ -60,7 +61,7 @@ pub trait ParachainContext { fn produce_candidate>( &self, ingress: I, - ) -> (parachain::BlockData, ::Signature); + ) -> (parachain::BlockData, polkadot_primitives::Signature); } /// Relay chain context needed to collate. @@ -150,7 +151,7 @@ mod tests { use std::collections::{HashMap, BTreeSet}; use futures::Future; - use primitives::parachain::{Message, Id as ParaId}; + use polkadot_primitives::parachain::{Message, Id as ParaId}; pub struct DummyRelayChainCtx { egresses: HashMap>>, diff --git a/substrate/polkadot-primitives/src/block.rs b/substrate/polkadot-primitives/src/block.rs index 3b5691011f..5ebe53007f 100644 --- a/substrate/polkadot-primitives/src/block.rs +++ b/substrate/polkadot-primitives/src/block.rs @@ -168,7 +168,6 @@ mod tests { use super::*; use codec::Slicable; use substrate_serializer as ser; - use primitives::hexdisplay::HexDisplay; #[test] fn test_header_serialization() { diff --git a/substrate/polkadot-primitives/src/transaction.rs b/substrate/polkadot-primitives/src/transaction.rs index 4cdd9cd691..062d8c563d 100644 --- a/substrate/polkadot-primitives/src/transaction.rs +++ b/substrate/polkadot-primitives/src/transaction.rs @@ -286,10 +286,6 @@ pub struct Transaction { impl Slicable for Transaction { fn from_slice(value: &mut &[u8]) -> Option { - // This is a little more complicated than usua since the binary format must be compatible - // with substrate's generic `Vec` type. Basically this just means accepting that there - // will be a prefix of u32, which has the total number of bytes following (we don't need - // to use this). Some(Transaction { signed: try_opt!(Slicable::from_slice(value)), nonce: try_opt!(Slicable::from_slice(value)), From ef059b81f178fb2692de7c9009e89299273ee5c4 Mon Sep 17 00:00:00 2001 From: Gav Date: Wed, 7 Feb 2018 16:34:18 +0100 Subject: [PATCH 14/15] All tests compile. Most tests work. --- substrate/Cargo.lock | 2 ++ substrate/client/src/genesis.rs | 2 +- substrate/executor/Cargo.toml | 4 +++- substrate/executor/src/lib.rs | 5 ++++- substrate/network/src/blocks.rs | 2 +- substrate/validator/Cargo.toml | 1 + substrate/validator/src/lib.rs | 1 + substrate/validator/src/parachains.rs | 2 +- substrate/validator/src/validator.rs | 3 +-- 9 files changed, 15 insertions(+), 7 deletions(-) diff --git a/substrate/Cargo.lock b/substrate/Cargo.lock index 1e31aea13e..8f333b159e 100644 --- a/substrate/Cargo.lock +++ b/substrate/Cargo.lock @@ -1090,6 +1090,7 @@ name = "polkadot-validator" version = "0.1.0" dependencies = [ "error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "polkadot-primitives 0.1.0", "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", "substrate-primitives 0.1.0", "substrate-serializer 0.1.0", @@ -1431,6 +1432,7 @@ dependencies = [ "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "native-runtime 0.1.0", "parity-wasm 0.15.4 (registry+https://github.com/rust-lang/crates.io-index)", + "polkadot-primitives 0.1.0", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/substrate/client/src/genesis.rs b/substrate/client/src/genesis.rs index 5a48f947dd..788513ffa6 100644 --- a/substrate/client/src/genesis.rs +++ b/substrate/client/src/genesis.rs @@ -17,7 +17,7 @@ //! Tool for creating the genesis block. use std::collections::HashMap; -use primitives::{Block, Header}; +use polkadot_primitives::{Block, Header}; use triehash::trie_root; /// Create a genesis block, given the initial storage. diff --git a/substrate/executor/Cargo.toml b/substrate/executor/Cargo.toml index 577b237240..8d2643d585 100644 --- a/substrate/executor/Cargo.toml +++ b/substrate/executor/Cargo.toml @@ -10,7 +10,6 @@ substrate-runtime-io = { path = "../runtime-io" } substrate-primitives = { path = "../primitives" } substrate-serializer = { path = "../serializer" } substrate-state-machine = { path = "../state-machine" } -native-runtime = { path = "../native-runtime" } ed25519 = { path = "../ed25519" } serde = "1.0" serde_derive = "1.0" @@ -20,6 +19,9 @@ rustc-hex = "1.0.0" triehash = "0.1.0" hex-literal = "0.1.0" log = "0.3" +# TODO: Remove these and split out tests and a concrete executor. +native-runtime = { path = "../native-runtime" } +polkadot-primitives = { path = "../polkadot-primitives" } [dev-dependencies] assert_matches = "1.1" diff --git a/substrate/executor/src/lib.rs b/substrate/executor/src/lib.rs index e324bdf111..88c52c9389 100644 --- a/substrate/executor/src/lib.rs +++ b/substrate/executor/src/lib.rs @@ -38,10 +38,13 @@ extern crate serde; extern crate parity_wasm; extern crate byteorder; extern crate rustc_hex; -extern crate native_runtime; extern crate triehash; #[macro_use] extern crate log; +// TODO: Remove and split out into polkadot-specific crate. +extern crate native_runtime; +extern crate polkadot_primitives; + #[cfg(test)] #[macro_use] extern crate hex_literal; diff --git a/substrate/network/src/blocks.rs b/substrate/network/src/blocks.rs index 5b9ca9f6a5..8d0118222b 100644 --- a/substrate/network/src/blocks.rs +++ b/substrate/network/src/blocks.rs @@ -190,7 +190,7 @@ impl BlockCollection { mod test { use super::{BlockCollection, BlockData}; use message; - use primitives::HeaderHash; + use primitives::block::HeaderHash; fn is_empty(bc: &BlockCollection) -> bool { bc.blocks.is_empty() && diff --git a/substrate/validator/Cargo.toml b/substrate/validator/Cargo.toml index 64bb00118a..a95f6798ae 100644 --- a/substrate/validator/Cargo.toml +++ b/substrate/validator/Cargo.toml @@ -6,5 +6,6 @@ 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/substrate/validator/src/lib.rs b/substrate/validator/src/lib.rs index 44192f9327..dc139e77d5 100644 --- a/substrate/validator/src/lib.rs +++ b/substrate/validator/src/lib.rs @@ -20,6 +20,7 @@ extern crate substrate_primitives as primitives; extern crate substrate_serializer as serializer; +extern crate polkadot_primitives; extern crate serde; #[macro_use] diff --git a/substrate/validator/src/parachains.rs b/substrate/validator/src/parachains.rs index 5adfe704c7..67ba56ed1f 100644 --- a/substrate/validator/src/parachains.rs +++ b/substrate/validator/src/parachains.rs @@ -16,7 +16,7 @@ use std::fmt; -use primitives::validator; +use polkadot_primitives::validator; use serde::de::DeserializeOwned; use error::Result; diff --git a/substrate/validator/src/validator.rs b/substrate/validator/src/validator.rs index c251e37918..354bbf73dc 100644 --- a/substrate/validator/src/validator.rs +++ b/substrate/validator/src/validator.rs @@ -16,7 +16,7 @@ use std::fmt; -use primitives::{validator, parachain}; +use polkadot_primitives::{validator, parachain}; use serde::de::DeserializeOwned; use serializer; @@ -99,4 +99,3 @@ impl Code for T where Ok(self.check(messages, downloads, block_data, head_data)?.into()) } } - From d494d4b89b51301ba2c99b18aa087720a08201d2 Mon Sep 17 00:00:00 2001 From: Gav Date: Wed, 7 Feb 2018 17:07:55 +0100 Subject: [PATCH 15/15] Fix everything. --- substrate/executor/src/native_executor.rs | 2 +- substrate/primitives/Cargo.toml | 2 +- substrate/runtime-io/Cargo.toml | 2 +- substrate/wasm-runtime/polkadot/src/lib.rs | 3 --- .../polkadot/src/runtime/system.rs | 6 +++--- .../release/runtime_polkadot.compact.wasm | Bin 69574 -> 69694 bytes .../release/runtime_polkadot.wasm | Bin 69653 -> 69773 bytes .../release/runtime_test.compact.wasm | Bin 14104 -> 14104 bytes .../release/runtime_test.wasm | Bin 14229 -> 14229 bytes 9 files changed, 6 insertions(+), 9 deletions(-) diff --git a/substrate/executor/src/native_executor.rs b/substrate/executor/src/native_executor.rs index 37a3a18999..e4812be894 100644 --- a/substrate/executor/src/native_executor.rs +++ b/substrate/executor/src/native_executor.rs @@ -213,7 +213,7 @@ mod tests { construct_block( 2, block1().1, - hex!("e2ba57cfb94b870ea6670b012b49dc33cbb70e3aa8d36cf54dfa5e4e69cd0778").into(), + hex!("1feb4d3a2e587079e6ce1685fa79994efd995e33cb289d39cded67aac1bb46a9").into(), vec![ Transaction { signed: two(), diff --git a/substrate/primitives/Cargo.toml b/substrate/primitives/Cargo.toml index 359d76c81b..89bc334766 100644 --- a/substrate/primitives/Cargo.toml +++ b/substrate/primitives/Cargo.toml @@ -11,7 +11,7 @@ fixed-hash = { git = "https://github.com/rphmeier/primitives.git", branch = "com rustc-hex = { git = "https://github.com/rphmeier/rustc-hex.git", version = "2.0", default_features = false } serde = { version = "1.0", default_features = false } serde_derive = { version = "1.0", optional = true } -uint = { git = "https://github.com/rphmeier/primitives.git", branch = "compile-for-wasm" } +uint = { git = "https://github.com/rphmeier/primitives.git", branch = "compile-for-wasm", default_features = false } twox-hash = { version = "1.1.0", optional = true } byteorder = { version = "1.1", default_features = false } blake2-rfc = { version = "0.2.18", optional = true } diff --git a/substrate/runtime-io/Cargo.toml b/substrate/runtime-io/Cargo.toml index e975b063a6..823ecd00b6 100644 --- a/substrate/runtime-io/Cargo.toml +++ b/substrate/runtime-io/Cargo.toml @@ -10,7 +10,7 @@ rustc_version = "0.2" [dependencies] pwasm-alloc = { path = "../wasm-runtime/pwasm-alloc" } pwasm-libc = { path = "../wasm-runtime/pwasm-libc" } -substrate-runtime-std = { path = "../runtime-std" } +substrate-runtime-std = { path = "../runtime-std", default_features = false } environmental = { path = "../environmental", optional = true } substrate-state-machine = { path = "../state-machine", optional = true } substrate-primitives = { path = "../primitives", default_features = false } diff --git a/substrate/wasm-runtime/polkadot/src/lib.rs b/substrate/wasm-runtime/polkadot/src/lib.rs index 6c92c8aa13..72e2d23c50 100644 --- a/substrate/wasm-runtime/polkadot/src/lib.rs +++ b/substrate/wasm-runtime/polkadot/src/lib.rs @@ -25,9 +25,6 @@ extern crate substrate_runtime_io as runtime_io; #[cfg(feature = "std")] extern crate rustc_hex; -#[cfg(feature = "with-std")] -#[macro_use] -extern crate log; extern crate substrate_codec as codec; extern crate substrate_primitives; diff --git a/substrate/wasm-runtime/polkadot/src/runtime/system.rs b/substrate/wasm-runtime/polkadot/src/runtime/system.rs index 269a9bc31e..6eb6229470 100644 --- a/substrate/wasm-runtime/polkadot/src/runtime/system.rs +++ b/substrate/wasm-runtime/polkadot/src/runtime/system.rs @@ -202,15 +202,15 @@ fn post_finalise(header: &Header) { storage::put(&header.number.to_keyed_vec(BLOCK_HASH_AT), &header.blake2_256()); } -#[cfg(feature = "with-std")] +#[cfg(feature = "std")] fn info_expect_equal_hash(given: &Hash, expected: &Hash) { use support::HexDisplay; if given != expected { - info!("Hash: given={}, expected={}", HexDisplay::from(given), HexDisplay::from(expected)); + println!("Hash: given={}, expected={}", HexDisplay::from(&given.0), HexDisplay::from(&expected.0)); } } -#[cfg(not(feature = "with-std"))] +#[cfg(not(feature = "std"))] fn info_expect_equal_hash(_given: &Hash, _expected: &Hash) {} #[cfg(test)] diff --git a/substrate/wasm-runtime/target/wasm32-unknown-unknown/release/runtime_polkadot.compact.wasm b/substrate/wasm-runtime/target/wasm32-unknown-unknown/release/runtime_polkadot.compact.wasm index ce296a5814d474f42ad7dd50b99647b9088f7a7f..2af0747ed14a3cce4aeeb3d75f53c6f23259b555 100644 GIT binary patch delta 5853 zcmai24{#LMdEfVT?{@F@PPdZoB%#0WRv2_T2_Ym-LLgf!B!q%+z)9RXwgbYbwGJ6M zk^+v6IqcdFapMW_h^28w47Ovpg(R|<5F9%$v1uRd+&X3fBdxa+EHcdG->yEs4x9fs80zfRFYH=Aw(j?rx1c! zkIxtMdnon!eR=o={2@Z~@(9qB|DM#7a$ZdbLT~?@-1#D*a*FJw9Y!}Fr{5x7yj|`j zVZKj(5ziG$V_7i^)zDcvN?FJ{Pm@d*@CULf8DV>`GDPX=xP8@IPUuve`?W97X_F_l zpQeWvd#7)l&Q!{!^9PsI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$@UBs zFg9Ry+MQUj>w-SKU8>lkdsytgHPV)#WUSVWwa(JlZ&1Q7rd$_Hd0iJA;NO0;YW+Il z8tURtrE^1_7!0v+OwM6SJ&0Dwp7Xl+1BKqmp5rrbE`>4V%^B3V?Gm3xm4ujZB?<|4S>rUT5Ht~I@ zJK*f^ogPF|nY`h>!y;&t?=|Bb_}>49^29`f9!xpO37ul(jb}Reo{y4rB*h>9sIK~8 zLx#rC7^C<`n1qQBcSb$Nkp@2TQG;^6!Dw@O&phcx`d*k^Dw3Q1WCtBSqfkFud~|pc z`X-z0vH}^Zpumt_mdAdI++uq1RMGGl*71j!=KjMwcNFFIRk{J^$9rT=V4oFS!ybIe z@&t)3vEWP0Q;q$@8*#OG46miF3(CxE`ot3%d2nM}UeN-{;#J~h0U)x##Ity`pOv!WNh@K&jtRs>2_hm8ACw>rfxyjD z+%g;xm{TPfpFrS>DU#sbPwZ7i7(izMAmTa>vH&i8U#YIJMlI2m1v{W$z;>nkvPQKq z!7ycP99CUC?02nnnRs(1t9V!oCZG@op@AOaV^cvu8dbQ^k33747MCi(3^)rxQjL`{obhAdHo@vldIF~NU!CiZMyKd_3?~?2fOx-sG=(e2#I&12xfQI(; zN%-w52lNg0O7?Uf=7R4$e+stI|p{WKBJLtxqBp~8@>I5eZ4#G zU^nd^9Nc|d-ww$>n9>#D2g!ahrN_o2l9UE8i?Igd3H-rxSRGG|z850RbT&15F+{Az zBMrK7Fe;WLNsRC(s17#hJ^X_&dWI$YJP7tz D)7;KR diff --git a/substrate/wasm-runtime/target/wasm32-unknown-unknown/release/runtime_polkadot.wasm b/substrate/wasm-runtime/target/wasm32-unknown-unknown/release/runtime_polkadot.wasm index a6831997d4080456b4afa7bd7478586393e926bc..f89b2a1d9b257ba275d889fa3ab6fdd2bbc142e3 100644 GIT binary patch delta 5843 zcmai24R9RAm7eaI-I?9ll}6I8{(pMM!q#df*+#NtNw%f&k0hVviwpz;MI{!XRJ;}nOL%i5Zre*L=NPk;UTy?Oem@||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|2FJ!;J@t7mr_55(Du|{lmL<0++xsx*2E2{hdwzgJxh8JN&Zg3J_GB zz{|{44*roXxI|pK+w|TLkeS<1#giB{O}vr4hR>2l3{CD}e$h&xlN9d?|0dERV}M5J zMp4hv7fPmEbVRbiyO|$=Bp~4=9_bgPr0C!9>~dSB0x+8cC=!6Tasavj;L((28Sx9q z*&K)}0JvtdBzWf&YeRO8MQdh3#Kjw6e%$(MuCB1glcOsOv_L<<#v$_cH}rFDW4l8w5Lc z5u#nfig$5)f(TN4;tAo8(Vcj_O3cTcw#aAslZNORuz`kXiOa{`8IW-OOH37Mfv5?Y z5<`oGh6uVdaj^t7E2lPzUqX23y~b3gkvY5ny&h`UU*ZKL7Zd26eEK>ZQ)fz?=|Tb; zq^6^_AV^JT6QV_Q2%Kq_AVd2~Eo#Zfp{&R#)+|UYUP7g*Sf0s(dKF|KE3Gc*)4t-OEKLs&=00XLo3yxlF+IFAEEP-R^t=T zc}elel=;6Xch>wZj}_dUaRwV&MPBXPN7Jf`X0eS=jeS*OyA{oPocjccVBu}vGqvtmh#VthsNNs`;y?_zwSK_eSUVq!oer4v8O zBihJxLh}soxm$QwvStz~SNGpHjG)dYG<_OUR)YCu{Ko?rR$a`2eiwiS2f6@gLkWIn zz^V=A3mysSy##H~LdR>h(gny3gCwDY30{`Y5lIR-Os{|`v+ZMGia5~eT5Tm?eEuX<;Iv6N8LT+^mx_I#tKpu2lXHx`osq diff --git a/substrate/wasm-runtime/target/wasm32-unknown-unknown/release/runtime_test.compact.wasm b/substrate/wasm-runtime/target/wasm32-unknown-unknown/release/runtime_test.compact.wasm index d317445bea0143b128ddea96aee60d806355e374..3c4e94098f7841c66b1de54593cf9747b823cfbb 100644 GIT binary patch delta 166 zcmbP{HzRMuY8J)^lh?4c0!bs*e#Qrz53y=70jam_tHn7MNDD|Xa67h4ULdauRB%lG zH;_D}5CxQ%Rb0jh!{*N#H+g*~NOMbU;ALPCWME*p0HlS1 z^eH9=22LQ&;J87WTQE7XATc?!q*5WjEVU>tC%>G*@q#qBa871YVopwevVKuwd3;%F IvR+X!0E~k+UH||9 diff --git a/substrate/wasm-runtime/target/wasm32-unknown-unknown/release/runtime_test.wasm b/substrate/wasm-runtime/target/wasm32-unknown-unknown/release/runtime_test.wasm index 0c77df8679b873892803739ec24f2e49f545077e..6a79823c536ce4669af6e06271c92dcef34806b4 100644 GIT binary patch delta 148 zcmbQ5KQ(`Y1}o!($(pRKKyp26KjVYV_H0^AKq`x4wK&HDX#qI~ZpW6%vI?p|1)l delta 148 zcmbQ5KQ(`Y1}o!)$(pRKKyp26KjVbW_H0^AKq`x4wK&HHX#qI~ZpR6eWffF`3Y-;w z14(|k_dCewBb4zUCWnd6wU|_faq=kX> pDJBL6P9V+TxIvm*FgdXxF*&oOQX#)AwJ0qoznsDG!sL2$F#x6rEf4?z