mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 11:41:04 +00:00
Hook RPC extrinsic import into propagation (#158)
* call `on_new_transactions` when we import * fix trace * pass correct bytes to network * clean up * cull before repropagating; repropagate on timer * add a little tracing
This commit is contained in:
committed by
Gav Wood
parent
413ebf3f19
commit
f997a3bdf1
@@ -16,8 +16,6 @@
|
||||
|
||||
//! Substrate block-author/full-node API.
|
||||
|
||||
use std::sync::Arc;
|
||||
use parking_lot::Mutex;
|
||||
use primitives::block::Extrinsic;
|
||||
|
||||
pub mod error;
|
||||
@@ -35,15 +33,3 @@ build_rpc_trait! {
|
||||
fn submit_extrinsic(&self, Extrinsic) -> Result<()>;
|
||||
}
|
||||
}
|
||||
|
||||
/// Variant of the AuthorApi that doesn't need to be Sync + Send + 'static.
|
||||
pub trait AsyncAuthorApi: Send + 'static {
|
||||
/// Submit extrinsic for inclusion in block.
|
||||
fn submit_extrinsic(&mut self, Extrinsic) -> Result<()>;
|
||||
}
|
||||
|
||||
impl<T: AsyncAuthorApi> AuthorApi for Arc<Mutex<T>> {
|
||||
fn submit_extrinsic(&self, xt: Extrinsic) -> Result<()> {
|
||||
self.as_ref().lock().submit_extrinsic(xt)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user