From 26c390eb7c554314679250d52f028be7ef57237e Mon Sep 17 00:00:00 2001 From: Carl Beekhuizen Date: Mon, 15 May 2023 16:03:27 -0600 Subject: [PATCH 01/17] Fix CircleCI tox env --- .circleci/config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 797c0720..4804859e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,18 +5,18 @@ tox_common: &tox_common steps: - checkout - restore_cache: - key: tox-deps3-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements_test.txt" }}-{{ checksum "setup.py" }}-{{ checksum "Makefile" }} + key: tox-deps4-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements_test.txt" }}-{{ checksum "setup.py" }}-{{ checksum "Makefile" }} - run: name: install dependencies - command: pip install --user tox + command: pip install tox - run: name: run tox - command: ~/.local/bin/tox + command: tox - save_cache: paths: - .tox - ./eggs - key: tox-deps3-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements_test.txt" }}-{{ checksum "setup.py" }}-{{ checksum "Makefile" }} + key: tox-deps4-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements_test.txt" }}-{{ checksum "setup.py" }}-{{ checksum "Makefile" }} orbs: win: circleci/windows@2.2.0 # The Windows orb give you everything you need to start using the Windows executor. From 0dda9829bbf8eecfa0639e457488808c732e73f4 Mon Sep 17 00:00:00 2001 From: Hsiao-Wei Wang Date: Tue, 22 Aug 2023 10:08:59 -0600 Subject: [PATCH 02/17] Add Holesky testnet --- staking_deposit/settings.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/staking_deposit/settings.py b/staking_deposit/settings.py index 9cd24d95..80ff5c68 100644 --- a/staking_deposit/settings.py +++ b/staking_deposit/settings.py @@ -15,6 +15,7 @@ class BaseChainSetting(NamedTuple): PRATER = 'prater' SEPOLIA = 'sepolia' ZHEJIANG = 'zhejiang' +HOLESKY = 'holesky' # Mainnet setting MainnetSetting = BaseChainSetting( @@ -32,6 +33,10 @@ class BaseChainSetting(NamedTuple): ZhejiangSetting = BaseChainSetting( NETWORK_NAME=ZHEJIANG, GENESIS_FORK_VERSION=bytes.fromhex('00000069'), GENESIS_VALIDATORS_ROOT=bytes.fromhex('53a92d8f2bb1d85f62d16a156e6ebcd1bcaba652d0900b2c2f387826f3481f6f')) +# Holesky setting +HoleskySetting = BaseChainSetting( + NETWORK_NAME=HOLESKY, GENESIS_FORK_VERSION=bytes.fromhex('00017000'), + GENESIS_VALIDATORS_ROOT=bytes.fromhex('9143aa7c615a7f7115e2b6aac319c03529df8242ae705fba9df39b79c59fa8b1')) ALL_CHAINS: Dict[str, BaseChainSetting] = { @@ -40,6 +45,7 @@ class BaseChainSetting(NamedTuple): PRATER: GoerliSetting, # Prater is the old name of the Prater/Goerli testnet SEPOLIA: SepoliaSetting, ZHEJIANG: ZhejiangSetting, + HOLESKY: HoleskySetting, } From 4ea123dd93b99c5116e36525a4e0f520b33a87e1 Mon Sep 17 00:00:00 2001 From: Carl Beekhuizen Date: Fri, 25 Aug 2023 12:35:50 -0600 Subject: [PATCH 03/17] Bump version number to 2.6.0 for release --- setup.py | 2 +- staking_deposit/settings.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 3f34b5be..a2e8827a 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ setup( name="staking_deposit", - version='2.5.0', + version='2.6.0', py_modules=["staking_deposit"], packages=find_packages(exclude=('tests', 'docs')), python_requires=">=3.8,<4", diff --git a/staking_deposit/settings.py b/staking_deposit/settings.py index 80ff5c68..85296efe 100644 --- a/staking_deposit/settings.py +++ b/staking_deposit/settings.py @@ -1,7 +1,7 @@ from typing import Dict, NamedTuple from eth_utils import decode_hex -DEPOSIT_CLI_VERSION = '2.5.0' +DEPOSIT_CLI_VERSION = '2.6.0' class BaseChainSetting(NamedTuple): From 0594c884909530d6c9195323c44c66a3132e403f Mon Sep 17 00:00:00 2001 From: Hsiao-Wei Wang Date: Mon, 25 Sep 2023 18:45:16 +0800 Subject: [PATCH 04/17] Change to the new Holesky fork version --- staking_deposit/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/staking_deposit/settings.py b/staking_deposit/settings.py index 85296efe..63d5afc8 100644 --- a/staking_deposit/settings.py +++ b/staking_deposit/settings.py @@ -35,7 +35,7 @@ class BaseChainSetting(NamedTuple): GENESIS_VALIDATORS_ROOT=bytes.fromhex('53a92d8f2bb1d85f62d16a156e6ebcd1bcaba652d0900b2c2f387826f3481f6f')) # Holesky setting HoleskySetting = BaseChainSetting( - NETWORK_NAME=HOLESKY, GENESIS_FORK_VERSION=bytes.fromhex('00017000'), + NETWORK_NAME=HOLESKY, GENESIS_FORK_VERSION=bytes.fromhex('01017000'), GENESIS_VALIDATORS_ROOT=bytes.fromhex('9143aa7c615a7f7115e2b6aac319c03529df8242ae705fba9df39b79c59fa8b1')) From 313a49e761e22799018d0d0cd8a5de04d680b352 Mon Sep 17 00:00:00 2001 From: Carl Beekhuizen Date: Mon, 25 Sep 2023 09:32:33 -0600 Subject: [PATCH 05/17] Bump version numbers --- setup.py | 2 +- staking_deposit/settings.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index a2e8827a..4003f37e 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ setup( name="staking_deposit", - version='2.6.0', + version='2.7.0', py_modules=["staking_deposit"], packages=find_packages(exclude=('tests', 'docs')), python_requires=">=3.8,<4", diff --git a/staking_deposit/settings.py b/staking_deposit/settings.py index 63d5afc8..e989d89b 100644 --- a/staking_deposit/settings.py +++ b/staking_deposit/settings.py @@ -1,7 +1,7 @@ from typing import Dict, NamedTuple from eth_utils import decode_hex -DEPOSIT_CLI_VERSION = '2.6.0' +DEPOSIT_CLI_VERSION = '2.7.0' class BaseChainSetting(NamedTuple): From bed758771cd6d0e34793f69671701a333615ed7d Mon Sep 17 00:00:00 2001 From: mxmar Date: Thu, 2 Nov 2023 11:41:33 +0100 Subject: [PATCH 06/17] Change lru-dict version Signed-off-by: mxmar --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 742a3ca6..0ca571b2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -141,7 +141,7 @@ eth-utils==1.10.0 \ # -r requirements.in # py-ecc # ssz -lru-dict==1.1.7 \ +lru-dict==1.2.0 \ --hash=sha256:45b81f67d75341d4433abade799a47e9c42a9e22a118531dcb5e549864032d7c # via # -r requirements.in From b34df537fcc96d00bf6f0709a968e6b8ce2a3b6c Mon Sep 17 00:00:00 2001 From: mxmar Date: Thu, 2 Nov 2023 14:45:26 +0100 Subject: [PATCH 07/17] Upstream master branch merged Signed-off-by: mxmar --- requirements.txt | 2 +- staking_deposit/settings.py | 2 +- tests/test_utils/test_validation.py | 17 +++++++++++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index 0ca571b2..742a3ca6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -141,7 +141,7 @@ eth-utils==1.10.0 \ # -r requirements.in # py-ecc # ssz -lru-dict==1.2.0 \ +lru-dict==1.1.7 \ --hash=sha256:45b81f67d75341d4433abade799a47e9c42a9e22a118531dcb5e549864032d7c # via # -r requirements.in diff --git a/staking_deposit/settings.py b/staking_deposit/settings.py index 42ec00c5..910bae0d 100644 --- a/staking_deposit/settings.py +++ b/staking_deposit/settings.py @@ -1,7 +1,7 @@ from typing import Dict, NamedTuple from eth_utils import decode_hex -DEPOSIT_CLI_VERSION = __version__ +DEPOSIT_CLI_VERSION = '2.7.0' class BaseChainSetting(NamedTuple): diff --git a/tests/test_utils/test_validation.py b/tests/test_utils/test_validation.py index 9b918462..51994b9e 100644 --- a/tests/test_utils/test_validation.py +++ b/tests/test_utils/test_validation.py @@ -8,6 +8,7 @@ normalize_input_list, validate_int_range, validate_password_strength, + normalize_bls_withdrawal_credentials_to_bytes, ) @@ -60,3 +61,19 @@ def test_validate_int_range(num: Any, low: int, high: int, valid: bool) -> None: ) def test_normalize_input_list(input, result): assert normalize_input_list(input) == result + + +@pytest.mark.parametrize( + 'input, result', + [ + ('1', ['1']), + ('1,2,3', ['1', '2', '3']), + ('[1,2,3]', ['1', '2', '3']), + ('(1,2,3)', ['1', '2', '3']), + ('{1,2,3}', ['1', '2', '3']), + ('1 2 3', ['1', '2', '3']), + ('1 2 3', ['1', '2', '3']), + ] +) +def test_normalize_bls_withdrawal_credentials_to_bytes(): + assert normalize_bls_withdrawal_credentials_to_bytes(input) == result From 89501c7ef2a73326e019508cd4e9b7f089b9852f Mon Sep 17 00:00:00 2001 From: mxmar Date: Thu, 2 Nov 2023 15:15:48 +0100 Subject: [PATCH 08/17] Cli version change Signed-off-by: mxmar --- .release-please-manifest.json | 2 +- staking_deposit/version.py | 2 +- tests/test_utils/test_validation.py | 10 ++-------- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 286fcd33..6ed9c801 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "2.5.6" + ".": "2.7.0" } diff --git a/staking_deposit/version.py b/staking_deposit/version.py index 5752f761..766ce2d0 100644 --- a/staking_deposit/version.py +++ b/staking_deposit/version.py @@ -1 +1 @@ -__version__ = '2.5.6' +__version__ = '2.7.0' diff --git a/tests/test_utils/test_validation.py b/tests/test_utils/test_validation.py index 51994b9e..fbe33a58 100644 --- a/tests/test_utils/test_validation.py +++ b/tests/test_utils/test_validation.py @@ -66,14 +66,8 @@ def test_normalize_input_list(input, result): @pytest.mark.parametrize( 'input, result', [ - ('1', ['1']), - ('1,2,3', ['1', '2', '3']), - ('[1,2,3]', ['1', '2', '3']), - ('(1,2,3)', ['1', '2', '3']), - ('{1,2,3}', ['1', '2', '3']), - ('1 2 3', ['1', '2', '3']), - ('1 2 3', ['1', '2', '3']), + ('0x00abfc563b1f859d24c91dde59b95621579792b00633b69b262d74ad1e9da3a4', ['']), ] ) -def test_normalize_bls_withdrawal_credentials_to_bytes(): +def test_normalize_bls_withdrawal_credentials_to_bytes(input, result): assert normalize_bls_withdrawal_credentials_to_bytes(input) == result From fece1275d53e384f19a707fe46010a39de5c330b Mon Sep 17 00:00:00 2001 From: mxmar Date: Thu, 2 Nov 2023 15:18:14 +0100 Subject: [PATCH 09/17] Change default network to LUKSO Mainnet Signed-off-by: mxmar --- staking_deposit/cli/generate_bls_to_execution_change.py | 2 +- staking_deposit/settings.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/staking_deposit/cli/generate_bls_to_execution_change.py b/staking_deposit/cli/generate_bls_to_execution_change.py index 0b3b0f49..8b83aed8 100644 --- a/staking_deposit/cli/generate_bls_to_execution_change.py +++ b/staking_deposit/cli/generate_bls_to_execution_change.py @@ -69,7 +69,7 @@ def get_password(text: str) -> str: list(ALL_CHAINS.keys()) ), ), - default=MAINNET, + default=LUKSO, help=lambda: load_text(['arg_chain', 'help'], func=FUNC_NAME), param_decls='--chain', prompt=choice_prompt_func( diff --git a/staking_deposit/settings.py b/staking_deposit/settings.py index 910bae0d..20328722 100644 --- a/staking_deposit/settings.py +++ b/staking_deposit/settings.py @@ -68,7 +68,7 @@ class BaseChainSetting(NamedTuple): } -def get_chain_setting(chain_name: str = MAINNET) -> BaseChainSetting: +def get_chain_setting(chain_name: str = LUKSO) -> BaseChainSetting: return ALL_CHAINS[chain_name] From a012f5faf939c1fd6030d28eafcea10c57603df1 Mon Sep 17 00:00:00 2001 From: mxmar Date: Fri, 3 Nov 2023 13:35:24 +0100 Subject: [PATCH 10/17] Change default network to LUKSO Mainnet Signed-off-by: mxmar --- staking_deposit/cli/generate_bls_to_execution_change.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/staking_deposit/cli/generate_bls_to_execution_change.py b/staking_deposit/cli/generate_bls_to_execution_change.py index 8b83aed8..fefc8ff1 100644 --- a/staking_deposit/cli/generate_bls_to_execution_change.py +++ b/staking_deposit/cli/generate_bls_to_execution_change.py @@ -35,7 +35,7 @@ ) from staking_deposit.settings import ( ALL_CHAINS, - MAINNET, + LUKSO, PRATER, get_chain_setting, get_devnet_chain_setting, From d31946333db92fa07631b93ec58b333cc167e2ad Mon Sep 17 00:00:00 2001 From: mxmar Date: Fri, 3 Nov 2023 15:42:43 +0100 Subject: [PATCH 11/17] Change version Signed-off-by: mxmar --- staking_deposit/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/staking_deposit/settings.py b/staking_deposit/settings.py index 20328722..e67b4488 100644 --- a/staking_deposit/settings.py +++ b/staking_deposit/settings.py @@ -1,7 +1,7 @@ from typing import Dict, NamedTuple from eth_utils import decode_hex -DEPOSIT_CLI_VERSION = '2.7.0' +DEPOSIT_CLI_VERSION = __version__ class BaseChainSetting(NamedTuple): From ddc7be792fd24920ae1cd525d71f746b62210ebf Mon Sep 17 00:00:00 2001 From: mxmar Date: Fri, 3 Nov 2023 15:43:53 +0100 Subject: [PATCH 12/17] Change version Signed-off-by: mxmar --- staking_deposit/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/staking_deposit/version.py b/staking_deposit/version.py index 766ce2d0..5752f761 100644 --- a/staking_deposit/version.py +++ b/staking_deposit/version.py @@ -1 +1 @@ -__version__ = '2.7.0' +__version__ = '2.5.6' From d4ebc14afb3f6c7ae55378035857f2fbe9976e7d Mon Sep 17 00:00:00 2001 From: mxmar Date: Fri, 3 Nov 2023 16:44:58 +0100 Subject: [PATCH 13/17] Change version Signed-off-by: mxmar --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 4003f37e..699a46ec 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ setup( name="staking_deposit", - version='2.7.0', + version=__version__, py_modules=["staking_deposit"], packages=find_packages(exclude=('tests', 'docs')), python_requires=">=3.8,<4", From 15b22fc1b32c333a628b4a27023b27e43ff619e9 Mon Sep 17 00:00:00 2001 From: mxmar Date: Tue, 7 Nov 2023 10:12:12 +0100 Subject: [PATCH 14/17] Version variable fixes Signed-off-by: mxmar --- .circleci/config.yml | 326 ---------------------------------- .release-please-manifest.json | 2 +- setup.py | 1 + staking_deposit/settings.py | 2 +- 4 files changed, 3 insertions(+), 328 deletions(-) delete mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 4804859e..00000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,326 +0,0 @@ -version: 2.1 - -tox_common: &tox_common - working_directory: ~/repo - steps: - - checkout - - restore_cache: - key: tox-deps4-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements_test.txt" }}-{{ checksum "setup.py" }}-{{ checksum "Makefile" }} - - run: - name: install dependencies - command: pip install tox - - run: - name: run tox - command: tox - - save_cache: - paths: - - .tox - - ./eggs - key: tox-deps4-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements_test.txt" }}-{{ checksum "setup.py" }}-{{ checksum "Makefile" }} - -orbs: - win: circleci/windows@2.2.0 # The Windows orb give you everything you need to start using the Windows executor. - -jobs: - # Job(s) with Linux OS - venv_build: - docker: - - image: cimg/python:3.10 - working_directory: ~/repo - steps: - - checkout - - restore_cache: - key: venv-deps2-{{ arch }}-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements_test.txt" }}-{{ checksum "setup.py" }}-{{ checksum "Makefile" }}-v3 - - run: - name: Install requirements in venv - command: make venv_build_test - - save_cache: - key: venv-deps2-{{ arch }}-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements_test.txt" }}-{{ checksum "setup.py" }}-{{ checksum "Makefile" }}-v3 - paths: - - ./venv - venv_pytest: - docker: - - image: cimg/python:3.10 - working_directory: ~/repo - steps: - - checkout - - restore_cache: - key: venv-deps2-{{ arch }}-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements_test.txt" }}-{{ checksum "setup.py" }}-{{ checksum "Makefile" }}-v3 - - run: - name: Run tests with venv - command: make venv_test - - store_artifacts: - path: test-reports/ - destination: tr1 - - store_test_results: - path: test-reports/ - venv_lint: - docker: - - image: cimg/python:3.10 - working_directory: ~/repo - steps: - - checkout - - restore_cache: - key: venv-deps2-{{ arch }}-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements_test.txt" }}-{{ checksum "setup.py" }}-{{ checksum "Makefile" }}-v3 - - run: - name: Run linter with venv - command: make venv_lint - tox-py310-core: - <<: *tox_common - docker: - - image: cimg/python:3.10 - environment: - TOXENV: py310-core - tox-py38-core: - <<: *tox_common - docker: - - image: cimg/python:3.8 - environment: - TOXENV: py38-core - tox-py310-script: - <<: *tox_common - docker: - - image: cimg/python:3.10 - environment: - TOXENV: py310-script - tox-py38-script: - <<: *tox_common - docker: - - image: cimg/python:3.8 - environment: - TOXENV: py38-script - # Job(s) with Windows OS - win-py310-script: - executor: - name: win/default - shell: powershell.exe - steps: - - checkout - - run: - name: "Install Python" - command: choco install python --version=3.10.3 - - run: - name: Install testing requirements on Windows - command: python -m pip install -r requirements_test.txt - - run: - name: Run deposit script on Windows" - command: python ./test_deposit_script.py - - run: - name: Run btec script on Windows" - command: python ./test_btec_script.py - build-linux-amd64: - machine: - image: ubuntu-2004:202201-02 - working_directory: ~/repo - steps: - - checkout - - run: - name: Install building requirements on Linux - command: | - env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install -f 3.10.2; - pyenv global 3.10.2; - pip install -r ./build_configs/linux/requirements.txt; - - run: - name: Build with build.spec - command: | - export PYTHONHASHSEED=42 - export CIRCLE_SHORT_SHA1=$(eval echo $CIRCLE_SHA1 | cut -c -7) - export BUILD_FILE_NAME=staking_deposit-cli-${CIRCLE_SHORT_SHA1}-linux-amd64; - mkdir ${BUILD_FILE_NAME}; - pyenv global 3.10.2; - pyinstaller --distpath ./${BUILD_FILE_NAME} ./build_configs/linux/build.spec; - - run: - name: Test executable binaries - command: | - export PYTHONHASHSEED=42 - export CIRCLE_SHORT_SHA1=$(eval echo $CIRCLE_SHA1 | cut -c -7) - export BUILD_FILE_NAME=staking_deposit-cli-${CIRCLE_SHORT_SHA1}-linux-amd64; - export TEST_FOLDER_NAME=TMP_TEST_FOLDER - mkdir ${TEST_FOLDER_NAME} - cp -r ${BUILD_FILE_NAME} ${TEST_FOLDER_NAME} - cp test_binary_deposit_script.py ${TEST_FOLDER_NAME} - cp test_binary_btec_script.py ${TEST_FOLDER_NAME} - cd ${TEST_FOLDER_NAME} - python test_binary_deposit_script.py ./${BUILD_FILE_NAME}; - python test_binary_btec_script.py ./${BUILD_FILE_NAME}; - - run: - name: Compress the file - command: | - export PYTHONHASHSEED=42 - export CIRCLE_SHORT_SHA1=$(eval echo $CIRCLE_SHA1 | cut -c -7) - export BUILD_FILE_NAME=staking_deposit-cli-${CIRCLE_SHORT_SHA1}-linux-amd64; - tar -zcvf ${BUILD_FILE_NAME}.tar.gz ./${BUILD_FILE_NAME}; - mkdir /tmp/artifacts; - cp ${BUILD_FILE_NAME}.tar.gz /tmp/artifacts; - sha256sum ${BUILD_FILE_NAME}.tar.gz | head -c 64 > /tmp/artifacts/${BUILD_FILE_NAME}.sha256 - - store_artifacts: - path: /tmp/artifacts - build-linux-arm64: - machine: - image: ubuntu-2004:202201-02 - resource_class: arm.medium - working_directory: ~/repo - steps: - - checkout - - run: - name: Install building requirements on Linux ARM64 - command: | - env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install -f 3.10.2; - pyenv global 3.10.2; - pip install -r ./build_configs/linux/requirements.txt; - - run: - name: Build with build.spec - command: | - export PYTHONHASHSEED=42 - export CIRCLE_SHORT_SHA1=$(eval echo $CIRCLE_SHA1 | cut -c -7) - export BUILD_FILE_NAME=staking_deposit-cli-${CIRCLE_SHORT_SHA1}-linux-arm64; - mkdir ${BUILD_FILE_NAME}; - pyenv global 3.10.2; - pyinstaller --distpath ./${BUILD_FILE_NAME} ./build_configs/linux/build.spec; - - run: - name: Test executable binaries - command: | - export PYTHONHASHSEED=42 - export CIRCLE_SHORT_SHA1=$(eval echo $CIRCLE_SHA1 | cut -c -7) - export BUILD_FILE_NAME=staking_deposit-cli-${CIRCLE_SHORT_SHA1}-linux-arm64; - export TEST_FOLDER_NAME=TMP_TEST_FOLDER - mkdir ${TEST_FOLDER_NAME} - cp -r ${BUILD_FILE_NAME} ${TEST_FOLDER_NAME} - cp test_binary_deposit_script.py ${TEST_FOLDER_NAME} - cp test_binary_btec_script.py ${TEST_FOLDER_NAME} - cd ${TEST_FOLDER_NAME} - python test_binary_deposit_script.py ./${BUILD_FILE_NAME}; - python test_binary_btec_script.py ./${BUILD_FILE_NAME}; - - run: - name: Compress the file - command: | - export CIRCLE_SHORT_SHA1=$(eval echo $CIRCLE_SHA1 | cut -c -7) - export BUILD_FILE_NAME=staking_deposit-cli-${CIRCLE_SHORT_SHA1}-linux-arm64; - tar -zcvf ${BUILD_FILE_NAME}.tar.gz ./${BUILD_FILE_NAME}; - mkdir /tmp/artifacts; - cp ${BUILD_FILE_NAME}.tar.gz /tmp/artifacts; - sha256sum ${BUILD_FILE_NAME}.tar.gz | head -c 64 > /tmp/artifacts/${BUILD_FILE_NAME}.sha256 - - store_artifacts: - path: /tmp/artifacts - build-windows: - executor: - name: win/default - shell: powershell.exe - steps: - - checkout - - run: - name: "Install Python" - command: choco install python --version=3.10.3 - - run: - name: Install building requirements on Windows - command: pip install -r ./build_configs/windows/requirements.txt - - run: - name: Build with build.spec - command: | - $PYTHONHASHSEED = 42 - $CIRCLE_SHORT_SHA1 = $env:CIRCLE_SHA1.substring(0,7) - $BUILD_FILE_NAME = "staking_deposit-cli-" + $CIRCLE_SHORT_SHA1 + "-windows-amd64" - mkdir $BUILD_FILE_NAME - $BUILD_FILE_NAME_PATH = ".\" + $BUILD_FILE_NAME - pyinstaller --distpath $BUILD_FILE_NAME_PATH .\build_configs\windows\build.spec - - run: - name: Test executable binaries - command: | - $PYTHONHASHSEED = 42 - $CIRCLE_SHORT_SHA1 = $env:CIRCLE_SHA1.substring(0,7) - $BUILD_FILE_NAME = "staking_deposit-cli-" + $CIRCLE_SHORT_SHA1 + "-windows-amd64" - $TEST_FOLDER_NAME = "TMP_TEST_FOLDER" - mkdir ${TEST_FOLDER_NAME} - Copy-item ${BUILD_FILE_NAME} -destination ${TEST_FOLDER_NAME} -recurse - copy test_binary_deposit_script.py ${TEST_FOLDER_NAME} - copy test_binary_btec_script.py ${TEST_FOLDER_NAME} - cd ${TEST_FOLDER_NAME} - python test_binary_deposit_script.py ${BUILD_FILE_NAME} - python test_binary_btec_script.py ${BUILD_FILE_NAME} - - run: - name: Compress the file - command: | - $PYTHONHASHSEED = 42 - $CIRCLE_SHORT_SHA1 = $env:CIRCLE_SHA1.substring(0,7) - $BUILD_FILE_NAME = "staking_deposit-cli-" + $CIRCLE_SHORT_SHA1 + "-windows-amd64" - $BUILD_FILE_NAME_PATH = ".\" + $BUILD_FILE_NAME - $ZIP_FILE_NAME = $BUILD_FILE_NAME + ".zip" - Compress-Archive -Path $BUILD_FILE_NAME_PATH -DestinationPath $ZIP_FILE_NAME - mkdir \tmp\artifacts - copy $ZIP_FILE_NAME \tmp\artifacts\ - $CHECKSUM_FILE_NAME_PASH = "\tmp\artifacts\" + $BUILD_FILE_NAME + ".sha256" - certUtil -hashfile $ZIP_FILE_NAME SHA256 | findstr /i /v "SHA256" | findstr /i /v "CertUtil" > $CHECKSUM_FILE_NAME_PASH - - store_artifacts: - path: /tmp/artifacts - build-macos: - macos: - xcode: 13.4.1 - working_directory: ~/repo - steps: - - run: xcodebuild -version - - run: python3 --version - - checkout - - run: - name: Install building requirements on MacOS - command: pip3 install -r ./build_configs/macos/requirements.txt - - run: - name: Build with build.spec - command: | - export PYTHONHASHSEED=42 - export CIRCLE_SHORT_SHA1=$(eval echo $CIRCLE_SHA1 | cut -c -7) - export BUILD_FILE_NAME=staking_deposit-cli-${CIRCLE_SHORT_SHA1}-darwin-amd64; - mkdir ${BUILD_FILE_NAME}; - pyinstaller --distpath ./${BUILD_FILE_NAME} ./build_configs/macos/build.spec; - - run: - name: Test executable binaries - command: | - export PYTHONHASHSEED=42 - export CIRCLE_SHORT_SHA1=$(eval echo $CIRCLE_SHA1 | cut -c -7) - export BUILD_FILE_NAME=staking_deposit-cli-${CIRCLE_SHORT_SHA1}-darwin-amd64; - export TEST_FOLDER_NAME=TMP_TEST_FOLDER - mkdir ${TEST_FOLDER_NAME} - cp -r ${BUILD_FILE_NAME} ${TEST_FOLDER_NAME} - cp test_binary_deposit_script.py ${TEST_FOLDER_NAME} - cp test_binary_btec_script.py ${TEST_FOLDER_NAME} - cd ${TEST_FOLDER_NAME} - python3 test_binary_deposit_script.py ./${BUILD_FILE_NAME}; - python3 test_binary_btec_script.py ./${BUILD_FILE_NAME}; - - run: - name: Compress the file - command: | - export PYTHONHASHSEED=42 - export CIRCLE_SHORT_SHA1=$(eval echo $CIRCLE_SHA1 | cut -c -7) - export BUILD_FILE_NAME=staking_deposit-cli-${CIRCLE_SHORT_SHA1}-darwin-amd64; - tar -zcvf ${BUILD_FILE_NAME}.tar.gz ./${BUILD_FILE_NAME}; - mkdir /tmp/artifacts; - cp ${BUILD_FILE_NAME}.tar.gz /tmp/artifacts; - shasum -a 256 ${BUILD_FILE_NAME}.tar.gz | head -c 64 > /tmp/artifacts/${BUILD_FILE_NAME}.sha256 - - store_artifacts: - path: /tmp/artifacts - -workflows: - version: 2.1 - all_test: - jobs: - - venv_build - - venv_pytest: - requires: - - venv_build - - venv_lint: - requires: - - venv_build - - tox-py310-core - - tox-py38-core - - tox-py310-script - - tox-py38-script - - win-py310-script - build_linux: - jobs: - - build-linux-amd64 - - build-linux-arm64 - build_windows: - jobs: - - build-windows - build_macos: - jobs: - - build-macos diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 6ed9c801..286fcd33 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "2.7.0" + ".": "2.5.6" } diff --git a/setup.py b/setup.py index 699a46ec..229bcc89 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,5 @@ from setuptools import find_packages, setup +from staking_deposit import __version__ """ THIS IS A STUB FOR RUNNING THE APP diff --git a/staking_deposit/settings.py b/staking_deposit/settings.py index e67b4488..210a45f7 100644 --- a/staking_deposit/settings.py +++ b/staking_deposit/settings.py @@ -1,5 +1,5 @@ from typing import Dict, NamedTuple -from eth_utils import decode_hex +from .version import __version__ DEPOSIT_CLI_VERSION = __version__ From 9d79b801ce8623d08be3ee573cd04ca03d3ff4db Mon Sep 17 00:00:00 2001 From: mxmar Date: Wed, 8 Nov 2023 11:16:04 +0100 Subject: [PATCH 15/17] Added some pytests Signed-off-by: mxmar --- tests/test_utils/test_validation.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/tests/test_utils/test_validation.py b/tests/test_utils/test_validation.py index fbe33a58..af008a5d 100644 --- a/tests/test_utils/test_validation.py +++ b/tests/test_utils/test_validation.py @@ -9,6 +9,7 @@ validate_int_range, validate_password_strength, normalize_bls_withdrawal_credentials_to_bytes, + validate_bls_withdrawal_credentials, ) @@ -64,10 +65,20 @@ def test_normalize_input_list(input, result): @pytest.mark.parametrize( - 'input, result', + 'input', + [ + ('0x00abfc563b1f859d24c91dde59b95621579792b00633b69b262d74ad1e9da3a4'), + ] +) +def test_normalize_bls_withdrawal_credentials_to_bytes(input): + assert normalize_bls_withdrawal_credentials_to_bytes(input) is not ValidationError + + +@pytest.mark.parametrize( + 'input', [ - ('0x00abfc563b1f859d24c91dde59b95621579792b00633b69b262d74ad1e9da3a4', ['']), + ('0x00abfc563b1f859d24c91dde59b95621579792b00633b69b262d74ad1e9da3a4'), ] ) -def test_normalize_bls_withdrawal_credentials_to_bytes(input, result): - assert normalize_bls_withdrawal_credentials_to_bytes(input) == result +def test_validate_bls_withdrawal_credentials(input): + assert validate_bls_withdrawal_credentials(input) is not ValidationError From cc9c4f4aa266139badc24fad8b6fb5865182c554 Mon Sep 17 00:00:00 2001 From: mxmar Date: Wed, 8 Nov 2023 11:16:30 +0100 Subject: [PATCH 16/17] Added some pytests Signed-off-by: mxmar --- tests/test_utils/test_validation.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_utils/test_validation.py b/tests/test_utils/test_validation.py index af008a5d..2139b4f8 100644 --- a/tests/test_utils/test_validation.py +++ b/tests/test_utils/test_validation.py @@ -67,7 +67,7 @@ def test_normalize_input_list(input, result): @pytest.mark.parametrize( 'input', [ - ('0x00abfc563b1f859d24c91dde59b95621579792b00633b69b262d74ad1e9da3a4'), + '0x00abfc563b1f859d24c91dde59b95621579792b00633b69b262d74ad1e9da3a4', ] ) def test_normalize_bls_withdrawal_credentials_to_bytes(input): @@ -77,7 +77,7 @@ def test_normalize_bls_withdrawal_credentials_to_bytes(input): @pytest.mark.parametrize( 'input', [ - ('0x00abfc563b1f859d24c91dde59b95621579792b00633b69b262d74ad1e9da3a4'), + '0x00abfc563b1f859d24c91dde59b95621579792b00633b69b262d74ad1e9da3a4', ] ) def test_validate_bls_withdrawal_credentials(input): From 0da7f00a637d0c6e260bdf6af5f0c1ea80efbb29 Mon Sep 17 00:00:00 2001 From: mxmar Date: Tue, 12 Dec 2023 16:04:50 +0100 Subject: [PATCH 17/17] Local bash script execution fixes Signed-off-by: mxmar --- deposit.sh | 6 +++--- requirements.txt | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/deposit.sh b/deposit.sh index cda7f036..3af4663d 100755 --- a/deposit.sh +++ b/deposit.sh @@ -4,12 +4,12 @@ if [[ "$OSTYPE" == "linux"* ]] || [[ "$OSTYPE" == "linux-android"* ]] || [[ "$OS echo $OSTYPE if [[ $1 == "install" ]]; then echo "Installing dependencies..." - pip3 install -r requirements.txt - python3 setup.py install + python3.10 -m pip install -r requirements.txt + python3.10 setup.py install exit 1 fi echo "Running deposit-cli..." - PYTHONPATH=. python3 ./staking_deposit/deposit.py "$@" + PYTHONPATH=. python3.10 ./staking_deposit/deposit.py "$@" elif [[ "$OSTYPE" == "msys" ]] || [[ "$OSTYPE" == "cygwin" ]]; then echo $OSTYPE diff --git a/requirements.txt b/requirements.txt index 742a3ca6..52a41019 100644 --- a/requirements.txt +++ b/requirements.txt @@ -141,8 +141,8 @@ eth-utils==1.10.0 \ # -r requirements.in # py-ecc # ssz -lru-dict==1.1.7 \ - --hash=sha256:45b81f67d75341d4433abade799a47e9c42a9e22a118531dcb5e549864032d7c +lru-dict==1.1.8 \ + --hash=sha256:3fef595c4f573141d54a38bda9221b9ee3cbe0acc73d67304a1a6d5972eb2a02 # via # -r requirements.in # ssz