/// Tests whether a call to `setup_initial_dkg` is rejected when called from a
/// canister installed on an application subnet.
Tests whether a call to `setup_initial_dkg` is rejected when called from a
canister installed on an application subnet.
Tests whether a call to ` setup_initial_dkg ` is rejected when called from a canister installed on an application subnet .
pub fn app_canister_attempt_initiating_dkg_fails(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 endpoint = get_random_application_node_endpoint(&handle, &mut rng);
        endpoint.assert_ready(ctx).await;
        let agent = assert_create_agent(endpoint.url.as_str()).await;
        let node_ids: Vec<_> = (0..4).map(node_test_id).collect();
        let request = SetupInitialDKGArgs::new(node_ids, RegistryVersion::from(2));
        let uni_can = UniversalCanister::new(&agent).await;
        let res = uni_can
            .forward_to(
                &Principal::management_canister(),
                "setup_initial_dkg",
                Encode!(&request).unwrap(),
            )
            .await;
        assert_reject(res, RejectCode::CanisterReject);
    });
}
pub fn app_canister_attempt_initiating_dkg_fails ( 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 endpoint = get_random_application_node_endpoint ( & handle , & mut rng ) ; endpoint . assert_ready ( ctx ) . await ; let agent = assert_create_agent ( endpoint . url . as_str ( ) ) . await ; let node_ids : Vec < _ > = ( 0 .. 4 ) . map ( node_test_id ) . collect ( ) ; let request = SetupInitialDKGArgs :: new ( node_ids , RegistryVersion :: from ( 2 ) ) ; let uni_can = UniversalCanister :: new ( & agent ) . await ; let res = uni_can . forward_to ( & Principal :: management_canister ( ) , " " , Encode ! ( request ) . unwrap ( ) , ) . await ; assert_reject ( res , RejectCode :: CanisterReject ) ; } ) ; }
Tests whether a call to `setup_initial_dkg` is rejected when called from a
canister installed on an application subnet.
Tests whether a call to ` setup_initial_dkg ` is rejected when called from a canister installed on an application subnet .
handle
IcHandle
ctx
&ic_fondue::pot::Context