Skip to content

Commit

Permalink
Some cleanup + organization for async account changes
Browse files Browse the repository at this point in the history
  • Loading branch information
fselmo committed Jul 29, 2022
1 parent e11b2f0 commit d74e8ea
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 16 deletions.
2 changes: 1 addition & 1 deletion newsfragments/2580.feature.rst
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Moved `Eth.account` to BaseEth.account so that it could be use in `AsyncEth`
Moved `Eth.account` to `BaseEth.account` so that it could be use in `AsyncEth`
23 changes: 8 additions & 15 deletions tests/core/eth-module/test_accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,21 +102,6 @@ def w3():
return Web3(EthereumTesterProvider())


@pytest.fixture()
def async_w3():
return Web3(AsyncEthereumTesterProvider(), modules={"eth": [AsyncEth]})


def test_blocking_eth_account(w3):
account = w3.eth.account.create()
assert account is not None


def test_async_eth_account(async_w3):
account = async_w3.eth.account.create()
assert account is not None


def test_eth_account_create_variation(acct):
account1 = acct.create()
account2 = acct.create()
Expand Down Expand Up @@ -567,6 +552,14 @@ def test_eth_account_sign_and_send_EIP155_transaction_to_eth_tester(
assert actual_txn.v == v


# -- async -- #


@pytest.fixture()
def async_w3():
return Web3(AsyncEthereumTesterProvider(), modules={"eth": [AsyncEth]})


@patch("web3.eth.BaseEth.account", "wired via BaseEth")
def test_account_is_wired_via_base_eth_for_sync_and_async(w3, async_w3):
# this gives us some comfort that all the `w3` tests would apply for `async_w3` as
Expand Down

0 comments on commit d74e8ea

Please sign in to comment.