From ba2362dadd520ff5229bc42ec17bdc679292e713 Mon Sep 17 00:00:00 2001 From: Stanislav Tkach <stanislav.tkach@gmail.com> Date: Wed, 19 Feb 2020 00:25:56 +0200 Subject: [PATCH] [In Progress] Remove deprecated api (#4973) * Remove deprecated api * Revert changes to wasm-build-runner --- substrate/client/finality-grandpa/src/lib.rs | 19 ------------------- .../client/finality-grandpa/src/observer.rs | 2 +- .../network/src/protocol/specialization.rs | 19 ------------------- 3 files changed, 1 insertion(+), 39 deletions(-) diff --git a/substrate/client/finality-grandpa/src/lib.rs b/substrate/client/finality-grandpa/src/lib.rs index 45a24002269..e931271df91 100644 --- a/substrate/client/finality-grandpa/src/lib.rs +++ b/substrate/client/finality-grandpa/src/lib.rs @@ -857,25 +857,6 @@ where } } -#[deprecated(since = "1.1.0", note = "Please switch to run_grandpa_voter.")] -pub fn run_grandpa<B, E, Block: BlockT, N, RA, SC, VR, X>( - grandpa_params: GrandpaParams<B, E, Block, N, RA, SC, VR, X>, -) -> sp_blockchain::Result<impl Future<Output=()> + Send + 'static> where - Block::Hash: Ord, - B: Backend<Block> + 'static, - E: CallExecutor<Block> + Send + Sync + 'static, - N: NetworkT<Block> + Send + Sync + Clone + 'static, - SC: SelectChain<Block> + 'static, - NumberFor<Block>: BlockNumberOps, - DigestFor<Block>: Encode, - RA: Send + Sync + 'static, - VR: VotingRule<Block, Client<B, E, Block, RA>> + Clone + 'static, - X: futures::Future<Output=()> + Clone + Send + Unpin + 'static, - Client<B, E, Block, RA>: AuxStore, -{ - run_grandpa_voter(grandpa_params) -} - /// When GRANDPA is not initialized we still need to register the finality /// tracker inherent provider which might be expected by the runtime for block /// authoring. Additionally, we register a gossip message validator that diff --git a/substrate/client/finality-grandpa/src/observer.rs b/substrate/client/finality-grandpa/src/observer.rs index ffe71d573a8..77227909dc8 100644 --- a/substrate/client/finality-grandpa/src/observer.rs +++ b/substrate/client/finality-grandpa/src/observer.rs @@ -377,7 +377,7 @@ mod tests { use substrate_test_runtime_client::{TestClientBuilder, TestClientBuilderExt}; use sc_network::PeerId; - use futures::executor::{self, ThreadPool}; + use futures::executor; /// Ensure `Future` implementation of `ObserverWork` is polling its `NetworkBridge`. Regression /// test for bug introduced in d4fbb897c and fixed in b7af8b339. diff --git a/substrate/client/network/src/protocol/specialization.rs b/substrate/client/network/src/protocol/specialization.rs index af6d5f7a239..6ffa335c8c3 100644 --- a/substrate/client/network/src/protocol/specialization.rs +++ b/substrate/client/network/src/protocol/specialization.rs @@ -41,14 +41,6 @@ pub trait NetworkSpecialization<B: BlockT>: Send + Sync + 'static { message: Vec<u8> ); - /// Called when a network-specific event arrives. - #[deprecated(note = "This method is never called; please use `with_dht_event_tx` when building the service")] - fn on_event(&mut self, _event: Event) {} - - /// Called on abort. - #[deprecated(note = "This method is never called; aborting corresponds to dropping the object")] - fn on_abort(&mut self) { } - /// Called periodically to maintain peers and handle timeouts. fn maintain_peers(&mut self, _ctx: &mut dyn Context<B>) { } @@ -162,17 +154,6 @@ macro_rules! construct_simple_protocol { $( self.$sub_protocol_name.on_message(_ctx, _who, _message); )* } - fn on_event( - &mut self, - _event: $crate::specialization::Event - ) { - $( self.$sub_protocol_name.on_event(_event); )* - } - - fn on_abort(&mut self) { - $( self.$sub_protocol_name.on_abort(); )* - } - fn maintain_peers(&mut self, _ctx: &mut $crate::Context<$block>) { $( self.$sub_protocol_name.maintain_peers(_ctx); )* } -- GitLab