/// Submit and execute a proposal to add the given node provider
Submit and execute a proposal to add the given node provider
Submit and execute a proposal to add the given node provider
async fn add_node_provider(nns_canisters: &NnsCanisters<'_>, np: NodeProvider) {
    let result: ManageNeuronResponse = nns_canisters
        .governance
        .update_from_sender(
            "manage_neuron",
            candid_one,
            ManageNeuron {
                neuron_id_or_subaccount: Some(NeuronIdOrSubaccount::NeuronId(
                    ic_nns_common::pb::v1::NeuronId {
                        id: TEST_NEURON_1_ID,
                    },
                )),
                id: None,
                command: Some(Command::MakeProposal(Box::new(Proposal {
                    title: Some("".to_string()),
                    summary: "".to_string(),
                    url: "".to_string(),
                    action: Some(Action::AddOrRemoveNodeProvider(AddOrRemoveNodeProvider {
                        change: Some(Change::ToAdd(np)),
                    })),
                }))),
            },
            &Sender::from_keypair(&TEST_NEURON_1_OWNER_KEYPAIR),
        )
        .await
        .expect("Error calling the manage_neuron api.");
    let pid = match result.expect("Error making proposal").command.unwrap() {
        CommandResponse::MakeProposal(resp) => resp.proposal_id.unwrap(),
        _ => panic!("Invalid response"),
    };
    // Wait for the proposal to be accepted and executed.
    assert_eq!(
        wait_for_final_state(&nns_canisters.governance, ProposalId::from(pid))
            .await
            .status(),
        ProposalStatus::Executed
    );
}
async fn add_node_provider ( nns_canisters : & NnsCanisters < ' _ > , np : NodeProvider ) { let result : ManageNeuronResponse = nns_canisters . governance . update_from_sender ( " " , candid_one , ManageNeuron { neuron_id_or_subaccount : Some ( NeuronIdOrSubaccount :: NeuronId ( ic_nns_common :: pb :: v1 :: NeuronId { id : TEST_NEURON_1_ID , } , ) ) , id : None , command : Some ( Command :: MakeProposal ( Box :: new ( Proposal { title : Some ( " " . to_string ( ) ) , summary : " " . to_string ( ) , url : " " . to_string ( ) , action : Some ( Action :: AddOrRemoveNodeProvider ( AddOrRemoveNodeProvider { change : Some ( Change :: ToAdd ( np ) ) , } ) ) , } ) ) ) , } , & Sender :: from_keypair ( & TEST_NEURON_1_OWNER_KEYPAIR ) , ) . await . expect ( " " ) ; let pid = match result . expect ( " " ) . command . unwrap ( ) { CommandResponse :: MakeProposal ( resp ) => resp . proposal_id . unwrap ( ) , _ => panic ! ( " " ) , } ; // Wait for the proposal to be accepted and executed. assert_eq ! ( wait_for_final_state ( nns_canisters governance ProposalId from ( pid ) ) await status ( ) ProposalStatus Executed ) ; }
Submit and execute a proposal to add the given node provider
Submit and execute a proposal to add the given node provider
nns_canisters
&NnsCanisters<'_>
np
NodeProvider