Skip to content

Commit

Permalink
Install dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielSchiavini committed May 15, 2024
1 parent 721ef06 commit 43f7e6f
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 6 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,20 @@ jobs:
- name: Install Requirements
run: pip install -r requirements.txt

- name: Install Zksync dependencies
run: |
echo "Installing zkvyper and era_test_node"
# Install zkvyper and era_test_node from binary repositories
curl --location https://raw.githubusercontent.com/matter-labs/zkvyper-bin/66cc159d9b6af3b5616f6ed7199bd817bf42bf0a/linux-amd64/zkvyper-linux-amd64-musl-v1.4.0 \
--silent --output /usr/local/bin/zkvyper && \
chmod +x /usr/local/bin/zkvyper && \
zkvyper --version
curl --location https://github.com/matter-labs/era-test-node/releases/download/v0.1.0-alpha.19/era_test_node-v0.1.0-alpha.19-x86_64-unknown-linux-gnu.tar.gz \
--silent --output era_test_node.tar.gz && \
tar --extract --file=era_test_node.tar.gz && \
mv era_test_node /usr/local/bin/era_test_node && \
era_test_node --version && \
rm era_test_node.tar.gz
- name: Run Tests
run: python -m pytest tests/unitary -n auto
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ repos:
args: ["--profile", "black", --line-length=79]

default_language_version:
python: python3.10.4
python: python3.10
7 changes: 7 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
from shutil import which

import pytest
from boa_zksync.util import install_era_test_node, install_zkvyper_compiler

pytest_plugins = [
"tests.fixtures.accounts",
Expand All @@ -11,4 +14,8 @@

@pytest.fixture(scope="session")
def is_zksync():
if not which("zkvyper"):
install_zkvyper_compiler()
if not which("era_test_node"):
install_era_test_node()
return True
6 changes: 4 additions & 2 deletions tests/fixtures/accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@

from tests.utils.tokens import mint_for_testing

_era_accounts = [Account.from_key(private_key)
for public_key, private_key in EraTestNode.TEST_ACCOUNTS]
_era_accounts = [
Account.from_key(private_key)
for public_key, private_key in EraTestNode.TEST_ACCOUNTS
]


@pytest.fixture(scope="module")
Expand Down
3 changes: 1 addition & 2 deletions tests/integration/test_create2_deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ def forked_chain(is_zksync):
rpc_url is not None
), "Provider url is not set, add RPC_ETHEREUM param to env"
if is_zksync:
boa.interpret.disable_cache()
boa_zksync.set_zksync_fork(rpc_url)
else:
boa.set_network_env(rpc_url)
Expand All @@ -24,7 +23,7 @@ def forked_chain(is_zksync):
@pytest.fixture(autouse=True)
def set_balances(forked_chain):
for acc in boa.env._accounts:
boa.env.set_balance(acc, 10 ** 25)
boa.env.set_balance(acc, 10**25)


@pytest.fixture(scope="module")
Expand Down
1 change: 0 additions & 1 deletion tests/unitary/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ def zksync(is_zksync):
for _public_key, private_key in EraTestNode.TEST_ACCOUNTS:
boa.env.add_account(Account.from_key(private_key))
boa.env.eoa = EraTestNode.TEST_ACCOUNTS[0][0]
boa.interpret.disable_cache() # TODO: remove this line when zksync is stable

0 comments on commit 43f7e6f

Please sign in to comment.