diff --git a/newsfragments/2179.misc.rst b/newsfragments/2179.misc.rst new file mode 100644 index 0000000000..c1520f987b --- /dev/null +++ b/newsfragments/2179.misc.rst @@ -0,0 +1 @@ +Clean up elif statement in contract.py diff --git a/web3/contract.py b/web3/contract.py index a776158385..d8b7227bbd 100644 --- a/web3/contract.py +++ b/web3/contract.py @@ -887,9 +887,7 @@ def _set_function_info(self) -> None: self.args, self.kwargs ) - if self.function_identifier is FallbackFn: - self.selector = encode_hex(b'') - elif self.function_identifier is ReceiveFn: + if self.function_identifier in [FallbackFn, ReceiveFn]: self.selector = encode_hex(b'') elif is_text(self.function_identifier): # https://github.com/python/mypy/issues/4976