Skip to main content

Module spec

Module spec 

Source
Expand description

The decorator spec module

Structsยง

AccountValue
A property of an account, such as its balance, set before the test or expected after it
EnvOverrides
Transaction and block fields a testโ€™s decorators override; None keeps the runnerโ€™s value
Evaluator ๐Ÿ”’
Evaluates decorator argument values against the contract and the testโ€™s addresses
ExpectedSlot
A storage slot of an account and the value it must hold after the test
FlagArgs ๐Ÿ”’
The arguments of a flag, checked against the positional count and keys it accepts
SpecContext
Addresses that decorator arguments can refer to by name
StorageSlot
A storage slot of an account with its value, set before the test or expected after it
TestSpec
The setup a testโ€™s decorators ask for before the test call

Enumsยง

DecoratorKind ๐Ÿ”’
The decorator flags hnc test understands
ExpectedValue
The value an expect_balance or expect_storage flag expects after the test
OutcomeFlag ๐Ÿ”’
The flags that say how the test must end; a test can have only one of them

Functionsยง

check_account_once ๐Ÿ”’
Fails when a flag that sets or checks an account was already given for the same address
check_single_use ๐Ÿ”’
Fails when a flag that may appear only once was already given
decorator_error ๐Ÿ”’
An error pointing at a decorator flag the runner cannot apply
joined_span ๐Ÿ”’
The source of two flags, so a duplicate points at both places
single_arg ๐Ÿ”’
The only argument of a flag that takes one value
skip_reason ๐Ÿ”’
The reason a skip flag gives, if any
skipped
Whether a testโ€™s decorator skips it, with the reason when given. The runner checks this before it compiles the test, so a skipped test may be unfinished.