pub fn canister_can_manage_other_canister_batched(handle: IcHandle, ctx: &ic_fondue::pot::Context) {
    let mut rng = ctx.rng.clone();
    let rt = tokio::runtime::Runtime::new().expect("Could not create tokio runtime.");
    rt.block_on({
        async move {
            let endpoint = get_random_nns_node_endpoint(&handle, &mut rng);
            endpoint.assert_ready(ctx).await;
            let agent = assert_create_agent(endpoint.url.as_str()).await;

            let canister_a = UniversalCanister::new(&agent).await;
            let canister_b = canister_a
                .update(wasm().call(management::create_canister(2_000_000_000_000)))
                .await
                .map(|res| {
                    Decode!(res.as_slice(), CreateCanisterResult)
                        .unwrap()
                        .canister_id
                })
                .unwrap();

            let arbitrary_bytes = b";ioapusdvzn,x";
            let res = canister_a
                .update(
                    wasm().call(
                        management::install_code(canister_b, UNIVERSAL_CANISTER_WASM.to_vec())
                            .on_reply(wasm().inter_update(
                                canister_b,
                                call_args().other_side(wasm().reply_data(arbitrary_bytes)),
                            )),
                    ),
                )
                .await
                .unwrap();
            assert_eq!(res, arbitrary_bytes);
        }
    })
}
/// Canister A creates canister B; installs wasm on it; and then executes some
/// code on it; The creation is done in one step and the other two in a single
/// step.
Canister A creates canister B; installs wasm on it; and then executes some
code on it; The creation is done in one step and the other two in a single
step.
Canister A creates canister B ; installs wasm on it ; and then executes some code on it ; The creation is done in one step and the other two in a single step .
pub fn canister_can_manage_other_canister_batched(handle: IcHandle, ctx: &ic_fondue::pot::Context) {
    let mut rng = ctx.rng.clone();
    let rt = tokio::runtime::Runtime::new().expect("Could not create tokio runtime.");
    rt.block_on({
        async move {
            let endpoint = get_random_nns_node_endpoint(&handle, &mut rng);
            endpoint.assert_ready(ctx).await;
            let agent = assert_create_agent(endpoint.url.as_str()).await;
            let canister_a = UniversalCanister::new(&agent).await;
            let canister_b = canister_a
                .update(wasm().call(management::create_canister(2_000_000_000_000)))
                .await
                .map(|res| {
                    Decode!(res.as_slice(), CreateCanisterResult)
                        .unwrap()
                        .canister_id
                })
                .unwrap();
            let arbitrary_bytes = b";ioapusdvzn,x";
            let res = canister_a
                .update(
                    wasm().call(
                        management::install_code(canister_b, UNIVERSAL_CANISTER_WASM.to_vec())
                            .on_reply(wasm().inter_update(
                                canister_b,
                                call_args().other_side(wasm().reply_data(arbitrary_bytes)),
                            )),
                    ),
                )
                .await
                .unwrap();
            assert_eq!(res, arbitrary_bytes);
        }
    })
}
pub fn canister_can_manage_other_canister_batched ( handle : IcHandle , ctx : & ic_fondue :: pot :: Context ) { let mut rng = ctx . rng . clone ( ) ; let rt = tokio :: runtime :: Runtime :: new ( ) . expect ( " " ) ; rt . block_on ( { async move { let endpoint = get_random_nns_node_endpoint ( & handle , & mut rng ) ; endpoint . assert_ready ( ctx ) . await ; let agent = assert_create_agent ( endpoint . url . as_str ( ) ) . await ; let canister_a = UniversalCanister :: new ( & agent ) . await ; let canister_b = canister_a . update ( wasm ( ) . call ( management :: create_canister ( 2_000_000_000_000 ) ) ) . await . map ( | res | { Decode ! ( res as_slice ( ) CreateCanisterResult ) . unwrap ( ) . canister_id } ) . unwrap ( ) ; let arbitrary_bytes = b" " ; let res = canister_a . update ( wasm ( ) . call ( management :: install_code ( canister_b , UNIVERSAL_CANISTER_WASM . to_vec ( ) ) . on_reply ( wasm ( ) . inter_update ( canister_b , call_args ( ) . other_side ( wasm ( ) . reply_data ( arbitrary_bytes ) ) , ) ) , ) , ) . await . unwrap ( ) ; assert_eq ! ( res arbitrary_bytes ) ; } } ) }
Canister A creates canister B; installs wasm on it; and then executes some
code on it; The creation is done in one step and the other two in a single
step.
Canister A creates canister B ; installs wasm on it ; and then executes some code on it ; The creation is done in one step and the other two in a single step .
handle
IcHandle
ctx
&ic_fondue::pot::Context
handle
IcHandle
ctx
&ic_fondue::pot::Context