Type alias WalletTemplateScriptTest

WalletTemplateScriptTest: {
    check: string;
    fails?: string[];
    invalid?: string[];
    name?: string;
    passes?: string[];
    setup?: string;
}

Type declaration

  • check: string

    The script to evaluate after the script being tested. This can be used to check that the tested script leaves the expected results on the stack. For example, if the tested script is expected to leave 3 items of a specific size on the stack, the check script could pop each resulting item from the stack and examine it for correctness.

    In scenario testing, this script is appended to the script under test, and together they are treated as the locking script. Program evaluation is considered successful if the resulting program state can be verified by the virtual machine (e.g. the resulting stack contains a single 1, no errors are produced, etc.).

  • Optional fails?: string[]

    A list of the scenario identifiers that – when used to compile this test and the script it tests – result in bytecode that fails program verification. The setup script is used in place of an unlocking script, and the concatenation of the script under test and the check script are used in place of a locking script.

    These scenarios can be used to test this script in development and review.

  • Optional invalid?: string[]

    A list of the scenario identifiers that – when used to compile this test and the script it tests – result in a compilation error. The setup script is used in place of an unlocking script, and the concatenation of the script under test and the check script are used in place of a locking script.

    These scenarios can be used to test this script in development and review.

  • Optional name?: string

    A single-line, Title Case, human-readable name for this test (for use in user interfaces).

  • Optional passes?: string[]

    A list of the scenario identifiers that – when used to compile this test and the script it tests – result in bytecode that passes program verification. The setup script is used in place of an unlocking script, and the concatenation of the script under test and the check script are used in place of a locking script.

    These scenarios can be used to test this script in development and review.

  • Optional setup?: string

    A script to evaluate before the script being tested. This can be used to push values to the stack that are operated on by the tested script.

    In scenario testing, this script is treated as the unlocking script.

Generated using TypeDoc