/// Creates most common consensus components used for testing. All components
/// share the same mocked registry with the provided records, so they refer to
/// the identical registry content at any time. The MockStateManager instance
/// that is returned contains no expectations.
Creates most common consensus components used for testing. All components
share the same mocked registry with the provided records, so they refer to
the identical registry content at any time. The MockStateManager instance
that is returned contains no expectations.
Creates most common consensus components used for testing . All components share the same mocked registry with the provided records so they refer to the identical registry content at any time . The MockStateManager instance that is returned contains no expectations .
pub fn dependencies_with_subnet_records_with_raw_state_manager(
    pool_config: ArtifactPoolConfig,
    subnet_id: SubnetId,
    records: Vec<(u64, SubnetRecord)>,
) -> Dependencies {
    let time_source = FastForwardTimeSource::new();
    let registry_version = RegistryVersion::from(records[0].clone().0);
    let (registry_data_provider, registry) = setup_registry_non_final(subnet_id, records);
    registry_data_provider
        .add(
            ROOT_SUBNET_ID_KEY,
            registry_version,
            Some(ic_types::subnet_id_into_protobuf(subnet_test_id(0))),
        )
        .unwrap();
    registry.update_to_latest_version();
    let replica_config = ReplicaConfig {
        subnet_id,
        node_id: node_test_id(0),
    };
    let crypto = Arc::new(CryptoReturningOk::default());
    let state_manager = Arc::new(RefMockStateManager::default());
    let dkg_pool = Arc::new(RwLock::new(DkgPoolImpl::new(
        ic_metrics::MetricsRegistry::new(),
    )));
    let ecdsa_pool = Arc::new(RwLock::new(EcdsaPoolImpl::new(
        ic_logger::replica_logger::no_op_logger(),
        ic_metrics::MetricsRegistry::new(),
    )));
    let pool = TestConsensusPool::new(
        subnet_id,
        pool_config,
        time_source.clone(),
        registry.clone(),
        crypto.clone(),
        state_manager.clone(),
        Some(dkg_pool.clone()),
    );
    let membership = Arc::new(Membership::new(
        pool.get_cache(),
        registry.clone(),
        subnet_id,
    ));
    Dependencies {
        crypto,
        registry,
        registry_data_provider,
        membership,
        time_source,
        pool,
        replica_config,
        state_manager,
        dkg_pool,
        ecdsa_pool,
    }
}
pub fn dependencies_with_subnet_records_with_raw_state_manager ( pool_config : ArtifactPoolConfig , subnet_id : SubnetId , records : Vec < ( u64 , SubnetRecord ) > , ) -> Dependencies { let time_source = FastForwardTimeSource :: new ( ) ; let registry_version = RegistryVersion :: from ( records [ 0 ] . clone ( ) . 0 ) ; let ( registry_data_provider , registry ) = setup_registry_non_final ( subnet_id , records ) ; registry_data_provider . add ( ROOT_SUBNET_ID_KEY , registry_version , Some ( ic_types :: subnet_id_into_protobuf ( subnet_test_id ( 0 ) ) ) , ) . unwrap ( ) ; registry . update_to_latest_version ( ) ; let replica_config = ReplicaConfig { subnet_id , node_id : node_test_id ( 0 ) , } ; let crypto = Arc :: new ( CryptoReturningOk :: default ( ) ) ; let state_manager = Arc :: new ( RefMockStateManager :: default ( ) ) ; let dkg_pool = Arc :: new ( RwLock :: new ( DkgPoolImpl :: new ( ic_metrics :: MetricsRegistry :: new ( ) , ) ) ) ; let ecdsa_pool = Arc :: new ( RwLock :: new ( EcdsaPoolImpl :: new ( ic_logger :: replica_logger :: no_op_logger ( ) , ic_metrics :: MetricsRegistry :: new ( ) , ) ) ) ; let pool = TestConsensusPool :: new ( subnet_id , pool_config , time_source . clone ( ) , registry . clone ( ) , crypto . clone ( ) , state_manager . clone ( ) , Some ( dkg_pool . clone ( ) ) , ) ; let membership = Arc :: new ( Membership :: new ( pool . get_cache ( ) , registry . clone ( ) , subnet_id , ) ) ; Dependencies { crypto , registry , registry_data_provider , membership , time_source , pool , replica_config , state_manager , dkg_pool , ecdsa_pool , } }
Creates most common consensus components used for testing.
Creates most common consensus components used for testing .
pool_config
ArtifactPoolConfig
subnet_id
SubnetId
records
Vec<(u64, SubnetRecord)>