---
source: crates/aiken-lang/src/parser/definition/validator.rs
description: "Code:\n\nvalidator hello {\n  spend (datum, rdmr, ctx) {\n    True\n  }\n}\n"
---
Validator(
    Validator {
        doc: None,
        end_position: 60,
        handlers: [
            Function {
                arguments: [
                    UntypedArg {
                        by: ByName(
                            Named {
                                name: "datum",
                                label: "datum",
                                location: 27..32,
                            },
                        ),
                        location: 27..32,
                        annotation: None,
                        doc: None,
                        is_validator_param: false,
                    },
                    UntypedArg {
                        by: ByName(
                            Named {
                                name: "rdmr",
                                label: "rdmr",
                                location: 34..38,
                            },
                        ),
                        location: 34..38,
                        annotation: None,
                        doc: None,
                        is_validator_param: false,
                    },
                    UntypedArg {
                        by: ByName(
                            Named {
                                name: "ctx",
                                label: "ctx",
                                location: 40..43,
                            },
                        ),
                        location: 40..43,
                        annotation: None,
                        doc: None,
                        is_validator_param: false,
                    },
                ],
                body: Var {
                    location: 51..55,
                    name: "True",
                },
                doc: None,
                location: 20..44,
                name: "spend",
                public: true,
                return_annotation: Some(
                    Constructor {
                        location: 26..44,
                        module: None,
                        name: "Bool",
                        arguments: [],
                    },
                ),
                return_type: (),
                end_position: 58,
                on_test_failure: FailImmediately,
            },
        ],
        location: 0..9,
        name: "hello",
        params: [],
        fallback: Function {
            arguments: [
                UntypedArg {
                    by: ByName(
                        Discarded {
                            name: "_",
                            label: "_",
                            location: 0..9,
                        },
                    ),
                    location: 0..9,
                    annotation: None,
                    doc: None,
                    is_validator_param: false,
                },
            ],
            body: ErrorTerm {
                location: 0..9,
            },
            doc: None,
            location: 0..9,
            name: "else",
            public: true,
            return_annotation: Some(
                Constructor {
                    location: 0..9,
                    module: None,
                    name: "Bool",
                    arguments: [],
                },
            ),
            return_type: (),
            end_position: 8,
            on_test_failure: FailImmediately,
        },
    },
)
