diff --git a/eth_utils/decorators.py b/eth_utils/decorators.py index 0268be25..7fe0990a 100644 --- a/eth_utils/decorators.py +++ b/eth_utils/decorators.py @@ -1,5 +1,6 @@ import functools import itertools +import os from typing import ( Any, Callable, @@ -75,6 +76,8 @@ def validate_conversion_arguments(to_wrap: Callable[..., T]) -> Callable[..., T] - Kwarg must be 'primitive' 'hexstr' or 'text' - If it is 'hexstr' or 'text' that it is a text type """ + if os.environ.get("ETH_UTILS_NOVALIDATE"): + return to_wrap @functools.wraps(to_wrap) def wrapper(*args: Any, **kwargs: Any) -> T: diff --git a/newsfragments/304.feature.rst b/newsfragments/304.feature.rst new file mode 100644 index 00000000..8992f51f --- /dev/null +++ b/newsfragments/304.feature.rst @@ -0,0 +1,3 @@ +add ETH_UTILS_NOVALIDATE env var for optimized production deployments + +this env will instruct eth-utils to skip some extra steps that validate its functions are being used correctly, to be used when you're already sure this is true