.. py:module:: ethereum.utils.ensure Ensure (Assertion) Utilities ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. contents:: Table of Contents :backlinks: none :local: Introduction ------------ Functions that simplify checking assertions and raising exceptions. .. only:: stage1 Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: :nosignatures: ethereum.utils.ensure.ensure Module Details --------------- ensure ~~~~~~ .. function:: ensure(value: bool, exception: Union[Type[BaseException], BaseException]) -> None :noindexentry: Does nothing if `value` is truthy, otherwise raises the exception returned by `exception_class`. :param value: Value that should be true. :param exception: Constructor for the exception to raise. .. undocinclude:: /../src/ethereum/utils/ensure.py :language: python :pyobject: ensure