mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 06:57:58 +00:00
Simplify a few chain components creation APIs related to the service (#6611)
* Simplify a few chain components creation APIs related to the service * Fix basic-authorship doc tests * Remove DefaultQueue * Update client/service/src/builder.rs Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com> * Move ExecutionExtensions comment around * Remove unused BlakeTwo256 Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
This commit is contained in:
@@ -84,6 +84,10 @@ pub struct ExecutionExtensions<Block: traits::Block> {
|
||||
keystore: Option<BareCryptoStorePtr>,
|
||||
// FIXME: these two are only RwLock because of https://github.com/paritytech/substrate/issues/4587
|
||||
// remove when fixed.
|
||||
// To break retain cycle between `Client` and `TransactionPool` we require this
|
||||
// extension to be a `Weak` reference.
|
||||
// That's also the reason why it's being registered lazily instead of
|
||||
// during initialization.
|
||||
transaction_pool: RwLock<Option<Weak<dyn sp_transaction_pool::OffchainSubmitTransaction<Block>>>>,
|
||||
extensions_factory: RwLock<Box<dyn ExtensionsFactory>>,
|
||||
}
|
||||
@@ -121,13 +125,10 @@ impl<Block: traits::Block> ExecutionExtensions<Block> {
|
||||
}
|
||||
|
||||
/// Register transaction pool extension.
|
||||
///
|
||||
/// To break retain cycle between `Client` and `TransactionPool` we require this
|
||||
/// extension to be a `Weak` reference.
|
||||
/// That's also the reason why it's being registered lazily instead of
|
||||
/// during initialization.
|
||||
pub fn register_transaction_pool(&self, pool: Weak<dyn sp_transaction_pool::OffchainSubmitTransaction<Block>>) {
|
||||
*self.transaction_pool.write() = Some(pool);
|
||||
pub fn register_transaction_pool<T>(&self, pool: &Arc<T>)
|
||||
where T: sp_transaction_pool::OffchainSubmitTransaction<Block> + 'static
|
||||
{
|
||||
*self.transaction_pool.write() = Some(Arc::downgrade(&pool) as _);
|
||||
}
|
||||
|
||||
/// Create `ExecutionManager` and `Extensions` for given offchain call.
|
||||
|
||||
Reference in New Issue
Block a user