From 5713238166e5bd0ccef23ae6d8e91c0f77846b8b Mon Sep 17 00:00:00 2001 From: Nick Gheorghita Date: Mon, 14 Jan 2019 14:38:58 +0100 Subject: [PATCH] Drop deprecated web3.sha3 method --- docs/web3.eth.account.rst | 2 +- tests/core/web3-module/test_keccak.py | 38 --------------------------- web3/main.py | 6 ----- 3 files changed, 1 insertion(+), 45 deletions(-) diff --git a/docs/web3.eth.account.rst b/docs/web3.eth.account.rst index 66919a342c..af007f0bd7 100644 --- a/docs/web3.eth.account.rst +++ b/docs/web3.eth.account.rst @@ -302,5 +302,5 @@ To sign a transaction locally that will invoke a smart contract: >>> w3.eth.sendRawTransaction(signed_txn.rawTransaction) # doctest: +SKIP # When you run sendRawTransaction, you get the same result as the hash of the transaction: - >>> w3.toHex(w3.sha3(signed_txn.rawTransaction)) + >>> w3.toHex(w3.keccak(signed_txn.rawTransaction)) '0x4795adc6a719fa64fa21822630c0218c04996e2689ded114b6553cef1ae36618' diff --git a/tests/core/web3-module/test_keccak.py b/tests/core/web3-module/test_keccak.py index 2bb51224e7..7fb900867f 100644 --- a/tests/core/web3-module/test_keccak.py +++ b/tests/core/web3-module/test_keccak.py @@ -20,18 +20,6 @@ def test_keccak_text(message, digest): assert Web3.keccak(text=message) == digest -@pytest.mark.parametrize( - 'message, digest', - [ - ('cowmö', HexBytes('0x0f355f04c0a06eebac1d219b34c598f85a1169badee164be8a30345944885fe8')), - ('', HexBytes('0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470')), - ], -) -def test_sha3_text(message, digest): - with pytest.deprecated_call(): - assert Web3.sha3(text=message) == digest - - @pytest.mark.parametrize( 'hexstr, digest', [ @@ -57,32 +45,6 @@ def test_keccak_hexstr(hexstr, digest): assert Web3.keccak(hexstr=hexstr) == digest -@pytest.mark.parametrize( - 'hexstr, digest', - [ - ( - '0x636f776dc3b6', - HexBytes('0x0f355f04c0a06eebac1d219b34c598f85a1169badee164be8a30345944885fe8') - ), - ( - '636f776dc3b6', - HexBytes('0x0f355f04c0a06eebac1d219b34c598f85a1169badee164be8a30345944885fe8') - ), - ( - '0x', - HexBytes('0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470') - ), - ( - '', - HexBytes('0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470') - ), - ], -) -def test_sha3_hexstr(hexstr, digest): - with pytest.deprecated_call(): - assert Web3.sha3(hexstr=hexstr) == digest - - @pytest.mark.parametrize( 'primitive, exception', [ diff --git a/web3/main.py b/web3/main.py index 1e7c5a8f2f..b19bd86ff4 100644 --- a/web3/main.py +++ b/web3/main.py @@ -146,12 +146,6 @@ def provider(self): def provider(self, provider): self.manager.provider = provider - @staticmethod - @deprecated_for("keccak") - @apply_to_return_value(HexBytes) - def sha3(primitive=None, text=None, hexstr=None): - return Web3.keccak(primitive, text, hexstr) - @staticmethod @apply_to_return_value(HexBytes) def keccak(primitive=None, text=None, hexstr=None):