pub fn empty_canister_inspect_rejects_all_messages(
    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_node_endpoint(&handle, &mut rng);
            endpoint.assert_ready(ctx).await;
            let agent = assert_create_agent(endpoint.url.as_str()).await;
            let canister = UniversalCanister::new(&agent).await;
            canister
                .update(wasm().set_inspect_message(wasm().noop()).reply())
                .await
                .unwrap();

            // Now send the canister an ingress message.  It should fail.
            assert_http_submit_fails(
                agent
                    .update(&canister.canister_id(), "update")
                    .with_arg(wasm().reply().build())
                    .call()
                    .await,
                StatusCode::FORBIDDEN,
            );
        }
    })
}
/// Defining an empty `canister_inspect_message` rejects all messages.
Defining an empty `canister_inspect_message` rejects all messages.
Defining an empty ` canister_inspect_message ` rejects all messages .
pub fn empty_canister_inspect_rejects_all_messages(
    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_node_endpoint(&handle, &mut rng);
            endpoint.assert_ready(ctx).await;
            let agent = assert_create_agent(endpoint.url.as_str()).await;
            let canister = UniversalCanister::new(&agent).await;
            canister
                .update(wasm().set_inspect_message(wasm().noop()).reply())
                .await
                .unwrap();
            // Now send the canister an ingress message.  It should fail.
            assert_http_submit_fails(
                agent
                    .update(&canister.canister_id(), "update")
                    .with_arg(wasm().reply().build())
                    .call()
                    .await,
                StatusCode::FORBIDDEN,
            );
        }
    })
}
pub fn empty_canister_inspect_rejects_all_messages ( 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_node_endpoint ( & handle , & mut rng ) ; endpoint . assert_ready ( ctx ) . await ; let agent = assert_create_agent ( endpoint . url . as_str ( ) ) . await ; let canister = UniversalCanister :: new ( & agent ) . await ; canister . update ( wasm ( ) . set_inspect_message ( wasm ( ) . noop ( ) ) . reply ( ) ) . await . unwrap ( ) ; // Now send the canister an ingress message.  It should fail. assert_http_submit_fails ( agent . update ( & canister . canister_id ( ) , " " ) . with_arg ( wasm ( ) . reply ( ) . build ( ) ) . call ( ) . await , StatusCode :: FORBIDDEN , ) ; } } ) }
Defining an empty `canister_inspect_message` rejects all messages.
Defining an empty ` canister_inspect_message ` rejects all messages .
handle
IcHandle
ctx
&ic_fondue::pot::Context
handle
IcHandle
ctx
&ic_fondue::pot::Context