Skip to content

Commit 61ea4de

Browse files
committed
refactor: trim solidity version helpers
1 parent b79afb2 commit 61ea4de

1 file changed

Lines changed: 1 addition & 8 deletions

File tree

ape_solidity/_utils.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ def parse(cls, version: str) -> "SoliditySemVer":
5858

5959
class SolidityVersionSpecifier:
6060
def __init__(self, expression: str):
61-
self.pragma_str = expression
6261
self.expression = _normalize_pragma_expression(expression)
6362
self._ranges = _parse_solidity_version_expression(self.expression)
6463

@@ -292,16 +291,10 @@ def add_commit_hash(version: Union[str, Version]) -> Version:
292291
return get_solc_version_from_binary(solc, with_commit_hash=True)
293292

294293

295-
def get_versions_can_use(
296-
pragma_spec: SolidityVersionSpecifier, options: Iterable[Version]
297-
) -> list[Version]:
298-
return sorted(list(pragma_spec.filter(options)), reverse=True)
299-
300-
301294
def select_version(
302295
pragma_spec: SolidityVersionSpecifier, options: Iterable[Version]
303296
) -> Optional[Version]:
304-
choices = get_versions_can_use(pragma_spec, options)
297+
choices = sorted(pragma_spec.filter(options), reverse=True)
305298
return choices[0] if choices else None
306299

307300

0 commit comments

Comments
 (0)