diff --git a/src/ape/api/projects.py b/src/ape/api/projects.py index 17af73ae44..14d44017b9 100644 --- a/src/ape/api/projects.py +++ b/src/ape/api/projects.py @@ -6,6 +6,7 @@ from ethpm_types import Checksum, ContractType, PackageManifest, Source from ethpm_types.manifest import PackageName +from ethpm_types.source import Content from ethpm_types.utils import Algorithm, AnyUrl, compute_checksum from packaging.version import InvalidVersion, Version @@ -143,7 +144,7 @@ def contracts(self) -> Dict[str, ContractType]: continue contract_name = p.stem - contract_type = ContractType().parse_file(p) + contract_type = ContractType.parse_file(p) if contract_type.name is None: contract_type.name = contract_name @@ -214,7 +215,7 @@ def _create_source_dict( hash=compute_checksum(source_path.read_bytes()), ), urls=[], - content=text, + content=Content(__root__={i + 1: x for i, x in enumerate(text.splitlines())}), imports=source_imports.get(key, []), references=source_references.get(key, []), ) diff --git a/src/ape/managers/chain.py b/src/ape/managers/chain.py index 537aaafc83..f46dea2726 100644 --- a/src/ape/managers/chain.py +++ b/src/ape/managers/chain.py @@ -159,14 +159,16 @@ def query( ) query = BlockQuery( - columns=columns, + columns=list(columns), start_block=start_block, stop_block=stop_block, step=step, ) blocks = self.query_manager.query(query, engine_to_use=engine_to_use) - columns = validate_and_expand_columns(columns, self.head.__class__) # type: ignore + columns: List[str] = validate_and_expand_columns( # type: ignore + columns, self.head.__class__ + ) blocks = map(partial(extract_fields, columns=columns), blocks) return pd.DataFrame(columns=columns, data=blocks) @@ -486,7 +488,7 @@ def query( ) query = AccountTransactionQuery( - columns=columns, + columns=list(columns), account=self.address, start_nonce=start_nonce, stop_nonce=stop_nonce, diff --git a/src/ape/managers/project/manager.py b/src/ape/managers/project/manager.py index cb77f5b9f5..69dc1ec921 100644 --- a/src/ape/managers/project/manager.py +++ b/src/ape/managers/project/manager.py @@ -702,7 +702,6 @@ def track_deployment(self, contract: ContractInstance): if network == LOCAL_NETWORK_NAME or network.endswith("-fork"): raise ProjectError("Can only publish deployments on a live network.") - contract_name = contract.contract_type.name if not (contract_name := contract.contract_type.name): raise ProjectError("Contract name required when publishing.") diff --git a/src/ape/types/__init__.py b/src/ape/types/__init__.py index 02c0af37ab..9f3e2fc4e9 100644 --- a/src/ape/types/__init__.py +++ b/src/ape/types/__init__.py @@ -98,7 +98,7 @@ def validate_multiplier(cls, value): """ -TopicFilter = Sequence[Union[Optional[HexStr], List[Optional[HexStr]]]] +TopicFilter = Sequence[Union[Optional[HexStr], Sequence[Optional[HexStr]]]] @dataclass diff --git a/src/ape/utils/abi.py b/src/ape/utils/abi.py index cd0f4a3fb9..5844e040ac 100644 --- a/src/ape/utils/abi.py +++ b/src/ape/utils/abi.py @@ -120,7 +120,11 @@ def decode_output(self, values: Union[List, Tuple]) -> Any: return self._decode(self.abi.outputs, values) if isinstance(self.abi, MethodABI) else None - def _decode(self, _types: Sequence[ABIType], values: Union[Sequence, Dict[str, Any]]): + def _decode( + self, + _types: Union[Sequence[ABIType]], + values: Union[Sequence, Dict[str, Any]], + ): if is_struct(_types): return self._create_struct(_types[0], values)