Skip to content

Commit b4dbc45

Browse files
committed
fix(Account): missing signers when using forked mainnet
1 parent 8424953 commit b4dbc45

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

ape_safe/accounts.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import itertools
12
import json
23
import os
34
from collections.abc import Iterable, Iterator, Mapping
@@ -10,7 +11,6 @@
1011
from ape.contracts import ContractCall
1112
from ape.exceptions import ContractNotFoundError, ProviderNotConnectedError
1213
from ape.logging import logger
13-
from ape.managers.accounts import AccountManager, TestAccountManager
1414
from ape.types import AddressType, HexBytes, MessageSignature
1515
from ape.utils import ZERO_ADDRESS, cached_property
1616
from ape_ethereum.proxies import ProxyInfo, ProxyType
@@ -503,20 +503,24 @@ def local_signers(self) -> list[AccountAPI]:
503503
# NOTE: Is not ordered by signing order
504504
# TODO: Skip per user config
505505
# TODO: Order per user config
506-
container: Union[AccountManager, TestAccountManager]
506+
accounts: Iterable[AccountAPI]
507507
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+
509513
else:
510-
container = self.account_manager
514+
accounts = iter(self.account_manager)
511515

512516
# Ensure the contract is available before continuing.
513517
# Else, return an empty list
514518
try:
515-
_ = self.contract
519+
signers = self.signers
516520
except ContractNotFoundError:
517521
return []
518522

519-
return list(container[address] for address in self.signers if address in container)
523+
return list(filter(lambda a: a in signers, accounts))
520524

521525
@handle_safe_logic_error()
522526
def create_execute_transaction(

0 commit comments

Comments
 (0)