Skip to content

Commit

Permalink
deposit_contract/venv
Browse files Browse the repository at this point in the history
PR feedback + bump eth-tester
  • Loading branch information
hwwhww committed Jun 8, 2019
1 parent 96237c7 commit 5b8cca8
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 21 deletions.
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ commands:
description: "Restore the cache with deposit_contract keys"
steps:
- restore_cached_venv:
venv_name: v2-deposit-contract
venv_name: v3-deposit-contract
reqs_checksum: cache-{{ checksum "test_libs/pyspec/requirements.txt" }}-{{ checksum "deposit_contract/requirements-testing.txt" }}
save_deposit_contract_cached_venv:
description: Save a venv into a cache with deposit_contract keys"
steps:
- save_cached_venv:
venv_name: v2-deposit-contract
venv_name: v3-deposit-contract
reqs_checksum: cache-{{ checksum "test_libs/pyspec/requirements.txt" }}-{{ checksum "deposit_contract/requirements-testing.txt" }}
venv_path: ./test_libs/pyspec/venv
venv_path: ./deposit_contract/venv
jobs:
checkout_specs:
docker:
Expand Down
15 changes: 6 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ clean:
rm -rf $(GENERATOR_VENVS)
rm -rf $(PY_SPEC_DIR)/venv $(PY_SPEC_DIR)/.pytest_cache
rm -rf $(PY_SPEC_ALL_TARGETS)
rm -rf $(DEPOSIT_CONTRACT_DIR)/venv $(DEPOSIT_CONTRACT_DIR)/.pytest_cache

# "make gen_yaml_tests" to run generators
gen_yaml_tests: $(PY_SPEC_ALL_TARGETS) $(YAML_TEST_TARGETS)
Expand All @@ -50,19 +51,15 @@ lint: $(PY_SPEC_ALL_TARGETS)
cd $(PY_SPEC_DIR); . venv/bin/activate; \
flake8 --ignore=E252,W504,W503 --max-line-length=120 ./eth2spec;

install_deposit_contract_test:
cd $(DEPOSIT_CONTRACT_DIR); python3 -m venv venv; . venv/bin/activate; pip3 install -r requirements-testing.txt

compile_deposit_contract:
cd $(PY_SPEC_DIR); python3 -m venv venv; . venv/bin/activate; \
cd ../..; cd $(DEPOSIT_CONTRACT_DIR); \
cd $(DEPOSIT_CONTRACT_DIR); . venv/bin/activate; \
python tool/compile_deposit_contract.py contracts/validator_registration.v.py;

install_deposit_contract_test:
cd $(PY_SPEC_DIR); python3 -m venv venv; . venv/bin/activate; \
cd ../..; cd $(DEPOSIT_CONTRACT_DIR); \
pip3 install -r requirements-testing.txt

test_deposit_contract: $(PY_SPEC_ALL_TARGETS)
cd $(PY_SPEC_DIR); python3 -m venv venv; . venv/bin/activate; \
cd ../.. && cd $(DEPOSIT_CONTRACT_DIR); \
cd $(DEPOSIT_CONTRACT_DIR); . venv/bin/activate; \
pip3 install -r requirements-testing.txt; \
python -m pytest .

Expand Down
13 changes: 7 additions & 6 deletions deposit_contract/README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
# Deposit contract

## How to compile the contract?
## How to set up the testing environment?

Under the `eth2.0-specs` directory, execute:

```sh
make compile_deposit_contract
make install_deposit_contract_test
```

The ABI and bytecode will be updated at [`contracts/validator_registration.json`](./contracts/validator_registration.json).

## How to set up the testing environment?
## How to compile the contract?

```sh
make install_deposit_contract_test
make compile_deposit_contract
```

The ABI and bytecode will be updated at [`contracts/validator_registration.json`](./contracts/validator_registration.json).


## How to run tests?

```sh
Expand Down
5 changes: 2 additions & 3 deletions deposit_contract/requirements-testing.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
tox==3.0.0
eth-tester[py-evm]==0.1.0b29
eth-tester[py-evm]==0.1.0b39
vyper==0.1.0b9
web3==4.8.3
web3==5.0.0b2
pytest==3.6.1
../test_libs/pyspec

0 comments on commit 5b8cca8

Please sign in to comment.