From 36cd4963a9acda44d4540ae85e0ce1197cb97296 Mon Sep 17 00:00:00 2001 From: "Sam.An" <56215891+sammiee5311@users.noreply.github.com> Date: Sat, 16 Oct 2021 00:11:53 +0900 Subject: [PATCH] Clean up `elif` statement (#2179) - removed unnecessary statement --- newsfragments/2179.misc.rst | 1 + web3/contract.py | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) create mode 100644 newsfragments/2179.misc.rst 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