def METHOD_NAME(script: messages.CardanoNativeScript | None) -> None:
    from . import seed
    from .helpers import ADDRESS_KEY_HASH_SIZE
    from .helpers.paths import SCHEMA_MINT
    INVALID_NATIVE_SCRIPT = ProcessError("Invalid native script")
    if not script:
        raise INVALID_NATIVE_SCRIPT
    _validate_native_script_structure(script)
    script_type = script.type  # local_cache_attribute
    key_path = script.key_path  # local_cache_attribute
    scripts = script.scripts  # local_cache_attribute
    CNST = CardanoNativeScriptType  # local_cache_global
    if script_type == CNST.PUB_KEY:
        if script.key_hash and key_path:
            raise INVALID_NATIVE_SCRIPT
        if script.key_hash:
            if len(script.key_hash) != ADDRESS_KEY_HASH_SIZE:
                raise INVALID_NATIVE_SCRIPT
        elif key_path:
            is_minting = SCHEMA_MINT.match(key_path)
            if not seed.is_multisig_path(key_path) and not is_minting:
                raise INVALID_NATIVE_SCRIPT
        else:
            raise INVALID_NATIVE_SCRIPT
    elif script_type == CNST.ALL:
        for sub_script in scripts:
            METHOD_NAME(sub_script)
    elif script_type == CNST.ANY:
        for sub_script in scripts:
            METHOD_NAME(sub_script)
    elif script_type == CNST.N_OF_K:
        if script.required_signatures_count is None:
            raise INVALID_NATIVE_SCRIPT
        if script.required_signatures_count > len(scripts):
            raise INVALID_NATIVE_SCRIPT
        for sub_script in scripts:
            METHOD_NAME(sub_script)
    elif script_type == CNST.INVALID_BEFORE:
        if script.invalid_before is None:
            raise INVALID_NATIVE_SCRIPT
    elif script_type == CNST.INVALID_HEREAFTER:
        if script.invalid_hereafter is None:
            raise INVALID_NATIVE_SCRIPT