async fn add_data_centers(nns_canisters: &NnsCanisters<'_>) {
    let data_centers = vec![
        DataCenterRecord {
            id: "AN1".into(),
            region: "EU,Belgium,Antwerp".into(),
            owner: "Alice".into(),
            gps: None,
        },
        DataCenterRecord {
            id: "BC1".into(),
            region: "North America,Canada,BC".into(),
            owner: "Bob".into(),
            gps: None,
        },
        DataCenterRecord {
            id: "FM1".into(),
            region: "North America,US,CA,Fremont".into(),
            owner: "Carol".into(),
            gps: None,
        },
    ];

    let payload = AddOrRemoveDataCentersProposalPayload {
        data_centers_to_add: data_centers,
        data_centers_to_remove: vec![],
    };

    let proposal_id: ProposalId = submit_external_update_proposal(
        &nns_canisters.governance,
        Sender::from_keypair(&TEST_NEURON_1_OWNER_KEYPAIR),
        NeuronId(TEST_NEURON_1_ID),
        NnsFunction::AddOrRemoveDataCenters,
        payload.clone(),
        "<proposal created by test_get_monthly_node_provider_rewards>".to_string(),
        "".to_string(),
    )
    .await;

    // Wait for the proposal to be accepted and executed.
    assert_eq!(
        wait_for_final_state(&nns_canisters.governance, proposal_id)
            .await
            .status(),
        ProposalStatus::Executed
    );

    // No proposals should be pending now.
    let pending_proposals = get_pending_proposals(&nns_canisters.governance).await;
    assert_eq!(pending_proposals, vec![]);
}
/// Add test Data Centers to the Registry
Add test Data Centers to the Registry
Add test Data Centers to the Registry
async fn add_data_centers(nns_canisters: &NnsCanisters<'_>) {
    let data_centers = vec![
        DataCenterRecord {
            id: "AN1".into(),
            region: "EU,Belgium,Antwerp".into(),
            owner: "Alice".into(),
            gps: None,
        },
        DataCenterRecord {
            id: "BC1".into(),
            region: "North America,Canada,BC".into(),
            owner: "Bob".into(),
            gps: None,
        },
        DataCenterRecord {
            id: "FM1".into(),
            region: "North America,US,CA,Fremont".into(),
            owner: "Carol".into(),
            gps: None,
        },
    ];
    let payload = AddOrRemoveDataCentersProposalPayload {
        data_centers_to_add: data_centers,
        data_centers_to_remove: vec![],
    };
    let proposal_id: ProposalId = submit_external_update_proposal(
        &nns_canisters.governance,
        Sender::from_keypair(&TEST_NEURON_1_OWNER_KEYPAIR),
        NeuronId(TEST_NEURON_1_ID),
        NnsFunction::AddOrRemoveDataCenters,
        payload.clone(),
        "<proposal created by test_get_monthly_node_provider_rewards>".to_string(),
        "".to_string(),
    )
    .await;
    // Wait for the proposal to be accepted and executed.
    assert_eq!(
        wait_for_final_state(&nns_canisters.governance, proposal_id)
            .await
            .status(),
        ProposalStatus::Executed
    );
    // No proposals should be pending now.
    let pending_proposals = get_pending_proposals(&nns_canisters.governance).await;
    assert_eq!(pending_proposals, vec![]);
}
async fn add_data_centers ( nns_canisters : & NnsCanisters < ' _ > ) { let data_centers = vec ! [ DataCenterRecord { id " " into ( ) region " " into ( ) owner " " into ( ) gps None } DataCenterRecord { id " " into ( ) region " " into ( ) owner " " into ( ) gps None } DataCenterRecord { id " " into ( ) region " " into ( ) owner " " into ( ) gps None } ] ; let payload = AddOrRemoveDataCentersProposalPayload { data_centers_to_add : data_centers , data_centers_to_remove : vec ! [ ] , } ; let proposal_id : ProposalId = submit_external_update_proposal ( & nns_canisters . governance , Sender :: from_keypair ( & TEST_NEURON_1_OWNER_KEYPAIR ) , NeuronId ( TEST_NEURON_1_ID ) , NnsFunction :: AddOrRemoveDataCenters , payload . clone ( ) , " " . to_string ( ) , " " . to_string ( ) , ) . await ; // Wait for the proposal to be accepted and executed. assert_eq ! ( wait_for_final_state ( nns_canisters governance proposal_id ) await status ( ) ProposalStatus Executed ) ; // No proposals should be pending now. let pending_proposals = get_pending_proposals ( & nns_canisters . governance ) . await ; assert_eq ! ( pending_proposals vec [ ] ) ; }
Add test Data Centers to the Registry
Add test Data Centers to the Registry
nns_canisters
&NnsCanisters<'_>
nns_canisters
&NnsCanisters<'_>