Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
cargo +nightly fmt --all
  • Loading branch information
tomusdrw committed Sep 14, 2021
commit 9ac02a64e53e35f71d1ab47bba37c8ec535802f7
19 changes: 9 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions bin/node/bench/src/construct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ use std::{borrow::Cow, collections::HashMap, pin::Pin, sync::Arc};

use node_primitives::Block;
use node_testing::bench::{BenchDb, BlockType, DatabaseType, KeyTypes, Profile};
use sc_transaction_pool_api::{ImportNotificationStream, PoolFuture, PoolStatus, ReadyTransactions, TransactionFor, TransactionSource, TransactionStatusStreamFor, TxHash};
use sc_transaction_pool_api::{
ImportNotificationStream, PoolFuture, PoolStatus, ReadyTransactions, TransactionFor,
TransactionSource, TransactionStatusStreamFor, TxHash,
};
use sp_consensus::{Environment, Proposer};
use sp_inherents::InherentDataProvider;
use sp_runtime::{generic::BlockId, traits::NumberFor, OpaqueExtrinsic};
Expand Down Expand Up @@ -267,8 +270,9 @@ impl sc_transaction_pool_api::TransactionPool for Transactions {
_at: NumberFor<Self::Block>,
) -> Pin<
Box<
dyn Future<Output = Box<dyn ReadyTransactions<Item = Arc<Self::InPoolTransaction>> + Send>>
+ Send,
dyn Future<
Output = Box<dyn ReadyTransactions<Item = Arc<Self::InPoolTransaction>> + Send>,
> + Send,
>,
> {
let iter: Box<dyn ReadyTransactions<Item = Arc<PoolTransaction>> + Send> =
Expand Down
5 changes: 3 additions & 2 deletions client/transaction-pool/api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,9 @@ pub trait TransactionPool: Send + Sync {
at: NumberFor<Self::Block>,
) -> Pin<
Box<
dyn Future<Output = Box<dyn ReadyTransactions<Item = Arc<Self::InPoolTransaction>> + Send>>
+ Send,
dyn Future<
Output = Box<dyn ReadyTransactions<Item = Arc<Self::InPoolTransaction>> + Send>,
> + Send,
>,
>;

Expand Down
5 changes: 4 additions & 1 deletion client/transaction-pool/src/graph/base_pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ use sp_runtime::{
},
};

use super::{future::{FutureTransactions, WaitingTransaction}, ready::{BestIterator, ReadyTransactions}};
use super::{
future::{FutureTransactions, WaitingTransaction},
ready::{BestIterator, ReadyTransactions},
};

/// Successful import result.
#[derive(Debug, PartialEq, Eq)]
Expand Down
10 changes: 6 additions & 4 deletions client/transaction-pool/src/graph/ready.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use std::{
sync::Arc,
};

use log::{trace, debug};
use log::{debug, trace};
use sc_transaction_pool_api::error;
use serde::Serialize;
use sp_runtime::{traits::Member, transaction_validity::TransactionTag as Tag};
Expand Down Expand Up @@ -506,7 +506,9 @@ impl<Hash: hash::Hash + Member, Ex> BestIterator<Hash, Ex> {
}
}

impl<Hash: hash::Hash + Member, Ex> sc_transaction_pool_api::ReadyTransactions for BestIterator<Hash, Ex> {
impl<Hash: hash::Hash + Member, Ex> sc_transaction_pool_api::ReadyTransactions
for BestIterator<Hash, Ex>
{
fn report_invalid(&mut self) {
BestIterator::report_invalid(self)
}
Expand Down Expand Up @@ -548,7 +550,7 @@ impl<Hash: hash::Hash + Member, Ex> Iterator for BestIterator<Hash, Ex> {
"[{:?}] Skipping invalid child transaction while iterating.",
hash
);
continue;
continue
}

let next = self.all.read().get(hash).cloned();
Expand Down Expand Up @@ -577,7 +579,7 @@ impl<Hash: hash::Hash + Member, Ex> Iterator for BestIterator<Hash, Ex> {
}

self.last_returned = Some(ready);
return Some(best.transaction);
return Some(best.transaction)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion client/transaction-pool/src/graph/validated_pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use std::{
use futures::channel::mpsc::{channel, Sender};
use parking_lot::{Mutex, RwLock};
use retain_mut::RetainMut;
use sc_transaction_pool_api::{PoolStatus, ReadyTransactions, error};
use sc_transaction_pool_api::{error, PoolStatus, ReadyTransactions};
use serde::Serialize;
use sp_runtime::{
generic::BlockId,
Expand Down
4 changes: 2 additions & 2 deletions client/transaction-pool/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ use std::{
use graph::{ExtrinsicHash, IsValidator};
use sc_transaction_pool_api::{
ChainEvent, ImportNotificationStream, MaintainedTransactionPool, PoolFuture, PoolStatus,
TransactionFor, TransactionPool, TransactionSource, TransactionStatusStreamFor, TxHash,
ReadyTransactions
ReadyTransactions, TransactionFor, TransactionPool, TransactionSource,
TransactionStatusStreamFor, TxHash,
};
use sp_core::traits::SpawnEssentialNamed;
use sp_runtime::{
Expand Down