Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit b1bb12d

Browse files
committed
Rename to offchain_tx_pool_factory
1 parent 67b1730 commit b1bb12d

File tree

8 files changed

+25
-25
lines changed

8 files changed

+25
-25
lines changed

bin/node-template/node/src/service.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ pub fn new_full(config: Configuration) -> Result<TaskManager, ServiceError> {
313313
prometheus_registry,
314314
shared_voter_state: SharedVoterState::empty(),
315315
telemetry: telemetry.as_ref().map(|x| x.handle()),
316-
offchain_tx_pool: OffchainTransactionPoolFactory::new(transaction_pool),
316+
offchain_tx_pool_factory: OffchainTransactionPoolFactory::new(transaction_pool),
317317
};
318318

319319
// the GRANDPA voter task is considered infallible, i.e.

bin/node/cli/src/service.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ pub fn new_partial(
227227
spawner: &task_manager.spawn_essential_handle(),
228228
registry: config.prometheus_registry(),
229229
telemetry: telemetry.as_ref().map(|x| x.handle()),
230-
offchain_tx_pool: OffchainTransactionPoolFactory::new(transaction_pool.clone()),
230+
offchain_tx_pool_factory: OffchainTransactionPoolFactory::new(transaction_pool.clone()),
231231
})?;
232232

233233
let import_setup = (block_import, grandpa_link, babe_link);
@@ -548,7 +548,7 @@ pub fn new_full_base(
548548
voting_rule: grandpa::VotingRulesBuilder::default().build(),
549549
prometheus_registry: prometheus_registry.clone(),
550550
shared_voter_state,
551-
offchain_tx_pool: OffchainTransactionPoolFactory::new(transaction_pool.clone()),
551+
offchain_tx_pool_factory: OffchainTransactionPoolFactory::new(transaction_pool.clone()),
552552
};
553553

554554
// the GRANDPA voter task is considered infallible, i.e.

client/consensus/babe/rpc/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ mod tests {
236236
spawner: &task_executor,
237237
registry: None,
238238
telemetry: None,
239-
offchain_tx_pool: OffchainTransactionPoolFactory::new(RejectAllTxPool::default()),
239+
offchain_tx_pool_factory: OffchainTransactionPoolFactory::new(RejectAllTxPool::default()),
240240
})
241241
.unwrap();
242242

client/consensus/babe/src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -993,7 +993,7 @@ pub struct BabeVerifier<Block: BlockT, Client, SelectChain, CIDP> {
993993
config: BabeConfiguration,
994994
epoch_changes: SharedEpochChanges<Block, Epoch>,
995995
telemetry: Option<TelemetryHandle>,
996-
offchain_tx_pool: OffchainTransactionPoolFactory<Block>,
996+
offchain_tx_pool_factory: OffchainTransactionPoolFactory<Block>,
997997
}
998998

999999
impl<Block, Client, SelectChain, CIDP> BabeVerifier<Block, Client, SelectChain, CIDP>
@@ -1102,7 +1102,7 @@ where
11021102
let mut runtime_api = self.client.runtime_api();
11031103

11041104
// Register the offchain tx pool to be able to use it from the runtime.
1105-
runtime_api.register_extension(self.offchain_tx_pool.offchain_transaction_pool(best_hash));
1105+
runtime_api.register_extension(self.offchain_tx_pool_factory.offchain_transaction_pool(best_hash));
11061106

11071107
runtime_api
11081108
.submit_report_equivocation_unsigned_extrinsic(
@@ -1801,7 +1801,7 @@ pub struct ImportQueueParams<'a, Block: BlockT, BI, Client, CIDP, SelectChain, S
18011801
/// The offchain transaction pool factory.
18021802
///
18031803
/// Will be used when sending equivocation reports.
1804-
pub offchain_tx_pool: OffchainTransactionPoolFactory<Block>,
1804+
pub offchain_tx_pool_factory: OffchainTransactionPoolFactory<Block>,
18051805
}
18061806

