@@ -8,10 +8,6 @@ ETH2SPEC_MODULE_DIR = $(PY_SPEC_DIR)/eth2spec
88TEST_REPORT_DIR = $(PY_SPEC_DIR ) /test-reports
99TEST_VECTOR_DIR = ../consensus-spec-tests/tests
1010GENERATOR_DIR = ./tests/generators
11- SOLIDITY_DEPOSIT_CONTRACT_DIR = ./solidity_deposit_contract
12- SOLIDITY_DEPOSIT_CONTRACT_SOURCE = ${SOLIDITY_DEPOSIT_CONTRACT_DIR}/deposit_contract.sol
13- SOLIDITY_FILE_NAME = deposit_contract.json
14- DEPOSIT_CONTRACT_TESTER_DIR = ${SOLIDITY_DEPOSIT_CONTRACT_DIR}/web3_tester
1511CONFIGS_DIR = ./configs
1612TEST_PRESET_TYPE ?= minimal
1713# Collect a list of generator names
@@ -45,20 +41,12 @@ COV_HTML_OUT_DIR=$(PY_SPEC_DIR)/$(COV_HTML_OUT)
4541COV_INDEX_FILE =$(COV_HTML_OUT_DIR ) /index.html
4642
4743CURRENT_DIR = ${CURDIR}
48- LINTER_CONFIG_FILE = $(CURRENT_DIR ) /linter.ini
4944GENERATOR_ERROR_LOG_FILE = $(CURRENT_DIR ) /$(TEST_VECTOR_DIR ) /testgen_error_log.txt
5045
5146SCRIPTS_DIR = ${CURRENT_DIR}/scripts
5247
53- export DAPP_SKIP_BUILD: =1
54- export DAPP_SRC: =$(SOLIDITY_DEPOSIT_CONTRACT_DIR )
55- export DAPP_LIB: =$(SOLIDITY_DEPOSIT_CONTRACT_DIR ) /lib
56- export DAPP_JSON: =build/combined.json
57-
5848.PHONY : clean partial_clean all test citest lint generate_tests pyspec install_test open_cov \
59- install_deposit_contract_tester test_deposit_contract install_deposit_contract_compiler \
60- compile_deposit_contract test_compile_deposit_contract check_toc \
61- detect_generator_incomplete detect_generator_error_log
49+ check_toc detect_generator_incomplete detect_generator_error_log
6250
6351all : $(PY_SPEC_ALL_TARGETS )
6452
@@ -162,33 +150,16 @@ codespell:
162150
163151lint : pyspec
164152 . venv/bin/activate; cd $(PY_SPEC_DIR ) ; \
165- flake8 --config $(LINTER_CONFIG_FILE ) ./eth2spec \
166- && python -m pylint --rcfile $(LINTER_CONFIG_FILE ) $(PYLINT_SCOPE ) \
167- && python -m mypy --config-file $(LINTER_CONFIG_FILE ) $(MYPY_SCOPE )
153+ flake8 --config $(CURRENT_DIR ) /flake8.ini ./eth2spec \
154+ && python -m pylint --rcfile $(CURRENT_DIR ) /pylint.ini $(PYLINT_SCOPE ) \
155+ && python -m mypy --config-file $(CURRENT_DIR ) /mypy.ini $(MYPY_SCOPE )
168156
169157lint_generators : pyspec
170158 . venv/bin/activate; cd $(TEST_GENERATORS_DIR ) ; \
171- flake8 --config $(LINTER_CONFIG_FILE )
172-
173- compile_deposit_contract :
174- @cd $(SOLIDITY_DEPOSIT_CONTRACT_DIR )
175- @git submodule update --recursive --init
176- @solc --metadata-literal --optimize --optimize-runs 5000000 --bin --abi --combined-json=abi,bin,bin-runtime,srcmap,srcmap-runtime,ast,metadata,storage-layout --overwrite -o build $(SOLIDITY_DEPOSIT_CONTRACT_SOURCE ) $(SOLIDITY_DEPOSIT_CONTRACT_DIR ) /tests/deposit_contract.t.sol
177- @/bin/echo -n ' {"abi": ' > $(SOLIDITY_FILE_NAME )
178- @cat build/DepositContract.abi >> $(SOLIDITY_FILE_NAME )
179- @/bin/echo -n ' , "bytecode": "0x' >> $(SOLIDITY_FILE_NAME )
180- @cat build/DepositContract.bin >> $(SOLIDITY_FILE_NAME )
181- @/bin/echo -n ' "}' >> $(SOLIDITY_FILE_NAME )
182-
183- test_deposit_contract :
184- dapp test -v --fuzz-runs 5
185-
186- install_deposit_contract_web3_tester :
187- cd $(DEPOSIT_CONTRACT_TESTER_DIR ) ; python3 -m venv venv; . venv/bin/activate; python3 -m pip install -r requirements.txt
159+ flake8 --config $(CURRENT_DIR ) /flake8.ini
188160
189- test_deposit_contract_web3_tests :
190- cd $(DEPOSIT_CONTRACT_TESTER_DIR ) ; . venv/bin/activate; \
191- python3 -m pytest .
161+ # If set to true, it will not run generator tests.
162+ modcheck ?= false
192163
193164# Runs a generator, identified by param 1
194165define run_generator
@@ -208,7 +179,7 @@ define run_generator
208179 . venv/bin/activate; \
209180 pip3 install ../../../dist/eth2spec-*.whl; \
210181 pip3 install 'eth2spec[generator]'; \
211- python3 main.py -o $(CURRENT_DIR ) /$(TEST_VECTOR_DIR ) ; \
182+ python3 main.py -o $(CURRENT_DIR ) /$(TEST_VECTOR_DIR ) $( if $( filter true, $( modcheck ) ) ,--modcheck) ; \
212183 echo "generator $(1 ) finished"
213184endef
214185
0 commit comments