Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop deprecated web3.sha3 method #1207

Merged
merged 1 commit into from
Jan 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/web3.eth.account.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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'
38 changes: 0 additions & 38 deletions tests/core/web3-module/test_keccak.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
[
Expand All @@ -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',
[
Expand Down
6 changes: 0 additions & 6 deletions web3/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down