18071807
/// Start an import queue for the BABE consensus algorithm.
@@ -1824,7 +1824,7 @@ pub fn import_queue<Block: BlockT, Client, SelectChain, BI, CIDP, Spawn>(
18241824
spawner,
18251825
registry,
18261826
telemetry,
1827-
offchain_tx_pool,
1827+
offchain_tx_pool_factory,
18281828
}: ImportQueueParams<'_, Block, BI, Client, CIDP, SelectChain, Spawn>,
18291829
) -> ClientResult<(DefaultImportQueue<Block, Client>, BabeWorkerHandle<Block>)>
18301830
where
@@ -1857,7 +1857,7 @@ where
18571857
epoch_changes: babe_link.epoch_changes.clone(),
18581858
telemetry,
18591859
client: client.clone(),
1860-
offchain_tx_pool,
1860+
offchain_tx_pool_factory,
18611861
};
18621862

18631863
let (worker_tx, worker_rx) = channel(HANDLE_BUFFER_SIZE);

client/consensus/babe/src/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ impl TestNetFactory for BabeTestNet {
284284
config: data.link.config.clone(),
285285
epoch_changes: data.link.epoch_changes.clone(),
286286
telemetry: None,
287-
offchain_tx_pool: OffchainTransactionPoolFactory::new(RejectAllTxPool::default()),
287+
offchain_tx_pool_factory: OffchainTransactionPoolFactory::new(RejectAllTxPool::default()),
288288
},
289289
mutator: MUTATOR.with(|m| m.borrow().clone()),
290290
}

client/consensus/grandpa/src/environment.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ pub(crate) struct Environment<
446446
pub(crate) metrics: Option<Metrics>,
447447
pub(crate) justification_sender: Option<GrandpaJustificationSender<Block>>,
448448
pub(crate) telemetry: Option<TelemetryHandle>,
449-
pub(crate) offchain_tx_pool: OffchainTransactionPoolFactory<Block>,
449+
pub(crate) offchain_tx_pool_factory: OffchainTransactionPoolFactory<Block>,
450450
pub(crate) _phantom: PhantomData<Backend>,
451451
}
452452

@@ -576,7 +576,7 @@ where
576576
let mut runtime_api = self.client.runtime_api();
577577

578578
runtime_api
579-
.register_extension(self.offchain_tx_pool.offchain_transaction_pool(best_block_hash));
579+
.register_extension(self.offchain_tx_pool_factory.offchain_transaction_pool(best_block_hash));
580580

581581
runtime_api
582582
.submit_report_equivocation_unsigned_extrinsic(

client/consensus/grandpa/src/lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ pub struct GrandpaParams<Block: BlockT, C, N, S, SC, VR> {
692692
///
693693
/// This will be used to create an offchain transaction pool instance for sending an
694694
/// equivocation report from the runtime.
695-
pub offchain_tx_pool: OffchainTransactionPoolFactory<Block>,
695+
pub offchain_tx_pool_factory: OffchainTransactionPoolFactory<Block>,
696696
}
697697

698698
/// Returns the configuration value to put in
@@ -742,7 +742,7 @@ where
742742
prometheus_registry,
743743
shared_voter_state,
744744
telemetry,
745-
offchain_tx_pool,
745+
offchain_tx_pool_factory,
746746
} = grandpa_params;
747747

748748
// NOTE: we have recently removed `run_grandpa_observer` from the public
@@ -817,7 +817,7 @@ where
817817
shared_voter_state,
818818
justification_sender,
819819
telemetry,
820-
offchain_tx_pool,
820+
offchain_tx_pool_factory,
821821
);
822822

823823
let voter_work = voter_work.map(|res| match res {
@@ -887,7 +887,7 @@ where
887887
shared_voter_state: SharedVoterState,
888888
justification_sender: GrandpaJustificationSender<Block>,
889889
telemetry: Option<TelemetryHandle>,
890-
offchain_tx_pool: OffchainTransactionPoolFactory<Block>,
890+
offchain_tx_pool_factory: OffchainTransactionPoolFactory<Block>,
891891
) -> Self {
892892
let metrics = match prometheus_registry.as_ref().map(Metrics::register) {
893893
Some(Ok(metrics)) => Some(metrics),
@@ -912,7 +912,7 @@ where
912912
metrics: metrics.as_ref().map(|m| m.environment.clone()),
913913
justification_sender: Some(justification_sender),
914914
telemetry: telemetry.clone(),
915-
offchain_tx_pool,
915+
offchain_tx_pool_factory,
916916
_phantom: PhantomData,
917917
});
918918

@@ -1064,7 +1064,7 @@ where
10641064
metrics: self.env.metrics.clone(),
10651065
justification_sender: self.env.justification_sender.clone(),
10661066
telemetry: self.telemetry.clone(),
1067-
offchain_tx_pool: self.env.offchain_tx_pool.clone(),
1067+
offchain_tx_pool_factory: self.env.offchain_tx_pool_factory.clone(),
10681068
_phantom: PhantomData,
10691069
});
10701070

