Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions newsfragments/3034.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix ``AsyncWeb3.solidity_keccak`` to match ``Web3.solidity_keccak``.
8 changes: 8 additions & 0 deletions web3/_utils/module_testing/web3_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
)

from web3 import (
AsyncWeb3,
Web3,
)
from web3._utils.ens import (
Expand Down Expand Up @@ -221,6 +222,13 @@ def _check_web3_client_version(self, client_version: str) -> NoReturn:
),
),
)
@pytest.mark.parametrize(
"w3",
(
Web3,
AsyncWeb3,
),
)
def test_solidity_keccak(
self,
w3: "Web3",
Expand Down
10 changes: 2 additions & 8 deletions web3/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,9 +286,9 @@ def keccak(

@classmethod
def normalize_values(
cls, _w3: "BaseWeb3", abi_types: List[TypeStr], values: List[Any]
cls, w3: "BaseWeb3", abi_types: List[TypeStr], values: List[Any]
) -> List[Any]:
return map_abi_data(zip(abi_types, values))
return map_abi_data([abi_ens_resolver(w3)], abi_types, values)

@combomethod
def solidity_keccak(cls, abi_types: List[TypeStr], values: List[Any]) -> bytes:
Expand Down Expand Up @@ -450,12 +450,6 @@ def __init__(
def is_connected(self, show_traceback: bool = False) -> bool:
return self.provider.is_connected(show_traceback)

@classmethod
def normalize_values(
cls, w3: "BaseWeb3", abi_types: List[TypeStr], values: List[Any]
) -> List[Any]:
return map_abi_data([abi_ens_resolver(w3)], abi_types, values)

@property
def middleware_onion(self) -> MiddlewareOnion:
return cast(MiddlewareOnion, self.manager.middleware_onion)
Expand Down