diff --git a/polkadot/api/src/full.rs b/polkadot/api/src/full.rs index 5358e1bd3a..7ccffecd1d 100644 --- a/polkadot/api/src/full.rs +++ b/polkadot/api/src/full.rs @@ -30,6 +30,7 @@ use primitives::{ SessionKey, Timestamp, UncheckedExtrinsic, }; use primitives::parachain::{DutyRoster, Id as ParaId}; +use substrate_primitives::{KeccakHasher, RlpCodec}; use {BlockBuilder, PolkadotApi, LocalPolkadotApi, ErrorKind, Error, Result}; @@ -60,7 +61,7 @@ macro_rules! with_runtime { }} } -impl> BlockBuilder for ClientBlockBuilder>, Block> { +impl> BlockBuilder for ClientBlockBuilder>, Block, KeccakHasher, RlpCodec> { fn push_extrinsic(&mut self, extrinsic: UncheckedExtrinsic) -> Result<()> { self.push(extrinsic).map_err(Into::into) } @@ -71,8 +72,8 @@ impl> BlockBuilder for ClientBlockBuilder> PolkadotApi for Client>, Block> { - type BlockBuilder = ClientBlockBuilder>, Block>; +impl> PolkadotApi for Client>, Block> { + type BlockBuilder = ClientBlockBuilder>, Block, KeccakHasher, RlpCodec>; fn session_keys(&self, at: &BlockId) -> Result> { with_runtime!(self, at, ::runtime::Consensus::authorities) @@ -158,7 +159,7 @@ impl> PolkadotApi for Client> LocalPolkadotApi for Client>, Block> +impl> LocalPolkadotApi for Client>, Block> {} #[cfg(test)] @@ -184,7 +185,7 @@ mod tests { ] } - fn client() -> Client, LocalCallExecutor, NativeExecutor>, Block> { + fn client() -> Client, LocalCallExecutor, NativeExecutor>, Block> { let genesis_config = GenesisConfig { consensus: Some(ConsensusConfig { code: LocalDispatch::native_equivalent().to_vec(), diff --git a/polkadot/api/src/light.rs b/polkadot/api/src/light.rs index a281cde6e3..7a3a357db9 100644 --- a/polkadot/api/src/light.rs +++ b/polkadot/api/src/light.rs @@ -27,6 +27,7 @@ use primitives::{ use runtime::Address; use primitives::parachain::{DutyRoster, Id as ParaId}; use {PolkadotApi, BlockBuilder, RemotePolkadotApi, Result, ErrorKind}; +use substrate_primitives::{KeccakHasher, RlpCodec}; /// Light block builder. TODO: make this work (efficiently) #[derive(Clone, Copy)] @@ -43,9 +44,9 @@ impl BlockBuilder for LightBlockBuilder { } /// Remote polkadot API implementation. -pub struct RemotePolkadotApiWrapper, E: CallExecutor>(pub Arc>); +pub struct RemotePolkadotApiWrapper, E: CallExecutor>(pub Arc>); -impl, E: CallExecutor> PolkadotApi for RemotePolkadotApiWrapper { +impl, E: CallExecutor> PolkadotApi for RemotePolkadotApiWrapper { type BlockBuilder = LightBlockBuilder; fn session_keys(&self, at: &BlockId) -> Result> { @@ -104,4 +105,4 @@ impl, E: CallExecutor> PolkadotApi for RemotePolkadotAp } } -impl, E: CallExecutor> RemotePolkadotApi for RemotePolkadotApiWrapper {} +impl, E: CallExecutor> RemotePolkadotApi for RemotePolkadotApiWrapper {} diff --git a/polkadot/availability-store/Cargo.toml b/polkadot/availability-store/Cargo.toml index 9a926310b0..fe60e9c992 100644 --- a/polkadot/availability-store/Cargo.toml +++ b/polkadot/availability-store/Cargo.toml @@ -10,6 +10,6 @@ parking_lot = "0.4" log = "0.3" substrate-codec = { path = "../../substrate/codec" } substrate-primitives = { path = "../../substrate/primitives" } -kvdb = { git = "https://github.com/paritytech/parity.git" } -kvdb-rocksdb = { git = "https://github.com/paritytech/parity.git" } -kvdb-memorydb = { git = "https://github.com/paritytech/parity.git" } +kvdb = { git = "https://github.com/paritytech/parity-common.git" } +kvdb-rocksdb = { git = "https://github.com/paritytech/parity-common.git" } +kvdb-memorydb = { git = "https://github.com/paritytech/parity-common.git" } diff --git a/polkadot/availability-store/src/lib.rs b/polkadot/availability-store/src/lib.rs index 33ace5794c..5237ca4981 100644 --- a/polkadot/availability-store/src/lib.rs +++ b/polkadot/availability-store/src/lib.rs @@ -66,20 +66,6 @@ pub struct Data { pub extrinsic: Option, } -fn extract_io_err(err: ::kvdb::Error) -> io::Error { - match err { - ::kvdb::Error(::kvdb::ErrorKind::Io(io_err), _) => io_err, - ::kvdb::Error(::kvdb::ErrorKind::Msg(msg), _) => io::Error::new( - io::ErrorKind::Other, - msg, - ), - x => io::Error::new( - io::ErrorKind::Other, - format!("Unexpected error variant: {:?}", x), // only necessary because of nonexaustive match. - ) - } -} - fn block_data_key(relay_parent: &Hash, candidate_hash: &Hash) -> Vec { (relay_parent, candidate_hash, 0i8).encode() } @@ -99,14 +85,13 @@ impl Store { pub fn new(config: Config) -> io::Result { let mut db_config = DatabaseConfig::with_columns(Some(columns::NUM_COLUMNS)); db_config.memory_budget = config.cache_size; - db_config.wal = true; let path = config.path.to_str().ok_or_else(|| io::Error::new( io::ErrorKind::Other, format!("Bad database path: {:?}", config.path), ))?; - let db = Database::open(&db_config, &path).map_err(extract_io_err)?; + let db = Database::open(&db_config, &path)?; Ok(Store { inner: Arc::new(db), @@ -151,7 +136,7 @@ impl Store { ); } - self.inner.write(tx).map_err(extract_io_err) + self.inner.write(tx) } /// Note that a set of candidates have been included in a finalized block with given hash and parent hash. @@ -175,7 +160,7 @@ impl Store { } } - self.inner.write(tx).map_err(extract_io_err) + self.inner.write(tx) } /// Query block data. diff --git a/polkadot/executor/Cargo.toml b/polkadot/executor/Cargo.toml index e7cfc5b772..3e62a0ce23 100644 --- a/polkadot/executor/Cargo.toml +++ b/polkadot/executor/Cargo.toml @@ -6,4 +6,5 @@ description = "Polkadot node implementation in Rust." [dependencies] substrate-executor = { path = "../../substrate/executor" } +substrate-primitives = { path = "../../substrate/primitives" } polkadot-runtime = { path = "../runtime" } diff --git a/polkadot/executor/src/lib.rs b/polkadot/executor/src/lib.rs index 82cd5cd478..f8fc6a238b 100644 --- a/polkadot/executor/src/lib.rs +++ b/polkadot/executor/src/lib.rs @@ -19,5 +19,6 @@ extern crate polkadot_runtime; #[macro_use] extern crate substrate_executor; +extern crate substrate_primitives as primitives; native_executor_instance!(pub Executor, polkadot_runtime::api::dispatch, polkadot_runtime::VERSION, include_bytes!("../../runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.compact.wasm")); diff --git a/polkadot/runtime/src/parachains.rs b/polkadot/runtime/src/parachains.rs index 677b86e847..98cbebe364 100644 --- a/polkadot/runtime/src/parachains.rs +++ b/polkadot/runtime/src/parachains.rs @@ -30,7 +30,10 @@ use substrate_runtime_support::dispatch::Result; use rstd::marker::PhantomData; #[cfg(any(feature = "std", test))] -use {runtime_io, runtime_primitives}; +use runtime_primitives; + +#[cfg(any(feature = "std", test))] +use std::collections::HashMap; pub trait Trait: system::Trait + session::Trait { /// The position of the set_heads call in the block. @@ -214,8 +217,7 @@ impl Default for GenesisConfig { #[cfg(any(feature = "std", test))] impl runtime_primitives::BuildStorage for GenesisConfig { - fn build_storage(mut self) -> ::std::result::Result { - use std::collections::HashMap; + fn build_storage(mut self) -> ::std::result::Result, Vec>, String> { use codec::Encode; self.parachains.sort_unstable_by_key(|&(ref id, _, _)| id.clone()); @@ -235,15 +237,15 @@ impl runtime_primitives::BuildStorage for GenesisConfig map.insert(head_key, genesis.encode()); } - Ok(map.into()) + Ok(map) } } #[cfg(test)] mod tests { use super::*; - use runtime_io::with_externalities; - use substrate_primitives::H256; + use runtime_io::{TestExternalities, with_externalities}; + use substrate_primitives::{H256, KeccakHasher}; use runtime_primitives::BuildStorage; use runtime_primitives::traits::{HasPublicAux, Identity, BlakeTwo256}; use runtime_primitives::testing::{Digest, Header}; @@ -284,7 +286,7 @@ mod tests { type Parachains = Module; - fn new_test_ext(parachains: Vec<(Id, Vec, Vec)>) -> runtime_io::TestExternalities { + fn new_test_ext(parachains: Vec<(Id, Vec, Vec)>) -> TestExternalities { let mut t = system::GenesisConfig::::default().build_storage().unwrap(); t.extend(consensus::GenesisConfig::{ code: vec![], @@ -299,7 +301,7 @@ mod tests { parachains: parachains, phantom: PhantomData, }.build_storage().unwrap()); - t + t.into() } #[test] diff --git a/polkadot/runtime/wasm/Cargo.lock b/polkadot/runtime/wasm/Cargo.lock index 7f6ce97773..b452d6cfad 100644 --- a/polkadot/runtime/wasm/Cargo.lock +++ b/polkadot/runtime/wasm/Cargo.lock @@ -1,16 +1,3 @@ -[[package]] -name = "aho-corasick" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "ansi_term" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "arrayvec" version = "0.4.7" @@ -19,16 +6,6 @@ dependencies = [ "nodrop 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "atty" -version = "0.2.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", - "termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "base58" version = "0.1.0" @@ -124,15 +101,6 @@ dependencies = [ "heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "env_logger" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "environmental" version = "0.1.0" @@ -149,27 +117,6 @@ dependencies = [ "tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "ethcore-bytes" -version = "0.1.0" -source = "git+https://github.com/paritytech/parity.git#dec390a89fe038337399315daf15e628ffbb4d8e" - -[[package]] -name = "ethcore-logger" -version = "1.12.0" -source = "git+https://github.com/paritytech/parity.git#dec390a89fe038337399315daf15e628ffbb4d8e" -dependencies = [ - "ansi_term 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", - "arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", - "atty 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", - "env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", - "time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "ethereum-types" version = "0.3.2" @@ -194,17 +141,19 @@ dependencies = [ [[package]] name = "fixed-hash" -version = "0.1.3" -source = "git+https://github.com/rphmeier/primitives.git?branch=compile-for-wasm#8dc457899afdaf968ff7f16140b03d1e37b01d71" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ + "heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "fixed-hash" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" +version = "0.2.2" +source = "git+https://github.com/paritytech/parity-common#26baede0d9cd8cdad3511d75408228051dbc23dd" dependencies = [ "heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", @@ -233,11 +182,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "hashdb" -version = "0.1.1" -source = "git+https://github.com/paritytech/parity.git#dec390a89fe038337399315daf15e628ffbb4d8e" +version = "0.2.1" +source = "git+https://github.com/paritytech/parity-common#26baede0d9cd8cdad3511d75408228051dbc23dd" dependencies = [ "elastic-array 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethereum-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -280,15 +228,6 @@ dependencies = [ "tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "keccak-hash" -version = "0.1.2" -source = "git+https://github.com/paritytech/parity.git#dec390a89fe038337399315daf15e628ffbb4d8e" -dependencies = [ - "ethereum-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "lazy_static" version = "0.2.11" @@ -320,14 +259,6 @@ dependencies = [ "cfg-if 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "memchr" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "memoffset" version = "0.2.1" @@ -340,16 +271,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "memorydb" -version = "0.1.1" -source = "git+https://github.com/paritytech/parity.git#dec390a89fe038337399315daf15e628ffbb4d8e" +version = "0.2.1" +source = "git+https://github.com/paritytech/parity-common#26baede0d9cd8cdad3511d75408228051dbc23dd" dependencies = [ "elastic-array 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethereum-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "hashdb 0.1.1 (git+https://github.com/paritytech/parity.git)", + "hashdb 0.2.1 (git+https://github.com/paritytech/parity-common)", "heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "keccak-hash 0.1.2 (git+https://github.com/paritytech/parity.git)", - "plain_hasher 0.1.0 (git+https://github.com/paritytech/parity.git)", - "rlp 0.2.1 (git+https://github.com/paritytech/parity.git)", + "plain_hasher 0.2.0 (git+https://github.com/paritytech/parity-common)", + "rlp 0.2.1 (git+https://github.com/paritytech/parity-common)", ] [[package]] @@ -383,6 +312,11 @@ dependencies = [ "stable_deref_trait 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "parity-bytes" +version = "0.1.0" +source = "git+https://github.com/paritytech/parity-common#26baede0d9cd8cdad3511d75408228051dbc23dd" + [[package]] name = "parity-wasm" version = "0.31.0" @@ -400,15 +334,6 @@ dependencies = [ "parking_lot_core 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "parking_lot" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot_core 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "parking_lot_core" version = "0.2.14" @@ -422,29 +347,22 @@ dependencies = [ [[package]] name = "patricia-trie" -version = "0.1.0" -source = "git+https://github.com/paritytech/parity.git#dec390a89fe038337399315daf15e628ffbb4d8e" +version = "0.2.1" +source = "git+https://github.com/paritytech/parity-common#26baede0d9cd8cdad3511d75408228051dbc23dd" dependencies = [ "elastic-array 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethcore-bytes 0.1.0 (git+https://github.com/paritytech/parity.git)", - "ethcore-logger 1.12.0 (git+https://github.com/paritytech/parity.git)", - "ethereum-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "hashdb 0.1.1 (git+https://github.com/paritytech/parity.git)", - "keccak-hash 0.1.2 (git+https://github.com/paritytech/parity.git)", + "hashdb 0.2.1 (git+https://github.com/paritytech/parity-common)", "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "memorydb 0.1.1 (git+https://github.com/paritytech/parity.git)", + "parity-bytes 0.1.0 (git+https://github.com/paritytech/parity-common)", "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.2.1 (git+https://github.com/paritytech/parity.git)", - "triehash 0.1.0 (git+https://github.com/paritytech/parity.git)", ] [[package]] name = "plain_hasher" -version = "0.1.0" -source = "git+https://github.com/paritytech/parity.git#dec390a89fe038337399315daf15e628ffbb4d8e" +version = "0.2.0" +source = "git+https://github.com/paritytech/parity-common#26baede0d9cd8cdad3511d75408228051dbc23dd" dependencies = [ "crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "ethereum-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -565,39 +483,6 @@ dependencies = [ "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "redox_syscall" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "redox_termios" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "regex" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "aho-corasick 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", - "memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "regex-syntax 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", - "thread_local 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", - "utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "regex-syntax" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "ucd-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "ring" version = "0.12.1" @@ -613,7 +498,7 @@ dependencies = [ [[package]] name = "rlp" version = "0.2.1" -source = "git+https://github.com/paritytech/parity.git#dec390a89fe038337399315daf15e628ffbb4d8e" +source = "git+https://github.com/paritytech/parity-common#26baede0d9cd8cdad3511d75408228051dbc23dd" dependencies = [ "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "elastic-array 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -736,15 +621,21 @@ dependencies = [ "blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "fixed-hash 0.1.3 (git+https://github.com/rphmeier/primitives.git?branch=compile-for-wasm)", + "elastic-array 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", + "fixed-hash 0.2.2 (git+https://github.com/paritytech/parity-common)", + "hashdb 0.2.1 (git+https://github.com/paritytech/parity-common)", + "patricia-trie 0.2.1 (git+https://github.com/paritytech/parity-common)", + "plain_hasher 0.2.0 (git+https://github.com/paritytech/parity-common)", + "rlp 0.2.1 (git+https://github.com/paritytech/parity-common)", "rustc-hex 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)", "substrate-codec 0.1.0", "substrate-codec-derive 0.1.0", "substrate-runtime-std 0.1.0", + "tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "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)", + "uint 0.2.2 (git+https://github.com/paritytech/parity-common)", "wasmi 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -981,15 +872,16 @@ name = "substrate-state-machine" version = "0.1.0" dependencies = [ "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "ethereum-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "hashdb 0.1.1 (git+https://github.com/paritytech/parity.git)", + "hashdb 0.2.1 (git+https://github.com/paritytech/parity-common)", + "heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "memorydb 0.1.1 (git+https://github.com/paritytech/parity.git)", + "memorydb 0.2.1 (git+https://github.com/paritytech/parity-common)", "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "patricia-trie 0.1.0 (git+https://github.com/paritytech/parity.git)", + "patricia-trie 0.2.1 (git+https://github.com/paritytech/parity-common)", + "rlp 0.2.1 (git+https://github.com/paritytech/parity-common)", "substrate-primitives 0.1.0", - "triehash 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "triehash 0.2.0 (git+https://github.com/paritytech/parity-common)", ] [[package]] @@ -1002,35 +894,6 @@ dependencies = [ "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "termion" -version = "1.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "thread_local" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "time" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "tiny-keccak" version = "1.4.2" @@ -1039,17 +902,6 @@ dependencies = [ "crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "triehash" -version = "0.1.0" -source = "git+https://github.com/paritytech/parity.git#dec390a89fe038337399315daf15e628ffbb4d8e" -dependencies = [ - "elastic-array 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethereum-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "keccak-hash 0.1.2 (git+https://github.com/paritytech/parity.git)", - "rlp 0.2.1 (git+https://github.com/paritytech/parity.git)", -] - [[package]] name = "triehash" version = "0.1.2" @@ -1061,6 +913,16 @@ dependencies = [ "rlp 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "triehash" +version = "0.2.0" +source = "git+https://github.com/paritytech/parity-common#26baede0d9cd8cdad3511d75408228051dbc23dd" +dependencies = [ + "elastic-array 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", + "hashdb 0.2.1 (git+https://github.com/paritytech/parity-common)", + "rlp 0.2.1 (git+https://github.com/paritytech/parity-common)", +] + [[package]] name = "twox-hash" version = "1.1.0" @@ -1069,21 +931,6 @@ dependencies = [ "rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "ucd-util" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "uint" -version = "0.1.2" -source = "git+https://github.com/rphmeier/primitives.git?branch=compile-for-wasm#8dc457899afdaf968ff7f16140b03d1e37b01d71" -dependencies = [ - "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc_version 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "uint" version = "0.2.1" @@ -1095,6 +942,16 @@ dependencies = [ "rustc_version 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "uint" +version = "0.2.2" +source = "git+https://github.com/paritytech/parity-common#26baede0d9cd8cdad3511d75408228051dbc23dd" +dependencies = [ + "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc_version 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "unicode-xid" version = "0.1.0" @@ -1113,11 +970,6 @@ name = "untrusted" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "utf8-ranges" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "void" version = "1.0.2" @@ -1154,10 +1006,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" [metadata] -"checksum aho-corasick 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "d6531d44de723825aa81398a6415283229725a00fa30713812ab9323faa82fc4" -"checksum ansi_term 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6b3568b48b7cefa6b8ce125f9bb4989e52fbcc29ebea88df04cc7c5f12f70455" "checksum arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "a1e964f9e24d588183fcb43503abda40d288c8657dfc27311516ce2f05675aef" -"checksum atty 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "2fc4a1aa4c24c0718a250f0681885c1af91419d242f29eb8f2ab28502d80dbd1" "checksum base58 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5024ee8015f02155eee35c711107ddd9a9bf3cb689cf2a9089c97e79b6e1ae83" "checksum bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d0c54bb8f454c567f21197eefcdbf5679d0bd99f2ddbe52e84c77061952e6789" "checksum blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)" = "5d6d530bdd2d52966a6d03b7a964add7ae1a288d25214066fd4b600f0f796400" @@ -1170,44 +1019,39 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum crossbeam-utils 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2760899e32a1d58d5abb31129f8fae5de75220bc2176e77ff7c627ae45c918d9" "checksum crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "a2f4a431c5c9f662e1200b7c7f02c34e91361150e382089a8f2dec3ba680cbda" "checksum elastic-array 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "88d4851b005ef16de812ea9acdb7bece2f0a40dd86c07b85631d7dafa54537bb" -"checksum env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3ddf21e73e016298f5cb37d6ef8e8da8e39f91f9ec8b0df44b7deb16a9f8cd5b" "checksum ethbloom 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1a93a43ce2e9f09071449da36bfa7a1b20b950ee344b6904ff23de493b03b386" -"checksum ethcore-bytes 0.1.0 (git+https://github.com/paritytech/parity.git)" = "" -"checksum ethcore-logger 1.12.0 (git+https://github.com/paritytech/parity.git)" = "" "checksum ethereum-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9c48729b8aea8aedb12cf4cb2e5cef439fdfe2dda4a89e47eeebd15778ef53b6" "checksum ethereum-types-serialize 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4ac59a21a9ce98e188f3dace9eb67a6c4a3c67ec7fbc7218cb827852679dc002" -"checksum fixed-hash 0.1.3 (git+https://github.com/rphmeier/primitives.git?branch=compile-for-wasm)" = "" "checksum fixed-hash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b18d6fd718fb4396e7a9c93ac59ba7143501467ca7a143c145b5555a571d5576" +"checksum fixed-hash 0.2.2 (git+https://github.com/paritytech/parity-common)" = "" "checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" "checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" "checksum gcc 0.3.54 (registry+https://github.com/rust-lang/crates.io-index)" = "5e33ec290da0d127825013597dbdfc28bee4964690c7ce1166cbc2a7bd08b1bb" -"checksum hashdb 0.1.1 (git+https://github.com/paritytech/parity.git)" = "" +"checksum hashdb 0.2.1 (git+https://github.com/paritytech/parity-common)" = "" "checksum heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1679e6ea370dee694f91f1dc469bf94cf8f52051d147aec3e1f9497c6fc22461" "checksum hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4da5f0e01bd8a71a224a4eedecaacfcabda388dbb7a80faf04d3514287572d95" "checksum hex-literal-impl 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1d340b6514f232f6db1bd16db65302a5278a04fef9ce867cb932e7e5fa21130a" "checksum integer-sqrt 0.1.0 (git+https://github.com/paritytech/integer-sqrt-rs.git)" = "" "checksum keccak-hash 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0b7f51f30d7986536accaec4a6a288008dfb3dbffe8a2863a65292bc395a3ae7" -"checksum keccak-hash 0.1.2 (git+https://github.com/paritytech/parity.git)" = "" "checksum lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "76f033c7ad61445c5b347c7382dd1237847eb1bce590fe50365dcb33d546be73" "checksum lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e6412c5e2ad9584b0b8e979393122026cdd6d2a80b933f890dcd694ddbe73739" "checksum libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)" = "ac8ebf8343a981e2fa97042b14768f02ed3e1d602eac06cae6166df3c8ced206" "checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" "checksum log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "89f010e843f2b1a31dbd316b3b8d443758bc634bed37aabade59c686d644e0a2" -"checksum memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "796fba70e76612589ed2ce7f45282f5af869e0fdd7cc6199fa1aa1f1d591ba9d" "checksum memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0f9dc261e2b62d7a622bf416ea3c5245cdd5d9a7fcc428c0d06804dfce1775b3" "checksum memory_units 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "71d96e3f3c0b6325d8ccd83c33b28acb183edcb6c67938ba104ec546854b0882" -"checksum memorydb 0.1.1 (git+https://github.com/paritytech/parity.git)" = "" +"checksum memorydb 0.2.1 (git+https://github.com/paritytech/parity-common)" = "" "checksum nan-preserving-float 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "34d4f00fcc2f4c9efa8cc971db0da9e28290e28e97af47585e48691ef10ff31f" "checksum nodrop 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "9a2228dca57108069a5262f2ed8bd2e82496d2e074a06d1ccc7ce1687b6ae0a2" "checksum num-traits 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "775393e285254d2f5004596d69bb8bc1149754570dcc08cf30cabeba67955e28" "checksum num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c51a3322e4bca9d212ad9a158a02abc6934d005490c054a2778df73a70aa0a30" "checksum owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cdf84f41639e037b484f93433aa3897863b561ed65c6e59c7073d7c561710f37" +"checksum parity-bytes 0.1.0 (git+https://github.com/paritytech/parity-common)" = "" "checksum parity-wasm 0.31.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e1c91199d14bd5b78ecade323d4a891d094799749c1b9e82d9c590c2e2849a40" "checksum parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "149d8f5b97f3c1133e3cfcd8886449959e856b557ff281e292b733d7c69e005e" -"checksum parking_lot 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d4d05f1349491390b1730afba60bb20d55761bef489a954546b58b4b34e1e2ac" "checksum parking_lot_core 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "4db1a8ccf734a7bce794cc19b3df06ed87ab2f3907036b693c68f56b4d4537fa" -"checksum patricia-trie 0.1.0 (git+https://github.com/paritytech/parity.git)" = "" -"checksum plain_hasher 0.1.0 (git+https://github.com/paritytech/parity.git)" = "" +"checksum patricia-trie 0.2.1 (git+https://github.com/paritytech/parity-common)" = "" +"checksum plain_hasher 0.2.0 (git+https://github.com/paritytech/parity-common)" = "" "checksum proc-macro-hack 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3ba8d4f9257b85eb6cdf13f055cea3190520aab1409ca2ab43493ea4820c25f0" "checksum proc-macro-hack-impl 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d5cb6f960ad471404618e9817c0e5d10b1ae74cfdf01fab89ea0641fe7fb2892" "checksum proc-macro2 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "1fa93823f53cfd0f5ac117b189aed6cfdfb2cfc0a9d82e956dd7927595ed7d46" @@ -1216,12 +1060,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "eba5f8cb59cc50ed56be8880a5c7b496bfd9bd26394e176bc67884094145c2c5" "checksum rayon 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b614fe08b6665cb9a231d07ac1364b0ef3cb3698f1239ee0c4c3a88a524f54c8" "checksum rayon-core 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9d24ad214285a7729b174ed6d3bcfcb80177807f959d95fafd5bfc5c4f201ac8" -"checksum redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "c214e91d3ecf43e9a4e41e578973adeb14b474f2bee858742d127af75a0112b1" -"checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76" -"checksum regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9329abc99e39129fcceabd24cf5d85b4671ef7c29c50e972bc5afe32438ec384" -"checksum regex-syntax 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7d707a4fa2637f2dca2ef9fd02225ec7661fe01a53623c1e6515b6916511f7a7" "checksum ring 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6f7d28b30a72c01b458428e0ae988d4149c20d902346902be881e3edc4bb325c" -"checksum rlp 0.2.1 (git+https://github.com/paritytech/parity.git)" = "" +"checksum rlp 0.2.1 (git+https://github.com/paritytech/parity-common)" = "" "checksum rlp 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "89db7f8dfdd5eb7ab3ac3ece7a07fd273a680b4b224cb231181280e8996f9f0b" "checksum rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0ceb8ce7a5e520de349e1fa172baeba4a9e8d5ef06c47471863530bc4972ee1e" "checksum rustc-hex 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d2b03280c2813907a030785570c577fb27d3deec8da4c18566751ade94de0ace" @@ -1235,20 +1075,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum smallvec 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "211a489e65e94b103926d2054ae515a1cdb5d515ea0ef414fee23b7e043ce748" "checksum stable_deref_trait 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "15132e0e364248108c5e2c02e3ab539be8d6f5d52a01ca9bbf27ed657316f02b" "checksum syn 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6dfd71b2be5a58ee30a6f8ea355ba8290d397131c00dfa55c3d34e6e13db5101" -"checksum termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "689a3bdfaab439fd92bc87df5c4c78417d3cbe537487274e9b0b2dce76e92096" -"checksum thread_local 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "279ef31c19ededf577bfd12dfae728040a21f635b06a24cd670ff510edd38963" -"checksum time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "d825be0eb33fda1a7e68012d51e9c7f451dc1a69391e7fdc197060bb8c56667b" "checksum tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e9175261fbdb60781fcd388a4d6cc7e14764a2b629a7ad94abb439aed223a44f" -"checksum triehash 0.1.0 (git+https://github.com/paritytech/parity.git)" = "" "checksum triehash 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2033893a813c70e7d8a739ca6c36dc0a7a2c913ec718d7cbf84a3837bbe3c7ce" +"checksum triehash 0.2.0 (git+https://github.com/paritytech/parity-common)" = "" "checksum twox-hash 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "475352206e7a290c5fccc27624a163e8d0d115f7bb60ca18a64fc9ce056d7435" -"checksum ucd-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fd2be2d6639d0f8fe6cdda291ad456e23629558d466e2789d2c3e9892bda285d" -"checksum uint 0.1.2 (git+https://github.com/rphmeier/primitives.git?branch=compile-for-wasm)" = "" "checksum uint 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "38051a96565903d81c9a9210ce11076b2218f3b352926baa1f5f6abbdfce8273" +"checksum uint 0.2.2 (git+https://github.com/paritytech/parity-common)" = "" "checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" "checksum unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" "checksum untrusted 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f392d7819dbe58833e26872f5f6f0d68b7bbbe90fc3667e98731c4a15ad9a7ae" -"checksum utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "662fab6525a98beff2921d7f61a39e7d59e0b425ebc7d0d9e66d316e55124122" "checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" "checksum wasmi 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "522fe3fdd44a56f25cd5ddcd8ccdb1cf2e982ceb28fcb00f41d8a018ae5245a8" "checksum winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "04e3bd221fcbe8a271359c04f21a76db7d0c6028862d1bb5512d85e1e2eb5bb3" diff --git a/polkadot/runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.compact.wasm b/polkadot/runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.compact.wasm index 055036f666..8e1771edf5 100644 Binary files a/polkadot/runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.compact.wasm and b/polkadot/runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.compact.wasm differ diff --git a/polkadot/runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.wasm b/polkadot/runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.wasm index 6bc54e8655..292e560248 100755 Binary files a/polkadot/runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.wasm and b/polkadot/runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.wasm differ diff --git a/polkadot/service/src/lib.rs b/polkadot/service/src/lib.rs index 3814a1c98d..4e59a22ca2 100644 --- a/polkadot/service/src/lib.rs +++ b/polkadot/service/src/lib.rs @@ -53,6 +53,7 @@ use client::Client; use polkadot_network::{PolkadotProtocol, consensus::ConsensusNetwork}; use tokio::runtime::TaskExecutor; use service::FactoryFullConfiguration; +use primitives::{KeccakHasher, RlpCodec}; pub use service::{Roles, PruningMode, ExtrinsicPoolOptions, ErrorKind, Error, ComponentBlock, LightComponents, FullComponents}; @@ -69,9 +70,9 @@ pub trait Components: service::Components { /// Polkadot API. type Api: 'static + PolkadotApi + Send + Sync; /// Client backend. - type Backend: 'static + client::backend::Backend; + type Backend: 'static + client::backend::Backend; /// Client executor. - type Executor: 'static + client::CallExecutor + Send + Sync; + type Executor: 'static + client::CallExecutor + Send + Sync; } impl Components for service::LightComponents { @@ -271,8 +272,8 @@ pub struct TransactionPoolAdapter where A: Send + Sync, E: Send + Sync impl TransactionPoolAdapter where A: Send + Sync, - B: client::backend::Backend + Send + Sync, - E: client::CallExecutor + Send + Sync, + B: client::backend::Backend + Send + Sync, + E: client::CallExecutor + Send + Sync, { fn best_block_id(&self) -> Option { self.client.info() @@ -286,8 +287,8 @@ impl TransactionPoolAdapter impl network::TransactionPool for TransactionPoolAdapter where - B: client::backend::Backend + Send + Sync, - E: client::CallExecutor + Send + Sync, + B: client::backend::Backend + Send + Sync, + E: client::CallExecutor + Send + Sync, A: polkadot_api::PolkadotApi + Send + Sync, { fn transactions(&self) -> Vec<(Hash, Vec)> { @@ -338,8 +339,8 @@ impl network::TransactionPool for TransactionPoolAdapter service::ExtrinsicPool for TransactionPoolAdapter where - B: client::backend::Backend + Send + Sync + 'static, - E: client::CallExecutor + Send + Sync + 'static, + B: client::backend::Backend + Send + Sync + 'static, + E: client::CallExecutor + Send + Sync + 'static, A: polkadot_api::PolkadotApi + Send + Sync + 'static, { type Api = TransactionPool; diff --git a/polkadot/transaction-pool/src/lib.rs b/polkadot/transaction-pool/src/lib.rs index 96ad1050d9..3ba340921a 100644 --- a/polkadot/transaction-pool/src/lib.rs +++ b/polkadot/transaction-pool/src/lib.rs @@ -184,12 +184,10 @@ impl txpool::Scoring for Scoring { } fn should_replace(&self, old: &VerifiedTransaction, _new: &VerifiedTransaction) -> Choice { - if old.is_fully_verified() { - // Don't allow new transactions if we are reaching the limit. - Choice::RejectNew - } else { - // Always replace not fully verified transactions. - Choice::ReplaceOld + // Always replace not fully verified transactions. + match old.is_fully_verified() { + true => Choice::RejectNew, + false => Choice::ReplaceOld } } }