pub async fn maybe_upgrade_root_controlled_canister_to_self(
    // nns_canisters is NOT passed by reference because of the canister to upgrade,
    // for which we have a mutable borrow.
    nns_canisters: NnsCanisters<'_>,
    canister: &mut Canister<'_>,
    stop_before_installing: bool,
    scenario: UpgradeTestingScenario,
) {
    if UpgradeTestingScenario::Always != scenario {
        return;
    }

    // Copy the wasm of the canister to upgrade. We'll need it to upgrade back to
    // it. To observe that the upgrade happens, we need to make the binary different
    // post-upgrade.
    let wasm = append_inert(Some(canister.wasm().unwrap()));
    let wasm_clone = wasm.clone().bytes();
    upgrade_nns_canister_by_proposal(
        canister,
        &nns_canisters.governance,
        &nns_canisters.root,
        stop_before_installing,
        wasm,
    )
    .await;
    canister.set_wasm(wasm_clone);
}
/// Depending on the testing scenario, upgrade the given root-controlled
/// canister to itself, or do nothing. This should only be called in NNS
/// integration tests, where the NNS canisters have their expected IDs.
///
/// This goes through MANY rounds of consensus, so expect it to be slow!
///
/// WARNING: this calls `execute_eligible_proposals` on the Proposals canister,
/// so it may have side effects!
Depending on the testing scenario, upgrade the given root-controlled
canister to itself, or do nothing. This should only be called in NNS
integration tests, where the NNS canisters have their expected IDs.

This goes through MANY rounds of consensus, so expect it to be slow!

this calls `execute_eligible_proposals` on the Proposals canister,
so it may have side effects!
Depending on the testing scenario upgrade the given root - controlled canister to itself or do nothing . This should only be called in NNS integration tests where the NNS canisters have their expected IDs . This goes through MANY rounds of consensus so expect it to be slow! this calls ` execute_eligible_proposals ` on the Proposals canister so it may have side effects!
pub async fn maybe_upgrade_root_controlled_canister_to_self(
    // nns_canisters is NOT passed by reference because of the canister to upgrade,
    // for which we have a mutable borrow.
    nns_canisters: NnsCanisters<'_>,
    canister: &mut Canister<'_>,
    stop_before_installing: bool,
    scenario: UpgradeTestingScenario,
) {
    if UpgradeTestingScenario::Always != scenario {
        return;
    }
    // Copy the wasm of the canister to upgrade. We'll need it to upgrade back to
    // it. To observe that the upgrade happens, we need to make the binary different
    // post-upgrade.
    let wasm = append_inert(Some(canister.wasm().unwrap()));
    let wasm_clone = wasm.clone().bytes();
    upgrade_nns_canister_by_proposal(
        canister,
        &nns_canisters.governance,
        &nns_canisters.root,
        stop_before_installing,
        wasm,
    )
    .await;
    canister.set_wasm(wasm_clone);
}
pub async fn maybe_upgrade_root_controlled_canister_to_self ( // nns_canisters is NOT passed by reference because of the canister to upgrade, // for which we have a mutable borrow. nns_canisters : NnsCanisters < ' _ > , canister : & mut Canister < ' _ > , stop_before_installing : bool , scenario : UpgradeTestingScenario , ) { if UpgradeTestingScenario :: Always != scenario { return ; } // Copy the wasm of the canister to upgrade. We'll need it to upgrade back to // it. To observe that the upgrade happens, we need to make the binary different // post-upgrade. let wasm = append_inert ( Some ( canister . wasm ( ) . unwrap ( ) ) ) ; let wasm_clone = wasm . clone ( ) . bytes ( ) ; upgrade_nns_canister_by_proposal ( canister , & nns_canisters . governance , & nns_canisters . root , stop_before_installing , wasm , ) . await ; canister . set_wasm ( wasm_clone ) ; }
Depending on the testing scenario, upgrade the given root-controlled
canister to itself, or do nothing.
Depending on the testing scenario upgrade the given root - controlled canister to itself or do nothing .
nns_canisters
NnsCanisters<'_>
canister
&mut Canister<'_>
stop_before_installing
bool
scenario
UpgradeTestingScenario
nns_canisters
NnsCanisters<'_>
canister
&mut Canister<'_>
stop_before_installing
bool
scenario
UpgradeTestingScenario