mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 09:21:04 +00:00
Tests for new network code (#897)
* move protocol.rs into subfolder * add trait for mocking network behavior * add a mock version of network ops * remove some redundant parameters from service messages * ensure fetching erasure chunks automatically cancels * introduce dummy ProvideRuntimeApi * abstract over gossip somewhat * add mock gossip handler * skeleton test * remove dependence of shared table on router * remove worker dependence on its own sender * test shutdown * add tests * test that gossip streams are cleaned up correctly * refactor worker out into its own struct and reduce bound on executor * remove reliance of tests on global thread pool
This commit is contained in:
committed by
GitHub
parent
a81d8cb220
commit
260b2fa336
@@ -197,7 +197,6 @@ impl<Client, TxPool, Backend> consensus::Proposer<Block> for Proposer<Client, Tx
|
||||
parent_id,
|
||||
client,
|
||||
transaction_pool,
|
||||
table,
|
||||
inherent_data: Some(inherent_data),
|
||||
inherent_digests,
|
||||
// leave some time for the proposal finalisation
|
||||
@@ -216,7 +215,7 @@ impl<Client, TxPool, Backend> consensus::Proposer<Block> for Proposer<Client, Tx
|
||||
Delay::new(enough_candidates).await;
|
||||
|
||||
tokio::task::spawn_blocking(move || {
|
||||
let proposed_candidates = data.table.proposed_set();
|
||||
let proposed_candidates = table.proposed_set();
|
||||
data.propose_with(proposed_candidates)
|
||||
})
|
||||
.await?
|
||||
@@ -235,7 +234,6 @@ struct CreateProposalData<Client, TxPool, Backend> {
|
||||
parent_id: BlockId,
|
||||
client: Arc<Client>,
|
||||
transaction_pool: Arc<TxPool>,
|
||||
table: Arc<crate::SharedTable>,
|
||||
inherent_data: Option<InherentData>,
|
||||
inherent_digests: DigestFor<Block>,
|
||||
deadline: Instant,
|
||||
|
||||
Reference in New Issue
Block a user