Skip to content

Commit

Permalink
eth_account.local -> eth_account.signers.local
Browse files Browse the repository at this point in the history
  • Loading branch information
carver committed May 6, 2019
1 parent a81e11f commit 47224bb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
11 changes: 8 additions & 3 deletions tests/core/middleware/test_transaction_signing.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import pytest

import eth_account
from eth_account import (
Account,
)
from eth_account.signers.local import (
LocalAccount,
)
import eth_keys
from eth_tester.exceptions import (
ValidationError,
Expand Down Expand Up @@ -48,7 +53,7 @@

KEY_FUNCS = (
eth_keys.keys.PrivateKey,
eth_account.Account.privateKeyToAccount,
Account.privateKeyToAccount,
HexBytes,
to_hex,
identity,
Expand Down Expand Up @@ -188,7 +193,7 @@ def w3():
)
def test_gen_normalized_accounts(key_object):
accounts = gen_normalized_accounts(key_object)
assert all(isinstance(account, eth_account.local.LocalAccount) for account in accounts.values())
assert all(isinstance(account, LocalAccount) for account in accounts.values())


def test_gen_normalized_accounts_type_error(w3):
Expand Down
4 changes: 2 additions & 2 deletions web3/middleware/signing.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from eth_account import (
Account,
)
from eth_account.local import (
from eth_account.signers.local import (
LocalAccount,
)
from eth_keys.datatypes import (
Expand Down Expand Up @@ -63,7 +63,7 @@ def gen_normalized_accounts(val):
def to_account(val):
raise TypeError(
"key must be one of the types: "
"eth_keys.datatype.PrivateKey, eth_account.local.LocalAccount, "
"eth_keys.datatype.PrivateKey, eth_account.signers.local.LocalAccount, "
"or raw private key as a hex string or byte string. "
"Was of type {0}".format(type(val)))

Expand Down

0 comments on commit 47224bb

Please sign in to comment.