Remove node-api (#804)

* Remove `node-api` from `node-consensus` and `node-transaction-pool`

* Remove the `node-api` crate and its last usages

* Remove left over file

* Fixes compilation errors

* Switch to `As` trait

* Rename trait

* Whitespace
This commit is contained in:
Bastian Köcher
2018-09-26 18:57:30 +02:00
committed by Gav Wood
parent 58cc0992df
commit 718ba4e159
17 changed files with 255 additions and 318 deletions
-1
View File
@@ -5,7 +5,6 @@ authors = ["Parity Technologies <admin@parity.io>"]
description = "Substrate node networking protocol"
[dependencies]
node-api = { path = "../api" }
node-consensus = { path = "../consensus" }
node-primitives = { path = "../primitives" }
substrate-bft = { path = "../../core/bft" }
+3 -3
View File
@@ -22,8 +22,7 @@ use bft;
use substrate_primitives::ed25519;
use substrate_network::{self as net, generic_message as msg};
use substrate_network::consensus_gossip::ConsensusMessage;
use node_api::Api;
use node_consensus::Network;
use node_consensus::{AuthoringApi, Network};
use node_primitives::{Block, Hash, SessionKey};
use rhododendron;
@@ -248,12 +247,13 @@ impl<P> Clone for ConsensusNetwork<P> {
}
/// A long-lived network which can create parachain statement and BFT message routing processes on demand.
impl<P: Api + Send + Sync + 'static> Network for ConsensusNetwork<P> {
impl<P: AuthoringApi + Send + Sync + 'static> Network for ConsensusNetwork<P> {
/// The input stream of BFT messages. Should never logically conclude.
type Input = InputAdapter;
/// The output sink of BFT messages. Messages sent here should eventually pass to all
/// current validators.
type Output = BftSink<::node_consensus::Error>;
type Block = Block;
/// Get input and output streams of BFT messages.
fn communication_for(
-2
View File
@@ -24,7 +24,6 @@ extern crate substrate_bft as bft;
extern crate substrate_network;
extern crate substrate_primitives;
extern crate node_api;
extern crate node_consensus;
extern crate node_primitives;
@@ -114,4 +113,3 @@ impl Specialization<Block> for Protocol {
fn on_block_imported(&mut self, _ctx: &mut Context<Block>, _hash: Hash, _header: &Header) {
}
}