/// Tests whether creating a canister on another subnet is possible from an NNS
/// canister.
Tests whether creating a canister on another subnet is possible from an NNS
canister.
Tests whether creating a canister on another subnet is possible from an NNS canister .
pub fn nns_canister_attempt_to_create_canister_on_another_subnet_succeeds(
    handle: IcHandle,
    ctx: &ic_fondue::pot::Context,
) {
    let rt = tokio::runtime::Runtime::new().expect("Could not create tokio runtime.");
    let mut rng = ctx.rng.clone();
    rt.block_on(async move {
        let nns_endpoint = get_random_nns_node_endpoint(&handle, &mut rng);
        nns_endpoint.assert_ready(ctx).await;
        let agent = assert_create_agent(nns_endpoint.url.as_str()).await;
        let uni_can = UniversalCanister::new_with_cycles(&agent, 900_000_000_000_000_u64).await;
        let other_subnet = get_random_non_nns_node_endpoint(&handle, &mut rng)
            .subnet_id()
            .unwrap();
        uni_can
            .forward_with_cycles_to(
                &other_subnet.get().into(),
                "create_canister",
                Encode!().unwrap(),
                100_000_000_000_000,
            )
            .await
            .map(|res| {
                Decode!(res.as_slice(), CreateCanisterResult)
                    .unwrap()
                    .canister_id
            })
            .unwrap();
    });
}
pub fn nns_canister_attempt_to_create_canister_on_another_subnet_succeeds ( handle : IcHandle , ctx : & ic_fondue :: pot :: Context , ) { let rt = tokio :: runtime :: Runtime :: new ( ) . expect ( " " ) ; let mut rng = ctx . rng . clone ( ) ; rt . block_on ( async move { let nns_endpoint = get_random_nns_node_endpoint ( & handle , & mut rng ) ; nns_endpoint . assert_ready ( ctx ) . await ; let agent = assert_create_agent ( nns_endpoint . url . as_str ( ) ) . await ; let uni_can = UniversalCanister :: new_with_cycles ( & agent , 900_000_000_000_000_u64 ) . await ; let other_subnet = get_random_non_nns_node_endpoint ( & handle , & mut rng ) . subnet_id ( ) . unwrap ( ) ; uni_can . forward_with_cycles_to ( & other_subnet . get ( ) . into ( ) , " " , Encode ! ( ) . unwrap ( ) , 100_000_000_000_000 , ) . await . map ( | res | { Decode ! ( res as_slice ( ) CreateCanisterResult ) . unwrap ( ) . canister_id } ) . unwrap ( ) ; } ) ; }
Tests whether creating a canister on another subnet is possible from an NNS
canister.
Tests whether creating a canister on another subnet is possible from an NNS canister .
handle
IcHandle
ctx
&ic_fondue::pot::Context