From 0593a0dd5d1c1f8c361dc2467fec200e17f9ad77 Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Wed, 3 Apr 2024 18:20:35 +0300 Subject: [PATCH] Fix whitespaces --- python/src/skale_contracts/instance.py | 3 ++- python/src/skale_contracts/metadata.py | 2 ++ python/src/skale_contracts/project.py | 2 -- python/src/skale_contracts/project_factory.py | 4 ++-- python/src/skale_contracts/projects/skale_allocator.py | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/python/src/skale_contracts/instance.py b/python/src/skale_contracts/instance.py index 90d8a72..19b9b9a 100644 --- a/python/src/skale_contracts/instance.py +++ b/python/src/skale_contracts/instance.py @@ -25,7 +25,7 @@ "stateMutability": "view", "payable": False, "inputs": [], - "outputs": [ { "type": "string", "name": "" } ] + "outputs": [{"type": "string", "name": ""}] } @@ -33,6 +33,7 @@ class InstanceData: """Contains instance data""" data: dict[str, str] + @classmethod def from_json(cls, data: str) -> InstanceData: """Create InstanceData object from json string""" diff --git a/python/src/skale_contracts/metadata.py b/python/src/skale_contracts/metadata.py index 9e30c2b..c4a1287 100644 --- a/python/src/skale_contracts/metadata.py +++ b/python/src/skale_contracts/metadata.py @@ -16,6 +16,7 @@ class NetworkMetadata: chain_id: int path: str + @dataclass class MetadataFile: """Represents file with metadata""" @@ -33,6 +34,7 @@ def from_json(cls, data: str) -> MetadataFile: path=network['path'])) return cls(networks) + class Metadata: """Class to manage SKALE contracts metadata""" networks: list[NetworkMetadata] diff --git a/python/src/skale_contracts/project.py b/python/src/skale_contracts/project.py index 31d7154..59599ef 100644 --- a/python/src/skale_contracts/project.py +++ b/python/src/skale_contracts/project.py @@ -30,13 +30,11 @@ def name() -> str: def github_repo(self) -> str: """URL of github repo with the project""" - @property def folder(self) -> str: """Folder name with instances json files""" return self.name() - def get_instance(self, alias_or_address: str) -> Instance: """Create instance object based on alias or address""" if self.network.web3.is_address(alias_or_address): diff --git a/python/src/skale_contracts/project_factory.py b/python/src/skale_contracts/project_factory.py index be2cd21..035b846 100644 --- a/python/src/skale_contracts/project_factory.py +++ b/python/src/skale_contracts/project_factory.py @@ -14,8 +14,8 @@ projects_dict = { project_type.name(): project_type for _, project_type - in inspect.getmembers(projects, inspect.isclass) - if issubclass(project_type, Project) + in inspect.getmembers(projects, inspect.isclass) + if issubclass(project_type, Project) } diff --git a/python/src/skale_contracts/projects/skale_allocator.py b/python/src/skale_contracts/projects/skale_allocator.py index 567bb25..0c3cb5c 100644 --- a/python/src/skale_contracts/projects/skale_allocator.py +++ b/python/src/skale_contracts/projects/skale_allocator.py @@ -33,7 +33,7 @@ def get_contract_address( raise ValueError('Beneficiary is not set') raise ValueError(f'Contract ${name} is not found') - def _get_escrow (self, beneficiary: Address) -> Address: + def _get_escrow(self, beneficiary: Address) -> Address: return to_canonical_address( self.allocator.functions.getEscrowAddress(beneficiary).call() )