/// Submit and execute a proposal to add the given node operator
Submit and execute a proposal to add the given node operator
Submit and execute a proposal to add the given node operator
async fn add_node_operator(
    nns_canisters: &NnsCanisters<'_>,
    no_id: &PrincipalId,
    np_id: &PrincipalId,
    dc_id: &str,
    rewardable_nodes: BTreeMap<String, u32>,
) {
    let proposal_payload = AddNodeOperatorPayload {
        node_operator_principal_id: Some(*no_id),
        node_allowance: 5,
        node_provider_principal_id: Some(*np_id),
        dc_id: dc_id.into(),
        rewardable_nodes,
    };
    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::AssignNoid,
        proposal_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_node_operator ( nns_canisters : & NnsCanisters < ' _ > , no_id : & PrincipalId , np_id : & PrincipalId , dc_id : & str , rewardable_nodes : BTreeMap < String , u32 > , ) { let proposal_payload = AddNodeOperatorPayload { node_operator_principal_id : Some ( * no_id ) , node_allowance : 5 , node_provider_principal_id : Some ( * np_id ) , dc_id : dc_id . into ( ) , rewardable_nodes , } ; 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 :: AssignNoid , proposal_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 [ ] ) ; }
Submit and execute a proposal to add the given node operator
Submit and execute a proposal to add the given node operator
nns_canisters
&NnsCanisters<'_>
no_id
&PrincipalId
np_id
&PrincipalId
dc_id
&str
rewardable_nodes
BTreeMap<String, u32>