RPC: Pending Extrinsics (#563)

* Expose extrinsics in pool.

* Add test.

* Use latest transaction pool.

* Fix compilation.
This commit is contained in:
Tomasz Drwięga
2018-08-14 18:51:30 +02:00
committed by Gav Wood
parent a079be3e64
commit 41b7b2a943
10 changed files with 99 additions and 18 deletions
+6 -1
View File
@@ -59,6 +59,7 @@ use demo_executor::NativeExecutor;
struct DummyPool;
impl extrinsic_pool::api::ExtrinsicPool<UncheckedExtrinsic, BlockId, Hash> for DummyPool {
type Error = extrinsic_pool::txpool::Error;
type InPool = ();
fn submit(&self, _block: BlockId, _: Vec<UncheckedExtrinsic>)
-> Result<Vec<Hash>, Self::Error>
@@ -79,6 +80,10 @@ impl extrinsic_pool::api::ExtrinsicPool<UncheckedExtrinsic, BlockId, Hash> for D
fn import_notification_stream(&self) -> extrinsic_pool::api::EventStream {
unreachable!()
}
fn all(&self) -> Self::InPool {
unreachable!()
}
}
struct DummySystem;
@@ -176,7 +181,7 @@ pub fn run<I, T>(args: I) -> error::Result<()> where
let state = rpc::apis::state::State::new(client.clone(), runtime.executor());
let chain = rpc::apis::chain::Chain::new(client.clone(), runtime.executor());
let author = rpc::apis::author::Author::new(client.clone(), Arc::new(DummyPool), runtime.executor());
rpc::rpc_handler::<Block, _, _, _, _>(state, chain, author, DummySystem)
rpc::rpc_handler::<Block, _, _, _, _, _>(state, chain, author, DummySystem)
};
let http_address = "127.0.0.1:9933".parse().unwrap();
let ws_address = "127.0.0.1:9944".parse().unwrap();