From 33263f736677ab1a410acee763781c3379e43552 Mon Sep 17 00:00:00 2001 From: Mohammad Rezaei Date: Wed, 8 May 2019 11:07:49 -0400 Subject: [PATCH] mark deprecated sha3 method as static with a test --- tests/core/web3-module/test_keccak.py | 5 +++++ web3/main.py | 1 + 2 files changed, 6 insertions(+) diff --git a/tests/core/web3-module/test_keccak.py b/tests/core/web3-module/test_keccak.py index 7fb900867f..1f64416543 100644 --- a/tests/core/web3-module/test_keccak.py +++ b/tests/core/web3-module/test_keccak.py @@ -97,3 +97,8 @@ def test_keccak_raise_if_hexstr_and_text(): def test_keccak_raise_if_no_args(): with pytest.raises(TypeError): Web3.keccak() + + +def test_deprecated_bound_method(): + w3 = Web3() + assert w3.sha3(text='cowmö') == HexBytes('0x0f355f04c0a06eebac1d219b34c598f85a1169badee164be8a30345944885fe8') \ No newline at end of file diff --git a/web3/main.py b/web3/main.py index 6682b5ad96..273df4c0f8 100644 --- a/web3/main.py +++ b/web3/main.py @@ -163,6 +163,7 @@ def api(self): from web3 import __version__ return __version__ + @staticmethod @deprecated_for("keccak") @apply_to_return_value(HexBytes) def sha3(primitive=None, text=None, hexstr=None):