// End user sends an update msg to canisterA; canisterA tries to send a very
// large reply and fails.
End user sends an update msg to canisterA; canisterA tries to send a very
large reply and fails.
End user sends an update msg to canisterA ; canisterA tries to send a very large reply and fails .
fn inter_canister_response_limit() {
    utils::canister_test(|test| {
        let size = MAX_INTER_CANISTER_PAYLOAD_IN_BYTES + NumBytes::from(1);
        let (canister_a, _) = test.create_and_install_canister(
            &format!(
                r#"(module
                    (import "ic0" "msg_reply" (func $msg_reply))
                    (import "ic0" "msg_reply_data_append" (func $msg_reply_data_append (param i32 i32)))
                    (func $hi
                      (call $msg_reply_data_append (i32.const 30) (i32.const {}))
                      (call $msg_reply)
                    )
                    (memory $memory 1)
                    (export "canister_update hi" (func $hi))
                    (export "memory" (memory $memory)))"#,
                size),
            vec![]);
        let err = test.ingress(canister_a, "hi", vec![5]).unwrap_err();
        assert_eq!(err.code(), ErrorCode::CanisterContractViolation);
    });
}
fn inter_canister_response_limit ( ) { utils :: canister_test ( | test | { let size = MAX_INTER_CANISTER_PAYLOAD_IN_BYTES + NumBytes :: from ( 1 ) ; let ( canister_a , _ ) = test . create_and_install_canister ( & format ! ( r#"(module
                    (import "ic0" "msg_reply" (func $msg_reply))
                    (import "ic0" "msg_reply_data_append" (func $msg_reply_data_append (param i32 i32)))

                    (func $hi
                      (call $msg_reply_data_append (i32.const 30) (i32.const {}))
                      (call $msg_reply)
                    )

                    (memory $memory 1)
                    (export "canister_update hi" (func $hi))
                    (export "memory" (memory $memory)))"# size ) , vec ! [ ] ) ; let err = test . ingress ( canister_a , " " , vec ! [ 5 ] ) . unwrap_err ( ) ; assert_eq ! ( err code ( ) ErrorCode CanisterContractViolation ) ; } ) ; }
End user sends an update msg to canisterA; canisterA tries to send a very
large reply and fails.
End user sends an update msg to canisterA ; canisterA tries to send a very large reply and fails .