Skip to content
Snippets Groups Projects
Commit fd138d4a authored by Cecile Tonglet's avatar Cecile Tonglet Committed by GitHub
Browse files

Companion PR for substrate #7328 (#1825)


* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* Update node/service/src/lib.rs

Co-authored-by: default avatarBastian Köcher <bkchr@users.noreply.github.com>

* WIP

* "Update Substrate"

Co-authored-by: default avatarBastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: parity-processbot <>
parent 747103df
Branches
No related merge requests found
This diff is collapsed.
......@@ -6,6 +6,7 @@ use polkadot_primitives::v1::{
Block, Hash, Header,
};
use sc_block_builder::{BlockBuilderApi, BlockBuilderProvider};
use sp_core::traits::SpawnNamed;
use sp_api::{ApiExt, ProvideRuntimeApi};
use sp_blockchain::HeaderBackend;
use sp_consensus::{Proposal, RecordProof};
......@@ -25,12 +26,14 @@ pub struct ProposerFactory<TxPool, Backend, Client> {
impl<TxPool, Backend, Client> ProposerFactory<TxPool, Backend, Client> {
pub fn new(
spawn_handle: impl SpawnNamed + 'static,
client: Arc<Client>,
transaction_pool: Arc<TxPool>,
overseer: OverseerHandler,
) -> Self {
ProposerFactory {
inner: sc_basic_authorship::ProposerFactory::new(
spawn_handle,
client,
transaction_pool,
None,
......
......@@ -446,6 +446,7 @@ pub fn new_full<RuntimeApi, Executor>(
consensus_common::CanAuthorWithNativeVersion::new(client.executor().clone());
let proposer = ProposerFactory::new(
task_manager.spawn_handle(),
client.clone(),
transaction_pool,
overseer_handler.clone(),
......
......@@ -34,6 +34,7 @@ inherents = { package = "sp-inherents", git = "https://github.com/paritytech/sub
pallet-staking = { git = "https://github.com/paritytech/substrate", branch = "master" }
pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-chain-spec = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-cli = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-consensus = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-executor = { git = "https://github.com/paritytech/substrate", branch = "master" }
......
......@@ -60,6 +60,7 @@ native_executor_instance!(
);
/// Create a new Polkadot test service for a full node.
#[sc_cli::prefix_logs_with(config.network.node_name.as_str())]
pub fn polkadot_test_new_full(
config: Configuration,
authority_discovery_disabled: bool,
......@@ -112,14 +113,13 @@ pub fn node_config(
spec.set_storage(storage);
let mut network_config = NetworkConfiguration::new(
format!("Polkadot Test Node for: {}", key_seed),
key_seed.to_string(),
"network/test/0.1",
Default::default(),
None,
);
let informant_output_format = OutputFormat {
enable_color: false,
prefix: format!("[{}] ", key_seed),
};
network_config.boot_nodes = boot_nodes;
......
......@@ -28,6 +28,7 @@ use std::{
use sp_blockchain::HeaderBackend;
use block_builder::{BlockBuilderApi, BlockBuilderProvider};
use consensus::{Proposal, RecordProof};
use primitives::traits::SpawnNamed;
use polkadot_primitives::v0::{NEW_HEADS_IDENTIFIER, Block, Header, AttestedCandidate};
use runtime_primitives::traits::{DigestFor, HashFor};
use txpool_api::TransactionPool;
......@@ -47,11 +48,13 @@ pub struct ProposerFactory<Client, TxPool, Backend> {
impl<Client, TxPool, Backend> ProposerFactory<Client, TxPool, Backend> {
/// Create a new proposer factory.
pub fn new(
spawn_handle: Box<dyn SpawnNamed>,
client: Arc<Client>,
transaction_pool: Arc<TxPool>,
prometheus: Option<&PrometheusRegistry>,
) -> Self {
let factory = sc_basic_authorship::ProposerFactory::new(
spawn_handle,
client,
transaction_pool,
prometheus,
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment