mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 04:41:02 +00:00
Fix tons of warnings in newest nightly (#2784)
* Fix tons of warnings in newest nightly * Fix sr-api-macro doc tests
This commit is contained in:
@@ -197,7 +197,7 @@ pub trait JustificationImport<B: BlockT> {
|
||||
type Error: ::std::error::Error + Send + 'static;
|
||||
|
||||
/// Called by the import queue when it is started.
|
||||
fn on_start(&self, _link: &crate::import_queue::Link<B>) { }
|
||||
fn on_start(&self, _link: &dyn crate::import_queue::Link<B>) { }
|
||||
|
||||
/// Import a Block justification and finalize the given block.
|
||||
fn import_justification(
|
||||
@@ -210,10 +210,10 @@ pub trait JustificationImport<B: BlockT> {
|
||||
|
||||
/// Finality proof import trait.
|
||||
pub trait FinalityProofImport<B: BlockT> {
|
||||
type Error: ::std::error::Error + Send + 'static;
|
||||
type Error: std::error::Error + Send + 'static;
|
||||
|
||||
/// Called by the import queue when it is started.
|
||||
fn on_start(&self, _link: &crate::import_queue::Link<B>) { }
|
||||
fn on_start(&self, _link: &dyn crate::import_queue::Link<B>) { }
|
||||
|
||||
/// Import a Block justification and finalize the given block. Returns finalized block or error.
|
||||
fn import_finality_proof(
|
||||
@@ -221,7 +221,7 @@ pub trait FinalityProofImport<B: BlockT> {
|
||||
hash: B::Hash,
|
||||
number: NumberFor<B>,
|
||||
finality_proof: Vec<u8>,
|
||||
verifier: &Verifier<B>,
|
||||
verifier: &dyn Verifier<B>,
|
||||
) -> Result<(B::Hash, NumberFor<B>), Self::Error>;
|
||||
}
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ pub enum Error {
|
||||
InvalidJustification,
|
||||
/// Some other error.
|
||||
#[display(fmt="Other error: {}", _0)]
|
||||
Other(Box<error::Error + Send>),
|
||||
Other(Box<dyn error::Error + Send>),
|
||||
/// Error from the client while importing
|
||||
#[display(fmt="Import failed: {}", _0)]
|
||||
ClientImport(String),
|
||||
|
||||
@@ -103,7 +103,7 @@ pub trait ImportQueue<B: BlockT>: Send + Sync {
|
||||
///
|
||||
/// This is called automatically by the network service when synchronization
|
||||
/// begins.
|
||||
fn start(&self, _link: Box<Link<B>>) -> Result<(), std::io::Error> {
|
||||
fn start(&self, _link: Box<dyn Link<B>>) -> Result<(), std::io::Error> {
|
||||
Ok(())
|
||||
}
|
||||
/// Import bunch of blocks.
|
||||
@@ -120,7 +120,7 @@ pub struct BasicSyncQueue<B: BlockT, V: Verifier<B>> {
|
||||
}
|
||||
|
||||
struct BasicSyncQueueData<B: BlockT, V: Verifier<B>> {
|
||||
link: Mutex<Option<Box<Link<B>>>>,
|
||||
link: Mutex<Option<Box<dyn Link<B>>>>,
|
||||
block_import: SharedBlockImport<B>,
|
||||
verifier: Arc<V>,
|
||||
justification_import: Option<SharedJustificationImport<B>>,
|
||||
@@ -147,7 +147,7 @@ impl<B: BlockT, V: Verifier<B>> BasicSyncQueue<B, V> {
|
||||
}
|
||||
|
||||
impl<B: BlockT, V: 'static + Verifier<B>> ImportQueue<B> for BasicSyncQueue<B, V> {
|
||||
fn start(&self, link: Box<Link<B>>) -> Result<(), std::io::Error> {
|
||||
fn start(&self, link: Box<dyn Link<B>>) -> Result<(), std::io::Error> {
|
||||
if let Some(justification_import) = self.data.justification_import.as_ref() {
|
||||
justification_import.on_start(&*link);
|
||||
}
|
||||
@@ -287,7 +287,7 @@ impl<B: BlockT> BasicQueue<B> {
|
||||
}
|
||||
|
||||
impl<B: BlockT> ImportQueue<B> for BasicQueue<B> {
|
||||
fn start(&self, link: Box<Link<B>>) -> Result<(), std::io::Error> {
|
||||
fn start(&self, link: Box<dyn Link<B>>) -> Result<(), std::io::Error> {
|
||||
let connect_err = || Err(std::io::Error::new(
|
||||
std::io::ErrorKind::Other,
|
||||
"Failed to connect import queue threads",
|
||||
@@ -328,7 +328,7 @@ pub enum BlockImportMsg<B: BlockT> {
|
||||
ImportBlocks(BlockOrigin, Vec<IncomingBlock<B>>),
|
||||
ImportJustification(Origin, B::Hash, NumberFor<B>, Justification),
|
||||
ImportFinalityProof(Origin, B::Hash, NumberFor<B>, Vec<u8>),
|
||||
Start(Box<Link<B>>, Sender<Result<(), std::io::Error>>),
|
||||
Start(Box<dyn Link<B>>, Sender<Result<(), std::io::Error>>),
|
||||
Shutdown(Sender<()>),
|
||||
#[cfg(any(test, feature = "test-helpers"))]
|
||||
Synchronize,
|
||||
@@ -360,7 +360,7 @@ struct BlockImporter<B: BlockT> {
|
||||
result_port: Receiver<BlockImportWorkerMsg<B>>,
|
||||
worker_sender: Option<Sender<BlockImportWorkerMsg<B>>>,
|
||||
link: Option<Box<dyn Link<B>>>,
|
||||
verifier: Arc<Verifier<B>>,
|
||||
verifier: Arc<dyn Verifier<B>>,
|
||||
justification_import: Option<SharedJustificationImport<B>>,
|
||||
finality_proof_import: Option<SharedFinalityProofImport<B>>,
|
||||
finality_proof_request_builder: Option<SharedFinalityProofRequestBuilder<B>>,
|
||||
@@ -370,7 +370,7 @@ impl<B: BlockT> BlockImporter<B> {
|
||||
fn new(
|
||||
result_port: Receiver<BlockImportWorkerMsg<B>>,
|
||||
worker_sender: Sender<BlockImportWorkerMsg<B>>,
|
||||
verifier: Arc<Verifier<B>>,
|
||||
verifier: Arc<dyn Verifier<B>>,
|
||||
justification_import: Option<SharedJustificationImport<B>>,
|
||||
finality_proof_import: Option<SharedFinalityProofImport<B>>,
|
||||
finality_proof_request_builder: Option<SharedFinalityProofRequestBuilder<B>>,
|
||||
@@ -667,7 +667,7 @@ pub enum BlockImportError {
|
||||
|
||||
/// Imports single notification and send notification to the link (if provided).
|
||||
fn import_single_justification<B: BlockT>(
|
||||
link: &Option<Box<Link<B>>>,
|
||||
link: &Option<Box<dyn Link<B>>>,
|
||||
justification_import: &Option<SharedJustificationImport<B>>,
|
||||
who: Origin,
|
||||
hash: B::Hash,
|
||||
@@ -723,7 +723,7 @@ fn import_single_finality_proof<B: BlockT, V: Verifier<B>>(
|
||||
|
||||
/// Process result of block(s) import.
|
||||
fn process_import_results<B: BlockT>(
|
||||
link: &Link<B>,
|
||||
link: &dyn Link<B>,
|
||||
results: Vec<(
|
||||
Result<BlockImportResult<NumberFor<B>>, BlockImportError>,
|
||||
B::Hash,
|
||||
@@ -801,7 +801,7 @@ fn process_import_results<B: BlockT>(
|
||||
|
||||
/// Import several blocks at once, returning import result for each block.
|
||||
fn import_many_blocks<B: BlockT, V: Verifier<B>>(
|
||||
import_handle: &BlockImport<B, Error = ConsensusError>,
|
||||
import_handle: &dyn BlockImport<B, Error = ConsensusError>,
|
||||
blocks_origin: BlockOrigin,
|
||||
blocks: Vec<IncomingBlock<B>>,
|
||||
verifier: Arc<V>,
|
||||
@@ -854,7 +854,7 @@ fn import_many_blocks<B: BlockT, V: Verifier<B>>(
|
||||
|
||||
/// Single block import function.
|
||||
pub fn import_single_block<B: BlockT, V: Verifier<B>>(
|
||||
import_handle: &BlockImport<B, Error = ConsensusError>,
|
||||
import_handle: &dyn BlockImport<B, Error = ConsensusError>,
|
||||
block_origin: BlockOrigin,
|
||||
block: IncomingBlock<B>,
|
||||
verifier: Arc<V>,
|
||||
|
||||
Reference in New Issue
Block a user