More crate compiling for WASM-browser (#2825)

* More crate compiling for WASM-browser

* Update runtime Cargo.lock
This commit is contained in:
Pierre Krieger
2019-06-07 16:06:15 +02:00
committed by Bastian Köcher
parent 4d3396d095
commit ac895023be
10 changed files with 18 additions and 64 deletions
+4
View File
@@ -137,10 +137,14 @@ check-web-wasm:
- time cargo web build -p sr-io
- time cargo web build -p sr-primitives
- time cargo web build -p sr-std
- time cargo web build -p substrate-client
- time cargo web build -p substrate-consensus-aura
- time cargo web build -p substrate-consensus-babe
- time cargo web build -p substrate-consensus-common
- time cargo web build -p substrate-keyring
- time cargo web build -p substrate-keystore
- time cargo web build -p substrate-executor
- time cargo web build -p substrate-network
- time cargo web build -p substrate-network-libp2p
- time cargo web build -p substrate-panic-handler
- time cargo web build -p substrate-peerset
+3 -1
View File
@@ -4068,6 +4068,7 @@ dependencies = [
"substrate-telemetry 2.0.0",
"substrate-test-client 2.0.0",
"tokio 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-timer 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -4125,6 +4126,7 @@ dependencies = [
"substrate-telemetry 2.0.0",
"substrate-test-client 2.0.0",
"tokio 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-timer 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -4196,7 +4198,7 @@ dependencies = [
"substrate-inherents 2.0.0",
"substrate-primitives 2.0.0",
"substrate-test-client 2.0.0",
"tokio 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-timer 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
+2 -1
View File
@@ -22,7 +22,7 @@ consensus_common = { package = "substrate-consensus-common", path = "../common"
authorities = { package = "substrate-consensus-authorities", path = "../authorities" }
runtime_primitives = { package = "sr-primitives", path = "../../sr-primitives" }
futures = "0.1.17"
tokio = "0.1.7"
tokio-timer = "0.2.11"
parking_lot = "0.8.0"
log = "0.4"
@@ -32,4 +32,5 @@ substrate-executor = { path = "../../executor" }
network = { package = "substrate-network", path = "../../network", features = ["test-helpers"]}
service = { package = "substrate-service", path = "../../service" }
test_client = { package = "substrate-test-client", path = "../../test-client" }
tokio = "0.1.7"
env_logger = "0.6"
+2 -2
View File
@@ -56,7 +56,7 @@ use inherents::{InherentDataProviders, InherentData};
use authorities::AuthoritiesApi;
use futures::{Future, IntoFuture, future};
use tokio::timer::Timeout;
use tokio_timer::Timeout;
use log::{error, warn, debug, info, trace};
use srml_aura::{
@@ -914,7 +914,7 @@ mod tests {
.map(|_| ())
.map_err(|_| ());
let drive_to_completion = ::tokio::timer::Interval::new_interval(TEST_ROUTING_INTERVAL)
let drive_to_completion = ::tokio_timer::Interval::new_interval(TEST_ROUTING_INTERVAL)
.for_each(move |_| {
net.lock().send_import_notifications();
net.lock().sync_without_disconnects();
+2 -1
View File
@@ -23,7 +23,7 @@ authorities = { package = "substrate-consensus-authorities", path = "../authorit
slots = { package = "substrate-consensus-slots", path = "../slots" }
runtime_primitives = { package = "sr-primitives", path = "../../sr-primitives" }
futures = "0.1.26"
tokio = "0.1.18"
tokio-timer = "0.2.11"
parking_lot = "0.8.0"
log = "0.4.6"
schnorrkel = "0.1.1"
@@ -36,4 +36,5 @@ substrate-executor = { path = "../../executor" }
network = { package = "substrate-network", path = "../../network", features = ["test-helpers"]}
service = { package = "substrate-service", path = "../../service" }
test_client = { package = "substrate-test-client", path = "../../test-client" }
tokio = "0.1.18"
env_logger = "0.6.1"
+2 -2
View File
@@ -79,7 +79,7 @@ use client::{
};
use slots::{CheckedHeader, check_equivocation};
use futures::{Future, IntoFuture, future};
use tokio::timer::Timeout;
use tokio_timer::Timeout;
use log::{error, warn, debug, info, trace};
use slots::{SlotWorker, SlotData, SlotInfo, SlotCompatible, slot_now};
@@ -984,7 +984,7 @@ mod tests {
.map(drop)
.map_err(drop);
let drive_to_completion = ::tokio::timer::Interval::new_interval(TEST_ROUTING_INTERVAL)
let drive_to_completion = ::tokio_timer::Interval::new_interval(TEST_ROUTING_INTERVAL)
.for_each(move |_| {
net.lock().send_import_notifications();
net.lock().sync_without_disconnects();
+1 -1
View File
@@ -13,7 +13,7 @@ runtime_primitives = { package = "sr-primitives", path = "../../sr-primitives" }
consensus_common = { package = "substrate-consensus-common", path = "../common" }
inherents = { package = "substrate-inherents", path = "../../inherents" }
futures = "0.1.17"
tokio = "0.1.7"
tokio-timer = "0.2.11"
parking_lot = "0.8.0"
log = "0.4"
-54
View File
@@ -41,8 +41,6 @@ use runtime_primitives::generic::BlockId;
use runtime_primitives::traits::{ApiRef, Block, ProvideRuntimeApi};
use std::fmt::Debug;
use std::ops::Deref;
use std::sync::mpsc;
use std::thread;
/// A worker that should be invoked at every new slot.
pub trait SlotWorker<B: Block> {
@@ -66,58 +64,6 @@ pub trait SlotCompatible {
) -> Result<(u64, u64), consensus_common::Error>;
}
/// Start a new slot worker in a separate thread.
#[deprecated(since = "1.1", note = "Please spawn a thread manually")]
pub fn start_slot_worker_thread<B, C, W, SO, SC, T, OnExit>(
slot_duration: SlotDuration<T>,
select_chain: C,
worker: W,
sync_oracle: SO,
on_exit: OnExit,
inherent_data_providers: InherentDataProviders,
) -> Result<(), consensus_common::Error>
where
B: Block + 'static,
C: SelectChain<B> + Clone + 'static,
W: SlotWorker<B> + Send + Sync + 'static,
SO: SyncOracle + Send + Clone + 'static,
SC: SlotCompatible + 'static,
OnExit: Future<Item = (), Error = ()> + Send + 'static,
T: SlotData + Send + Clone + 'static,
{
use tokio::runtime::current_thread::Runtime;
let (result_sender, result_recv) = mpsc::channel();
thread::spawn(move || {
let mut runtime = match Runtime::new() {
Ok(r) => r,
Err(e) => {
warn!(target: "slots", "Unable to start authorship: {:?}", e);
return;
}
};
let slot_worker_future = start_slot_worker::<_, _, _, T, _, SC>(
slot_duration.clone(),
select_chain,
worker,
sync_oracle,
inherent_data_providers,
);
result_sender
.send(Ok(()))
.expect("Receive is not dropped before receiving a result; qed");
let _ = runtime.block_on(slot_worker_future.select(on_exit).map(|_| ()));
});
result_recv
.recv()
.expect("Slots start thread result sender dropped")
}
/// Start a new slot worker.
///
/// Every time a new slot is triggered, `worker.on_slot` is called and the future it returns is
+1 -1
View File
@@ -26,7 +26,7 @@ use inherents::{InherentData, InherentDataProviders};
use log::warn;
use std::marker::PhantomData;
use std::time::{Duration, Instant};
use tokio::timer::Delay;
use tokio_timer::Delay;
/// Returns current duration since unix epoch.
pub fn duration_now() -> Option<Duration> {
+1 -1
View File
@@ -2561,7 +2561,7 @@ dependencies = [
"substrate-consensus-common 2.0.0",
"substrate-inherents 2.0.0",
"substrate-primitives 2.0.0",
"tokio 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-timer 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]