Skip to content

Commit

Permalink
Add missed annotations
Browse files Browse the repository at this point in the history
Signed-off-by: cyc60 <avsysoev60@gmail.com>
  • Loading branch information
cyc60 committed Aug 20, 2024
1 parent 978f143 commit d55221e
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/common/contracts.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ async def aggregate(
class EigenPodOwnerContract(ContractWrapper):
abi_path = 'abi/IEigenPodOwner.json'

def __init__(self, address):
def __init__(self, address: ChecksumAddress) -> None:
self._address = address

@property
Expand Down
4 changes: 2 additions & 2 deletions src/config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,11 +253,11 @@ def is_genesis_vault(self) -> bool:
return self.vault == settings.network_config.GENESIS_VAULT_CONTRACT_ADDRESS

@property
def is_auto_registration_mode(self):
def is_auto_registration_mode(self) -> bool:
return settings.validators_registration_mode == ValidatorsRegistrationMode.AUTO

@property
def is_api_registration_mode(self):
def is_api_registration_mode(self) -> bool:
return settings.validators_registration_mode == ValidatorsRegistrationMode.API


Expand Down
6 changes: 3 additions & 3 deletions src/eigenlayer/contracts.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
class EigenPodContract(ContractWrapper):
abi_path = '../eigenlayer/abi/IEigenPod.json'

def __init__(self, address):
def __init__(self, address: ChecksumAddress) -> None:
self._address = address

@property
Expand Down Expand Up @@ -66,7 +66,7 @@ async def get_delayed_withdrawal_router(self, block_number: BlockNumber) -> Chec
class DelayedWithdrawalRouterContract(ContractWrapper):
abi_path = '../eigenlayer/abi/IDelayedWithdrawalRouter.json'

def __init__(self, address):
def __init__(self, address: ChecksumAddress) -> None:
self._address = address

@property
Expand Down Expand Up @@ -112,7 +112,7 @@ async def get_pod_shares(self, pod_owner: ChecksumAddress, block_number: BlockNu
class BeaconChainOracleContract(ContractWrapper):
abi_path = '../eigenlayer/abi/IBeaconChainOracle.json'

def __init__(self, address):
def __init__(self, address: ChecksumAddress) -> None:
self._address = address

@property
Expand Down
9 changes: 5 additions & 4 deletions src/eigenlayer/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ def __init__(self, slot: int, chain_id: int):

self.files: set[str] = set()

def __enter__(self):
def __enter__(self) -> 'ProofsGenerationWrapper':
return self

def __exit__(self, exc_type, exc_val, exc_tb):
def __exit__(self, exc_type, exc_val, exc_tb): # type: ignore
for file in self.files:
self._cleanup_file(file)

Expand Down Expand Up @@ -216,11 +216,12 @@ def binary_filename(self) -> str:
return resource_path(filename)


def resource_path(relative_path):
def resource_path(relative_path: str) -> str:
"""Get absolute path to resource, works for dev and for PyInstaller"""
try:
# PyInstaller creates a temp folder and stores path in _MEIPASS
base_path = sys._MEIPASS # pylint: disable=no-member,protected-access
# pylint: disable-next=no-member,protected-access
base_path = sys._MEIPASS # type: ignore
except BaseException:
base_path = os.path.abspath('.') + '/bin'

Expand Down
2 changes: 1 addition & 1 deletion src/eigenlayer/typings.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class QueuedWithdrawal:
withdrawal_root: bytes | None = None

@property
def block_number(self):
def block_number(self) -> BlockNumber:
return self.start_block

@property
Expand Down

0 comments on commit d55221e

Please sign in to comment.