client/consensus/grandpa/src/tests.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ fn initialize_grandpa(
332332
voting_rule: (),
333333
prometheus_registry: None,
334334
shared_voter_state: SharedVoterState::empty(),
335-
offchain_tx_pool: OffchainTransactionPoolFactory::new(RejectAllTxPool::default()),
335+
offchain_tx_pool_factory: OffchainTransactionPoolFactory::new(RejectAllTxPool::default()),
336336
telemetry: None,
337337
};
338338
let voter =
@@ -483,7 +483,7 @@ async fn finalize_3_voters_1_full_observer() {
483483
prometheus_registry: None,
484484
shared_voter_state: SharedVoterState::empty(),
485485
telemetry: None,
486-
offchain_tx_pool: OffchainTransactionPoolFactory::new(RejectAllTxPool::default()),
486+
offchain_tx_pool_factory: OffchainTransactionPoolFactory::new(RejectAllTxPool::default()),
487487
};
488488

489489
run_grandpa_voter(grandpa_params).expect("all in order with client and network")
@@ -576,7 +576,7 @@ async fn transition_3_voters_twice_1_full_observer() {
576576
prometheus_registry: None,
577577
shared_voter_state: SharedVoterState::empty(),
578578
telemetry: None,
579-
offchain_tx_pool: OffchainTransactionPoolFactory::new(RejectAllTxPool::default()),
579+
offchain_tx_pool_factory: OffchainTransactionPoolFactory::new(RejectAllTxPool::default()),
580580
};
581581

582582
voters
@@ -1044,7 +1044,7 @@ async fn voter_persists_its_votes() {
10441044
prometheus_registry: None,
10451045
shared_voter_state: SharedVoterState::empty(),
10461046
telemetry: None,
1047-
offchain_tx_pool: OffchainTransactionPoolFactory::new(RejectAllTxPool::default()),
1047+
offchain_tx_pool_factory: OffchainTransactionPoolFactory::new(RejectAllTxPool::default()),
10481048
};
10491049

10501050
run_grandpa_voter(grandpa_params).expect("all in order with client and network")
@@ -1088,7 +1088,7 @@ async fn voter_persists_its_votes() {
10881088
prometheus_registry: None,
10891089
shared_voter_state: SharedVoterState::empty(),
10901090
telemetry: None,
1091-
offchain_tx_pool: OffchainTransactionPoolFactory::new(RejectAllTxPool::default()),
1091+
offchain_tx_pool_factory: OffchainTransactionPoolFactory::new(RejectAllTxPool::default()),
10921092
};
10931093

10941094
run_grandpa_voter(grandpa_params)
@@ -1299,7 +1299,7 @@ async fn voter_catches_up_to_latest_round_when_behind() {
12991299
prometheus_registry: None,
13001300
shared_voter_state: SharedVoterState::empty(),
13011301
telemetry: None,
1302-
offchain_tx_pool: OffchainTransactionPoolFactory::new(RejectAllTxPool::default()),
1302+
offchain_tx_pool_factory: OffchainTransactionPoolFactory::new(RejectAllTxPool::default()),
13031303
};
13041304

13051305
Box::pin(run_grandpa_voter(grandpa_params).expect("all in order with client and network"))
@@ -1429,7 +1429,7 @@ where
14291429
justification_sender: None,
14301430
telemetry: None,
14311431
_phantom: PhantomData,
1432-
offchain_tx_pool: OffchainTransactionPoolFactory::new(RejectAllTxPool::default()),
1432+
offchain_tx_pool_factory: OffchainTransactionPoolFactory::new(RejectAllTxPool::default()),
14331433
}
14341434
}
14351435

0 commit comments

Comments
 (0)