From 4f15a6d4883c66765412c0ea0b3882c2e5efef13 Mon Sep 17 00:00:00 2001 From: Gav Date: Wed, 7 Feb 2018 16:18:20 +0100 Subject: [PATCH] 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)),