Skip to content

Commit

Permalink
fix: fix imports and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
antazoey committed May 14, 2024
1 parent c0aaefe commit 5130797
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
5 changes: 4 additions & 1 deletion ape_vyper/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
"0.3.8": "shanghai",
"0.3.9": "shanghai",
"0.3.10": "shanghai",
"0.4.0rc3": "shanghai",
}


Expand Down Expand Up @@ -544,7 +545,9 @@ def compile(
for source_id, output_items in result["contracts"].items():
content = {
i + 1: ln
for i, ln in enumerate((contracts_path / source_id).read_text().splitlines())
for i, ln in enumerate(
(contracts_path / source_id).read_text().splitlines()
)
}
for name, output in output_items.items():
# De-compress source map to get PC POS map.
Expand Down
5 changes: 5 additions & 0 deletions tests/ape-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,8 @@ vyper:
# Allows importing dependencies.
import_remapping:
- "exampledep=ExampleDependency"

geth:
ethereum:
local:
uri: "http://127.0.0.1:5550"
4 changes: 1 addition & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,7 @@ def project(config, project_folder):
@pytest.fixture
def geth_provider():
if not ape.networks.active_provider or ape.networks.provider.name != "geth":
with ape.networks.ethereum.local.use_provider(
"geth", provider_settings={"uri": "http://127.0.0.1:5550"}
) as provider:
with ape.networks.ethereum.local.use_provider("geth") as provider:
yield provider
else:
yield ape.networks.provider
Expand Down
7 changes: 6 additions & 1 deletion tests/test_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,12 @@ def test_get_version_map(project, compiler, all_versions):

# Vyper 0.4.0 assertions.
actual4 = {x.name for x in actual[VERSION_04]}
expected4 = {'zero_four_module.vy', 'IFaceZeroFour.vyi', 'zero_four.vy', 'sub_reverts_040rc2.vy'}
expected4 = {
"zero_four_module.vy",
"IFaceZeroFour.vyi",
"zero_four.vy",
"sub_reverts_040rc2.vy",
}
assert actual4 == expected4


Expand Down

0 comments on commit 5130797

Please sign in to comment.