FUNCTION
tx.run_must_fail
function run_must_fail(): failureBuild a test block containing only this test transaction, asserting that the building fails (i.e. throws an exception).
Typically used to test operation calls that must throw an exception.
Since
0.10.4
Build a test block containing only this test transaction, asserting that the building fails; i.e. throws an exception; with the given exception message.
Checks that the given message is a substring of the thrown message. For example
my_tx.run_must_fail('out of bounds') succeeds if an exception with message
Run-time error: List index out of bounds: 0 (size 0) is thrown.
Typically used to test operation calls that must throw an exception.
Parameters
- expected_message — the expected substring of the error message
Since
0.11.0
© 2026 Chromia