Skip to content

Commit

Permalink
update test name to be unique
Browse files Browse the repository at this point in the history
  • Loading branch information
pacrob committed Dec 10, 2021
1 parent e9d1579 commit 7fd35b7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
1 change: 0 additions & 1 deletion newsfragments/2243.doc.rst

This file was deleted.

3 changes: 2 additions & 1 deletion web3/_utils/module_testing/eth_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -680,12 +680,13 @@ async def test_eth_call_revert_without_msg(
await async_w3.eth.call(txn_params) # type: ignore

@pytest.mark.asyncio
async def test_eth_hashrate(
async def test_async_eth_hashrate(
self,
async_w3: "Web3"
) -> None:
hashrate = await async_w3.eth.hashrate # type: ignore
assert is_integer(hashrate)
assert hashrate >= 0


class EthModuleTest:
Expand Down
8 changes: 4 additions & 4 deletions web3/eth.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,10 @@ async def coinbase(self) -> ChecksumAddress:
# types ignored b/c mypy conflict with BlockingEth properties
return await self.get_coinbase() # type: ignore

@property
async def hashrate(self) -> int:
return await self._get_hashrate() # type: ignore

_get_balance: Method[Callable[..., Awaitable[Wei]]] = Method(
RPC.eth_getBalance,
mungers=[BaseEth.block_id_munger],
Expand Down Expand Up @@ -389,10 +393,6 @@ async def call(
) -> Union[bytes, bytearray]:
return await self._call(transaction, block_identifier, state_override)

@property
async def hashrate(self) -> int:
return await self._get_hashrate() # type: ignore


class Eth(BaseEth, Module):
account = Account()
Expand Down

0 comments on commit 7fd35b7

Please sign in to comment.