Skip to content

Commit e447ec0

Browse files
committed
Fix checksum fetching when we have prerelease
Signed-off-by: Jun Zhang <[email protected]>
1 parent b22a00d commit e447ec0

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

solc_select/solc_select.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ def get_soliditylang_checksums(version: str) -> Tuple[str, Optional[str]]:
319319
response = session.get(list_url)
320320
response.raise_for_status()
321321
builds = response.json()["builds"]
322-
matches = list(filter(lambda b: b["version"] == version, builds))
322+
matches = list(filter(lambda b: b["version"] == version and "prerelease" not in b, builds))
323323

324324
if not matches or not matches[0]["sha256"]:
325325
raise argparse.ArgumentTypeError(

tests/test_compiler_versions.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,12 @@ def test_solc_080(self, test_contracts_dir, isolated_solc_data):
101101
f"solc080_fail_compile did not fail as expected. Output: {result.stdout}"
102102
)
103103

104+
def test_solc_0831_if_contains_prerelease(self, test_contracts_dir, isolated_solc_data):
105+
"""Test Solidity 0.8.31 compilation behavior."""
106+
# Switch to 0.8.31
107+
result = run_command("solc-select use 0.8.31 --always-install", check=False)
108+
assert result.returncode == 0, f"Failed to switch to 0.8.31: {result.stdout}"
109+
104110

105111
class TestVersionSwitching:
106112
"""Test version switching functionality."""

0 commit comments

Comments
 (0)