Skip to content

Commit

Permalink
fix: type again
Browse files Browse the repository at this point in the history
  • Loading branch information
antazoey committed Dec 16, 2024
1 parent 46f3f30 commit 9a8cac6
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions ape_safe/accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import os
from collections.abc import Iterable, Iterator, Mapping
from pathlib import Path
from typing import TYPE_CHECKING, Any, Dict, Optional, Union, cast
from typing import TYPE_CHECKING, Any, Optional, Union, cast

from ape.api import AccountAPI, AccountContainerAPI, ReceiptAPI, TransactionAPI
from ape.api.networks import ForkedNetworkAPI
Expand Down Expand Up @@ -41,7 +41,7 @@


class SafeContainer(AccountContainerAPI):
_accounts: Dict[str, "SafeAccount"] = {}
_accounts: dict[str, "SafeAccount"] = {}

@property
def _account_files(self) -> Iterator[Path]:
Expand Down Expand Up @@ -182,8 +182,8 @@ def _get_path(self, alias: str) -> Path:
def get_signatures(
safe_tx: SafeTx,
signers: Iterable[AccountAPI],
) -> Dict[AddressType, MessageSignature]:
signatures: Dict[AddressType, MessageSignature] = {}
) -> dict[AddressType, MessageSignature]:
signatures: dict[AddressType, MessageSignature] = {}
for signer in signers:
signature = signer.sign_message(safe_tx)
if signature:
Expand Down Expand Up @@ -535,7 +535,7 @@ def call( # type: ignore[override]

return super().call(txn, **call_kwargs)

def get_api_confirmations(self, safe_tx: SafeTx) -> Dict[AddressType, MessageSignature]:
def get_api_confirmations(self, safe_tx: SafeTx) -> dict[AddressType, MessageSignature]:
safe_tx_id = get_safe_tx_hash(safe_tx)
try:
client_confirmations = self.client.get_confirmations(safe_tx_id)
Expand All @@ -560,7 +560,7 @@ def _contract_approvals(self, safe_tx: SafeTx) -> Mapping[AddressType, MessageSi
if self.contract.approvedHashes(signer, safe_tx_hash) > 0
}

def _all_approvals(self, safe_tx: SafeTx) -> Dict[AddressType, MessageSignature]:
def _all_approvals(self, safe_tx: SafeTx) -> dict[AddressType, MessageSignature]:
approvals = self.get_api_confirmations(safe_tx)

# NOTE: Do this last because it should take precedence
Expand Down Expand Up @@ -724,7 +724,7 @@ def skip_signer(signer: AccountAPI):

def add_signatures(
self, safe_tx: SafeTx, confirmations: Optional[list[SafeTxConfirmation]] = None
) -> Dict[AddressType, MessageSignature]:
) -> dict[AddressType, MessageSignature]:
confirmations = confirmations or []
if not self.local_signers:
raise ApeSafeError("Cannot sign without local signers.")
Expand Down

0 comments on commit 9a8cac6

Please sign in to comment.