Skip to main content

Module outcome

Module outcome 

Source
Expand description

The test outcome module

Structs§

Expectations
What a test’s decorators expect of the test call
Failure
An expectation the test did not meet

Enums§

ExpectedOutcome
How a test is expected to end
Outcome
How the test call ended

Constants§

CHEATCODE_ERROR_SELECTOR 🔒
Selector of Foundry’s CheatcodeError(string), the revert data of a failed cheatcode such as a failed vm.assert*

Functions§

decode_hex 🔒
The bytes of an outcome’s data, which the runner records as hex so it reads well in JSON
describe_outcome 🔒
The outcome as the end of a sentence, e.g. “reverted with 0x82b42900 (Unauthorized)”
describe_revert 🔒
Revert data as hex, named after the contract’s error when its selector matches one, or with its message when it is a standard error such as Error(string) or a failed cheatcode
display_hex 🔒
Bytes as 0x-prefixed hex, spelling out empty data so it is not mistaken for a missing value
halt_reason_matches 🔒
Whether a halt reason given in a decorator names the actual reason, so OutOfGas matches every kind of out-of-gas halt