Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface AuthenticationTemplateScriptTest

Hierarchy

  • AuthenticationTemplateScriptTest

Index

Properties

check

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

fails: string[]

A list of the scenario identifiers which – when used to compile this test and the script it tests – result in bytecode which 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

invalid: string[]

A list of the scenario identifiers which – 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

name: undefined | string

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

Optional passes

passes: string[]

A list of the scenario identifiers which – when used to compile this test and the script it tests – result in bytecode which 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

setup: undefined | string

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

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

Generated using TypeDoc