Unverified Commit cfeb50c0 authored by Ashley's avatar Ashley
Browse files

Revert removal of tokio_executor that causes tokio version mismatch panic

parent 5bcb83a1
Pipeline #71339 failed with stage
in 13 minutes and 20 seconds
...@@ -3800,6 +3800,7 @@ dependencies = [ ...@@ -3800,6 +3800,7 @@ dependencies = [
"sp-transaction-pool-api 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "sp-transaction-pool-api 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)",
"sp-trie 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "sp-trie 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)",
"tokio 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", "tokio 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-executor 0.2.0-alpha.6 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
...@@ -6072,6 +6073,8 @@ version = "0.2.0-alpha.6" ...@@ -6072,6 +6073,8 @@ version = "0.2.0-alpha.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"futures-util-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)", "futures-util-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-sync 0.2.0-alpha.6 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
......
...@@ -12,6 +12,7 @@ tokio = { version = "0.2.4", features = ["rt-core", "blocking"] } ...@@ -12,6 +12,7 @@ tokio = { version = "0.2.4", features = ["rt-core", "blocking"] }
derive_more = "0.14.1" derive_more = "0.14.1"
log = "0.4.8" log = "0.4.8"
exit-future = "0.2.0" exit-future = "0.2.0"
tokio-executor = { version = "0.2.0-alpha.6", features = ["blocking"] }
codec = { package = "parity-scale-codec", version = "1.1.0", default-features = false, features = ["derive"] } codec = { package = "parity-scale-codec", version = "1.1.0", default-features = false, features = ["derive"] }
availability_store = { package = "polkadot-availability-store", path = "../availability-store" } availability_store = { package = "polkadot-availability-store", path = "../availability-store" }
parachain = { package = "polkadot-parachain", path = "../parachain" } parachain = { package = "polkadot-parachain", path = "../parachain" }
......
...@@ -747,7 +747,7 @@ enum CreateProposalState<C: Send + Sync, TxPool> { ...@@ -747,7 +747,7 @@ enum CreateProposalState<C: Send + Sync, TxPool> {
/// Represents the state when we switch from pending to fired. /// Represents the state when we switch from pending to fired.
Switching, Switching,
/// Block proposing has fired. /// Block proposing has fired.
Fired(tokio::task::JoinHandle<Result<Block, Error>>), Fired(tokio_executor::blocking::Blocking<Result<Block, Error>>),
} }
/// Inner data of the create proposal. /// Inner data of the create proposal.
...@@ -893,22 +893,18 @@ impl<C, TxPool> Future for CreateProposal<C, TxPool> where ...@@ -893,22 +893,18 @@ impl<C, TxPool> Future for CreateProposal<C, TxPool> where
thus Switching will never be reachable here; qed" thus Switching will never be reachable here; qed"
), ),
CreateProposalState::Fired(mut future) => { CreateProposalState::Fired(mut future) => {
let ret = Pin::new(&mut future) let ret = Pin::new(&mut future).poll(cx);
.poll(cx)
.map(|res| res.map_err(Error::Join).and_then(|res| res));
self.state = CreateProposalState::Fired(future); self.state = CreateProposalState::Fired(future);
return ret return ret
}, },
}; };
// 2. propose // 2. propose
let mut future = tokio::task::spawn_blocking(move || { let mut future = tokio_executor::blocking::run(move || {
let proposed_candidates = data.table.proposed_set(); let proposed_candidates = data.table.proposed_set();
data.propose_with(proposed_candidates) data.propose_with(proposed_candidates)
}); });
let polled = Pin::new(&mut future) let polled = Pin::new(&mut future).poll(cx);
.poll(cx)
.map(|res| res.map_err(Error::Join).and_then(|res| res));
self.state = CreateProposalState::Fired(future); self.state = CreateProposalState::Fired(future);
polled polled
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment