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

Update eth-account version & add eip-1559 eth_signTransaction support #2082

Merged
merged 2 commits into from
Jul 23, 2021
Merged
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
Prev Previous commit
type fixing was required after eth-account was updated
  • Loading branch information
fselmo committed Jul 23, 2021
commit e4aff8af21bc5bf822cbb5b393febb080b7dd7f3
11 changes: 5 additions & 6 deletions web3/middleware/signing.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
Any,
Callable,
Collection,
Dict,
Iterable,
NoReturn,
Tuple,
TypeVar,
Union,
)
Expand Down Expand Up @@ -77,10 +76,10 @@ def is_eth_key(value: Any) -> bool:
@to_dict
def gen_normalized_accounts(
val: Union[_PrivateKey, Collection[_PrivateKey]]
) -> Iterable[Dict[ChecksumAddress, Account]]:
) -> Iterable[Tuple[ChecksumAddress, LocalAccount]]:
if isinstance(val, (list, tuple, set,)):
for i in val:
account: Account = to_account(i)
account: LocalAccount = to_account(i)
yield account.address, account
else:
account = to_account(val)
Expand All @@ -89,7 +88,7 @@ def gen_normalized_accounts(


@singledispatch
def to_account(val: Any) -> NoReturn:
def to_account(val: Any) -> LocalAccount:
raise TypeError(
"key must be one of the types: "
"eth_keys.datatype.PrivateKey, eth_account.signers.local.LocalAccount, "
Expand All @@ -102,7 +101,7 @@ def _(val: T) -> T:
return val


def private_key_to_account(val: _PrivateKey) -> Account:
def private_key_to_account(val: _PrivateKey) -> LocalAccount:
normalized_key = key_normalizer(val)
return Account.from_key(normalized_key)

Expand Down