/// Creates a new test pool. `registry_version_for_genesis` is used to
/// create the genesis block with data from the provided registry.
Creates a new test pool. `registry_version_for_genesis` is used to
create the genesis block with data from the provided registry.
Creates a new test pool . ` registry_version_for_genesis ` is used to create the genesis block with data from the provided registry .
pub fn new(
        subnet_id: SubnetId,
        pool_config: ArtifactPoolConfig,
        time_source: Arc<dyn TimeSource>,
        registry_client: Arc<dyn RegistryClient>,
        crypto: Arc<CryptoReturningOk>,
        state_manager: Arc<dyn StateManager<State = ReplicatedState>>,
        dkg_pool: Option<Arc<RwLock<DkgPoolImpl>>>,
    ) -> Self {
        let dkg_payload_builder =
            Box::new(dkg_payload_builder_fn(
                subnet_id,
                registry_client.clone(),
                crypto,
                state_manager.clone(),
                dkg_pool.unwrap_or_else(|| {
                    Arc::new(std::sync::RwLock::new(
                        ic_artifact_pool::dkg_pool::DkgPoolImpl::new(
                            ic_metrics::MetricsRegistry::new(),
                        ),
                    ))
                }),
            ));
        let summary = ic_consensus::dkg::make_genesis_summary(&*registry_client, subnet_id, None);
        let pool = ConsensusPoolImpl::new_from_cup_without_bytes(
            subnet_id,
            ic_test_utilities::consensus::make_genesis(summary),
            pool_config,
            ic_metrics::MetricsRegistry::new(),
            no_op_logger(),
        );
        TestConsensusPool {
            registry_client,
            pool,
            time_source,
            dkg_payload_builder,
        }
    }
pub fn new ( subnet_id : SubnetId , pool_config : ArtifactPoolConfig , time_source : Arc < dyn TimeSource > , registry_client : Arc < dyn RegistryClient > , crypto : Arc < CryptoReturningOk > , state_manager : Arc < dyn StateManager < State = ReplicatedState > > , dkg_pool : Option < Arc < RwLock < DkgPoolImpl > > > , ) -> Self { let dkg_payload_builder = Box :: new ( dkg_payload_builder_fn ( subnet_id , registry_client . clone ( ) , crypto , state_manager . clone ( ) , dkg_pool . unwrap_or_else ( | | { Arc :: new ( std :: sync :: RwLock :: new ( ic_artifact_pool :: dkg_pool :: DkgPoolImpl :: new ( ic_metrics :: MetricsRegistry :: new ( ) , ) , ) ) } ) , ) ) ; let summary = ic_consensus :: dkg :: make_genesis_summary ( & * registry_client , subnet_id , None ) ; let pool = ConsensusPoolImpl :: new_from_cup_without_bytes ( subnet_id , ic_test_utilities :: consensus :: make_genesis ( summary ) , pool_config , ic_metrics :: MetricsRegistry :: new ( ) , no_op_logger ( ) , ) ; TestConsensusPool { registry_client , pool , time_source , dkg_payload_builder , } }
Creates a new test pool.
Creates a new test pool .
subnet_id
SubnetId
pool_config
ArtifactPoolConfig
time_source
Arc<dyn TimeSource>
registry_client
Arc<dyn RegistryClient>
crypto
Arc<CryptoReturningOk>
state_manager
Arc<dyn StateManager<State = ReplicatedState>>
dkg_pool
Option<Arc<RwLock<DkgPoolImpl>>>