|
| 1 | +import itertools |
1 | 2 | import json |
2 | 3 | import os |
3 | 4 | from collections.abc import Iterable, Iterator, Mapping |
|
10 | 11 | from ape.contracts import ContractCall |
11 | 12 | from ape.exceptions import ContractNotFoundError, ProviderNotConnectedError |
12 | 13 | from ape.logging import logger |
13 | | -from ape.managers.accounts import AccountManager, TestAccountManager |
14 | 14 | from ape.types import AddressType, HexBytes, MessageSignature |
15 | 15 | from ape.utils import ZERO_ADDRESS, cached_property |
16 | 16 | from ape_ethereum.proxies import ProxyInfo, ProxyType |
@@ -503,20 +503,24 @@ def local_signers(self) -> list[AccountAPI]: |
503 | 503 | # NOTE: Is not ordered by signing order |
504 | 504 | # TODO: Skip per user config |
505 | 505 | # TODO: Order per user config |
506 | | - container: Union[AccountManager, TestAccountManager] |
| 506 | + accounts: Iterable[AccountAPI] |
507 | 507 | if self.network_manager.active_provider and self.provider.network.is_dev: |
508 | | - container = self.account_manager.test_accounts |
| 508 | + accounts = itertools.chain( |
| 509 | + iter(self.account_manager), |
| 510 | + iter(self.account_manager.test_accounts), |
| 511 | + ) |
| 512 | + |
509 | 513 | else: |
510 | | - container = self.account_manager |
| 514 | + accounts = iter(self.account_manager) |
511 | 515 |
|
512 | 516 | # Ensure the contract is available before continuing. |
513 | 517 | # Else, return an empty list |
514 | 518 | try: |
515 | | - _ = self.contract |
| 519 | + signers = self.signers |
516 | 520 | except ContractNotFoundError: |
517 | 521 | return [] |
518 | 522 |
|
519 | | - return list(container[address] for address in self.signers if address in container) |
| 523 | + return list(filter(lambda a: a in signers, accounts)) |
520 | 524 |
|
521 | 525 | @handle_safe_logic_error() |
522 | 526 | def create_execute_transaction( |
|
0 commit comments