mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2024-11-10 12:29:49 +03:00
Merge remote-tracking branch 'origin/long_lived/atari' into dl_to_nft_chialisp
This commit is contained in:
commit
917a76b50e
5
.flake8
5
.flake8
@ -2,3 +2,8 @@
|
||||
max-line-length = 120
|
||||
exclude = ./typings/**/*
|
||||
ignore = E203,W503
|
||||
per-file-ignores =
|
||||
tests/util/build_network_protocol_files.py:F405
|
||||
tests/util/test_network_protocol_files.py:F405
|
||||
tests/util/test_network_protocol_json.py:F405
|
||||
tests/util/protocol_messages_json.py:E501
|
||||
|
2
.github/workflows/benchmarks.yml
vendored
2
.github/workflows/benchmarks.yml
vendored
@ -74,4 +74,4 @@ jobs:
|
||||
- name: pytest
|
||||
run: |
|
||||
. ./activate
|
||||
./venv/bin/py.test -n 0 -m benchmark tests
|
||||
./venv/bin/py.test -n 0 --capture no -m benchmark tests
|
||||
|
@ -172,15 +172,15 @@ jobs:
|
||||
py3createtorrent -f -t udp://tracker.opentrackr.org:1337/announce $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_arm64.deb -o $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_arm64.deb.torrent --webseed https://download.chia.net/install/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_arm64.deb
|
||||
ls $GITHUB_WORKSPACE/build_scripts/final_installer/
|
||||
|
||||
- name: Upload Beta Installer
|
||||
- name: Upload Dev Installer
|
||||
if: steps.check_secrets.outputs.HAS_SECRET && github.ref == 'refs/heads/main'
|
||||
env:
|
||||
CHIA_INSTALLER_VERSION: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}
|
||||
run: |
|
||||
aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_arm64.deb s3://download.chia.net/beta/chia-blockchain_arm64_latest_beta.deb
|
||||
aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_arm64.deb.sha256 s3://download.chia.net/beta/chia-blockchain_arm64_latest_beta.deb.sha256
|
||||
aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_arm64.deb s3://download.chia.net/beta/chia-blockchain-cli_arm64_latest_beta.deb
|
||||
aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_arm64.deb.sha256 s3://download.chia.net/beta/chia-blockchain-cli_arm64_latest_beta.deb.sha256
|
||||
aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_arm64.deb s3://download.chia.net/latest-dev/chia-blockchain_arm64_latest_dev.deb
|
||||
aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_arm64.deb.sha256 s3://download.chia.net/latest-dev/chia-blockchain_arm64_latest_dev.deb.sha256
|
||||
aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_arm64.deb s3://download.chia.net/latest-dev/chia-blockchain-cli_arm64_latest_dev.deb
|
||||
aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_arm64.deb.sha256 s3://download.chia.net/latest-dev/chia-blockchain-cli_arm64_latest_dev.deb.sha256
|
||||
|
||||
- name: Upload Release Files
|
||||
if: steps.check_secrets.outputs.HAS_SECRET && startsWith(github.ref, 'refs/tags/')
|
||||
|
10
.github/workflows/build-linux-installer-deb.yml
vendored
10
.github/workflows/build-linux-installer-deb.yml
vendored
@ -213,15 +213,15 @@ jobs:
|
||||
py3createtorrent -f -t udp://tracker.opentrackr.org:1337/announce ${{ github.workspace }}/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_amd64.deb -o ${{ github.workspace }}/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_amd64.deb.torrent --webseed https://download.chia.net/install/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_amd64.deb
|
||||
ls
|
||||
|
||||
- name: Upload Beta Installer
|
||||
- name: Upload Dev Installer
|
||||
if: steps.check_secrets.outputs.HAS_SECRET && github.ref == 'refs/heads/main'
|
||||
env:
|
||||
CHIA_INSTALLER_VERSION: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}
|
||||
run: |
|
||||
aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_amd64.deb s3://download.chia.net/beta/chia-blockchain_amd64_latest_beta.deb
|
||||
aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_amd64.deb.sha256 s3://download.chia.net/beta/chia-blockchain_amd64_latest_beta.deb.sha256
|
||||
aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_amd64.deb s3://download.chia.net/beta/chia-blockchain-cli_amd64_latest_beta.deb
|
||||
aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_amd64.deb.sha256 s3://download.chia.net/beta/chia-blockchain-cli_amd64_latest_beta.deb.sha256
|
||||
aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_amd64.deb s3://download.chia.net/latest-dev/chia-blockchain_amd64_latest_dev.deb
|
||||
aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_amd64.deb.sha256 s3://download.chia.net/latest-dev/chia-blockchain_amd64_latest_dev.deb.sha256
|
||||
aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_amd64.deb s3://download.chia.net/latest-dev/chia-blockchain-cli_amd64_latest_dev.deb
|
||||
aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_amd64.deb.sha256 s3://download.chia.net/latest-dev/chia-blockchain-cli_amd64_latest_dev.deb.sha256
|
||||
|
||||
- name: Upload Release Files
|
||||
env:
|
||||
|
10
.github/workflows/build-linux-installer-rpm.yml
vendored
10
.github/workflows/build-linux-installer-rpm.yml
vendored
@ -173,15 +173,15 @@ jobs:
|
||||
py3createtorrent -f -t udp://tracker.opentrackr.org:1337/announce $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli-${CHIA_INSTALLER_VERSION}-1.x86_64.rpm -o $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli-${CHIA_INSTALLER_VERSION}-1.x86_64.rpm.torrent --webseed https://download.chia.net/install/chia-blockchain-cli-${CHIA_INSTALLER_VERSION}-1.x86_64.rpm
|
||||
ls
|
||||
|
||||
- name: Upload Beta Installer
|
||||
- name: Upload Dev Installer
|
||||
if: steps.check_secrets.outputs.HAS_SECRET && github.ref == 'refs/heads/main'
|
||||
env:
|
||||
CHIA_INSTALLER_VERSION: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}
|
||||
run: |
|
||||
aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-${CHIA_INSTALLER_VERSION}-1.x86_64.rpm s3://download.chia.net/beta/chia-blockchain-1.x86_64_latest_beta.rpm
|
||||
aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-${CHIA_INSTALLER_VERSION}-1.x86_64.rpm.sha256 s3://download.chia.net/beta/chia-blockchain-1.x86_64_latest_beta.rpm.sha256
|
||||
aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli-${CHIA_INSTALLER_VERSION}-1.x86_64.rpm s3://download.chia.net/beta/chia-blockchain-cli-1.x86_64_latest_beta.rpm
|
||||
aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli-${CHIA_INSTALLER_VERSION}-1.x86_64.rpm.sha256 s3://download.chia.net/beta/chia-blockchain-cli-1.x86_64_latest_beta.rpm.sha256
|
||||
aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-${CHIA_INSTALLER_VERSION}-1.x86_64.rpm s3://download.chia.net/latest-dev/chia-blockchain-1.x86_64_latest_dev.rpm
|
||||
aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-${CHIA_INSTALLER_VERSION}-1.x86_64.rpm.sha256 s3://download.chia.net/latest-dev/chia-blockchain-1.x86_64_latest_dev.rpm.sha256
|
||||
aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli-${CHIA_INSTALLER_VERSION}-1.x86_64.rpm s3://download.chia.net/latest-dev/chia-blockchain-cli-1.x86_64_latest_dev.rpm
|
||||
aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli-${CHIA_INSTALLER_VERSION}-1.x86_64.rpm.sha256 s3://download.chia.net/latest-dev/chia-blockchain-cli-1.x86_64_latest_dev.rpm.sha256
|
||||
|
||||
- name: Upload Release Files
|
||||
if: steps.check_secrets.outputs.HAS_SECRET && startsWith(github.ref, 'refs/tags/')
|
||||
|
6
.github/workflows/build-macos-installer.yml
vendored
6
.github/workflows/build-macos-installer.yml
vendored
@ -184,7 +184,7 @@ jobs:
|
||||
py3createtorrent -f -t udp://tracker.opentrackr.org:1337/announce ${{ github.workspace }}/build_scripts/final_installer/Chia-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}.dmg -o ${{ github.workspace }}/build_scripts/final_installer/Chia-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}.dmg.torrent --webseed https://download.chia.net/install/Chia-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}.dmg
|
||||
ls ${{ github.workspace }}/build_scripts/final_installer/
|
||||
|
||||
- name: Upload Beta Installer
|
||||
- name: Upload Dev Installer
|
||||
if: steps.check_secrets.outputs.HAS_AWS_SECRET && github.ref == 'refs/heads/main'
|
||||
env:
|
||||
CHIA_INSTALLER_VERSION: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}
|
||||
@ -192,8 +192,8 @@ jobs:
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.INSTALLER_UPLOAD_SECRET }}
|
||||
AWS_REGION: us-west-2
|
||||
run: |
|
||||
aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/Chia-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}.dmg s3://download.chia.net/beta/Chia-intel_latest_beta.dmg
|
||||
aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/Chia-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}.dmg.sha256 s3://download.chia.net/beta/Chia-intel_latest_beta.dmg.sha256
|
||||
aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/Chia-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}.dmg s3://download.chia.net/latest-dev/Chia-intel_latest_dev.dmg
|
||||
aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/Chia-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}.dmg.sha256 s3://download.chia.net/latest-dev/Chia-intel_latest_dev.dmg.sha256
|
||||
|
||||
- name: Upload Release Files
|
||||
if: steps.check_secrets.outputs.HAS_AWS_SECRET && startsWith(github.ref, 'refs/tags/')
|
||||
|
@ -163,7 +163,7 @@ jobs:
|
||||
arch -arm64 py3createtorrent -f -t udp://tracker.opentrackr.org:1337/announce ${{ github.workspace }}/build_scripts/final_installer/Chia-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}-arm64.dmg -o ${{ github.workspace }}/build_scripts/final_installer/Chia-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}-arm64.dmg.torrent --webseed https://download.chia.net/install/Chia-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}-arm64.dmg
|
||||
ls ${{ github.workspace }}/build_scripts/final_installer/
|
||||
|
||||
- name: Upload Beta Installer
|
||||
- name: Upload Dev Installer
|
||||
if: steps.check_secrets.outputs.HAS_AWS_SECRET && github.ref == 'refs/heads/main'
|
||||
env:
|
||||
CHIA_INSTALLER_VERSION: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}
|
||||
@ -171,8 +171,8 @@ jobs:
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.INSTALLER_UPLOAD_SECRET }}
|
||||
AWS_REGION: us-west-2
|
||||
run: |
|
||||
arch -arm64 aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/Chia-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}-arm64.dmg s3://download.chia.net/beta/Chia-arm64_latest_beta.dmg
|
||||
arch -arm64 aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/Chia-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}-arm64.dmg.sha256 s3://download.chia.net/beta/Chia-arm64_latest_beta.dmg.sha256
|
||||
arch -arm64 aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/Chia-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}-arm64.dmg s3://download.chia.net/latest-dev/Chia-arm64_latest_dev.dmg
|
||||
arch -arm64 aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/Chia-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}-arm64.dmg.sha256 s3://download.chia.net/latest-dev/Chia-arm64_latest_dev.dmg.sha256
|
||||
|
||||
- name: Upload Release Files
|
||||
if: steps.check_secrets.outputs.HAS_AWS_SECRET && startsWith(github.ref, 'refs/tags/')
|
||||
|
117
.github/workflows/build-test-macos-blockchain.yml
vendored
117
.github/workflows/build-test-macos-blockchain.yml
vendored
@ -1,117 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: MacOS blockchain Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: MacOS blockchain Tests
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 60
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.9', '3.10']
|
||||
os: [macOS-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_blockchain
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Create keychain for CI use
|
||||
run: |
|
||||
security create-keychain -p foo chiachain
|
||||
security default-keychain -s chiachain
|
||||
security unlock-keychain -p foo chiachain
|
||||
security set-keychain-settings -t 7200 -u chiachain
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
# Note that new runners may break this https://github.com/actions/cache/issues/292
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Cache test blocks and plots
|
||||
uses: actions/cache@v2
|
||||
id: test-blocks-plots
|
||||
with:
|
||||
path: |
|
||||
${{ github.workspace }}/.chia/blocks
|
||||
${{ github.workspace }}/.chia/test-plots
|
||||
key: 0.29.0
|
||||
|
||||
- name: Checkout test blocks and plots
|
||||
if: steps.test-blocks-plots.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf -
|
||||
mkdir ${{ github.workspace }}/.chia
|
||||
mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
brew install boost
|
||||
sh install.sh -d
|
||||
|
||||
# Omitted installing Timelord
|
||||
|
||||
- name: Test blockchain code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 4 -m "not benchmark" tests/blockchain/test_blockchain.py tests/blockchain/test_blockchain_transactions.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
103
.github/workflows/build-test-macos-clvm.yml
vendored
103
.github/workflows/build-test-macos-clvm.yml
vendored
@ -1,103 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: MacOS clvm Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: MacOS clvm Tests
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 30
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.9', '3.10']
|
||||
os: [macOS-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_clvm
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Create keychain for CI use
|
||||
run: |
|
||||
security create-keychain -p foo chiachain
|
||||
security default-keychain -s chiachain
|
||||
security unlock-keychain -p foo chiachain
|
||||
security set-keychain-settings -t 7200 -u chiachain
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
# Note that new runners may break this https://github.com/actions/cache/issues/292
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
# Omitted checking out blocks and plots repo Chia-Network/test-cache
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
brew install boost
|
||||
sh install.sh -d
|
||||
|
||||
# Omitted installing Timelord
|
||||
|
||||
- name: Test clvm code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 4 -m "not benchmark" tests/clvm/test_chialisp_deserialization.py tests/clvm/test_clvm_compilation.py tests/clvm/test_clvm_step.py tests/clvm/test_program.py tests/clvm/test_puzzle_compression.py tests/clvm/test_puzzle_drivers.py tests/clvm/test_puzzles.py tests/clvm/test_serialized_program.py tests/clvm/test_singletons.py tests/clvm/test_spend_sim.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
103
.github/workflows/build-test-macos-core-cmds.yml
vendored
103
.github/workflows/build-test-macos-core-cmds.yml
vendored
@ -1,103 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: MacOS core-cmds Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: MacOS core-cmds Tests
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 30
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.9', '3.10']
|
||||
os: [macOS-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_core-cmds
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Create keychain for CI use
|
||||
run: |
|
||||
security create-keychain -p foo chiachain
|
||||
security default-keychain -s chiachain
|
||||
security unlock-keychain -p foo chiachain
|
||||
security set-keychain-settings -t 7200 -u chiachain
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
# Note that new runners may break this https://github.com/actions/cache/issues/292
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
# Omitted checking out blocks and plots repo Chia-Network/test-cache
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
brew install boost
|
||||
sh install.sh -d
|
||||
|
||||
# Omitted installing Timelord
|
||||
|
||||
- name: Test core-cmds code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 4 -m "not benchmark" tests/core/cmds/test_keys.py tests/core/cmds/test_wallet.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
@ -1,103 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: MacOS core-consensus Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: MacOS core-consensus Tests
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 30
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.9', '3.10']
|
||||
os: [macOS-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_core-consensus
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Create keychain for CI use
|
||||
run: |
|
||||
security create-keychain -p foo chiachain
|
||||
security default-keychain -s chiachain
|
||||
security unlock-keychain -p foo chiachain
|
||||
security set-keychain-settings -t 7200 -u chiachain
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
# Note that new runners may break this https://github.com/actions/cache/issues/292
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
# Omitted checking out blocks and plots repo Chia-Network/test-cache
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
brew install boost
|
||||
sh install.sh -d
|
||||
|
||||
# Omitted installing Timelord
|
||||
|
||||
- name: Test core-consensus code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 4 -m "not benchmark" tests/core/consensus/test_pot_iterations.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
@ -1,103 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: MacOS core-custom_types Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: MacOS core-custom_types Tests
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 30
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.9', '3.10']
|
||||
os: [macOS-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_core-custom_types
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Create keychain for CI use
|
||||
run: |
|
||||
security create-keychain -p foo chiachain
|
||||
security default-keychain -s chiachain
|
||||
security unlock-keychain -p foo chiachain
|
||||
security set-keychain-settings -t 7200 -u chiachain
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
# Note that new runners may break this https://github.com/actions/cache/issues/292
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
# Omitted checking out blocks and plots repo Chia-Network/test-cache
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
brew install boost
|
||||
sh install.sh -d
|
||||
|
||||
# Omitted installing Timelord
|
||||
|
||||
- name: Test core-custom_types code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 4 -m "not benchmark" tests/core/custom_types/test_coin.py tests/core/custom_types/test_proof_of_space.py tests/core/custom_types/test_spend_bundle.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
121
.github/workflows/build-test-macos-core-daemon.yml
vendored
121
.github/workflows/build-test-macos-core-daemon.yml
vendored
@ -1,121 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: MacOS core-daemon Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: MacOS core-daemon Tests
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 30
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.9', '3.10']
|
||||
os: [macOS-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_core-daemon
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Create keychain for CI use
|
||||
run: |
|
||||
security create-keychain -p foo chiachain
|
||||
security default-keychain -s chiachain
|
||||
security unlock-keychain -p foo chiachain
|
||||
security set-keychain-settings -t 7200 -u chiachain
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
# Note that new runners may break this https://github.com/actions/cache/issues/292
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Cache test blocks and plots
|
||||
uses: actions/cache@v2
|
||||
id: test-blocks-plots
|
||||
with:
|
||||
path: |
|
||||
${{ github.workspace }}/.chia/blocks
|
||||
${{ github.workspace }}/.chia/test-plots
|
||||
key: 0.29.0
|
||||
|
||||
- name: Checkout test blocks and plots
|
||||
if: steps.test-blocks-plots.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf -
|
||||
mkdir ${{ github.workspace }}/.chia
|
||||
mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
brew install boost
|
||||
sh install.sh -d
|
||||
|
||||
- name: Install timelord
|
||||
run: |
|
||||
. ./activate
|
||||
sh install-timelord.sh -n
|
||||
./vdf_bench square_asm 400000
|
||||
|
||||
- name: Test core-daemon code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 0 -m "not benchmark" tests/core/daemon/test_daemon.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
@ -1,117 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: MacOS core-data_layer Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: MacOS core-data_layer Tests
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 40
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.9', '3.10']
|
||||
os: [macOS-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_core-data_layer
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Create keychain for CI use
|
||||
run: |
|
||||
security create-keychain -p foo chiachain
|
||||
security default-keychain -s chiachain
|
||||
security unlock-keychain -p foo chiachain
|
||||
security set-keychain-settings -t 7200 -u chiachain
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
# Note that new runners may break this https://github.com/actions/cache/issues/292
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Cache test blocks and plots
|
||||
uses: actions/cache@v2
|
||||
id: test-blocks-plots
|
||||
with:
|
||||
path: |
|
||||
${{ github.workspace }}/.chia/blocks
|
||||
${{ github.workspace }}/.chia/test-plots
|
||||
key: 0.29.0
|
||||
|
||||
- name: Checkout test blocks and plots
|
||||
if: steps.test-blocks-plots.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf -
|
||||
mkdir ${{ github.workspace }}/.chia
|
||||
mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
brew install boost
|
||||
sh install.sh -d
|
||||
|
||||
# Omitted installing Timelord
|
||||
|
||||
- name: Test core-data_layer code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 0 -m "not benchmark" tests/core/data_layer/test_data_cli.py tests/core/data_layer/test_data_rpc.py tests/core/data_layer/test_data_store.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
@ -1,117 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: MacOS core-full_node-full_sync Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: MacOS core-full_node-full_sync Tests
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 60
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.9', '3.10']
|
||||
os: [macOS-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_core-full_node-full_sync
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Create keychain for CI use
|
||||
run: |
|
||||
security create-keychain -p foo chiachain
|
||||
security default-keychain -s chiachain
|
||||
security unlock-keychain -p foo chiachain
|
||||
security set-keychain-settings -t 7200 -u chiachain
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
# Note that new runners may break this https://github.com/actions/cache/issues/292
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Cache test blocks and plots
|
||||
uses: actions/cache@v2
|
||||
id: test-blocks-plots
|
||||
with:
|
||||
path: |
|
||||
${{ github.workspace }}/.chia/blocks
|
||||
${{ github.workspace }}/.chia/test-plots
|
||||
key: 0.29.0
|
||||
|
||||
- name: Checkout test blocks and plots
|
||||
if: steps.test-blocks-plots.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf -
|
||||
mkdir ${{ github.workspace }}/.chia
|
||||
mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
brew install boost
|
||||
sh install.sh -d
|
||||
|
||||
# Omitted installing Timelord
|
||||
|
||||
- name: Test core-full_node-full_sync code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 4 -m "not benchmark" tests/core/full_node/full_sync/test_full_sync.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
@ -1,117 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: MacOS core-full_node-stores Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: MacOS core-full_node-stores Tests
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 40
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.9', '3.10']
|
||||
os: [macOS-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_core-full_node-stores
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Create keychain for CI use
|
||||
run: |
|
||||
security create-keychain -p foo chiachain
|
||||
security default-keychain -s chiachain
|
||||
security unlock-keychain -p foo chiachain
|
||||
security set-keychain-settings -t 7200 -u chiachain
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
# Note that new runners may break this https://github.com/actions/cache/issues/292
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Cache test blocks and plots
|
||||
uses: actions/cache@v2
|
||||
id: test-blocks-plots
|
||||
with:
|
||||
path: |
|
||||
${{ github.workspace }}/.chia/blocks
|
||||
${{ github.workspace }}/.chia/test-plots
|
||||
key: 0.29.0
|
||||
|
||||
- name: Checkout test blocks and plots
|
||||
if: steps.test-blocks-plots.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf -
|
||||
mkdir ${{ github.workspace }}/.chia
|
||||
mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
brew install boost
|
||||
sh install.sh -d
|
||||
|
||||
# Omitted installing Timelord
|
||||
|
||||
- name: Test core-full_node-stores code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 4 -m "not benchmark" tests/core/full_node/stores/test_block_store.py tests/core/full_node/stores/test_coin_store.py tests/core/full_node/stores/test_full_node_store.py tests/core/full_node/stores/test_hint_store.py tests/core/full_node/stores/test_sync_store.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
@ -1,117 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: MacOS core-full_node Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: MacOS core-full_node Tests
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 50
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.9', '3.10']
|
||||
os: [macOS-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_core-full_node
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Create keychain for CI use
|
||||
run: |
|
||||
security create-keychain -p foo chiachain
|
||||
security default-keychain -s chiachain
|
||||
security unlock-keychain -p foo chiachain
|
||||
security set-keychain-settings -t 7200 -u chiachain
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
# Note that new runners may break this https://github.com/actions/cache/issues/292
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Cache test blocks and plots
|
||||
uses: actions/cache@v2
|
||||
id: test-blocks-plots
|
||||
with:
|
||||
path: |
|
||||
${{ github.workspace }}/.chia/blocks
|
||||
${{ github.workspace }}/.chia/test-plots
|
||||
key: 0.29.0
|
||||
|
||||
- name: Checkout test blocks and plots
|
||||
if: steps.test-blocks-plots.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf -
|
||||
mkdir ${{ github.workspace }}/.chia
|
||||
mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
brew install boost
|
||||
sh install.sh -d
|
||||
|
||||
# Omitted installing Timelord
|
||||
|
||||
- name: Test core-full_node code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 4 -m "not benchmark" tests/core/full_node/test_address_manager.py tests/core/full_node/test_block_height_map.py tests/core/full_node/test_conditions.py tests/core/full_node/test_full_node.py tests/core/full_node/test_generator_tools.py tests/core/full_node/test_hint_management.py tests/core/full_node/test_mempool.py tests/core/full_node/test_mempool_performance.py tests/core/full_node/test_node_load.py tests/core/full_node/test_peer_store_resolver.py tests/core/full_node/test_performance.py tests/core/full_node/test_transactions.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
117
.github/workflows/build-test-macos-core-server.yml
vendored
117
.github/workflows/build-test-macos-core-server.yml
vendored
@ -1,117 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: MacOS core-server Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: MacOS core-server Tests
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 30
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.9', '3.10']
|
||||
os: [macOS-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_core-server
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Create keychain for CI use
|
||||
run: |
|
||||
security create-keychain -p foo chiachain
|
||||
security default-keychain -s chiachain
|
||||
security unlock-keychain -p foo chiachain
|
||||
security set-keychain-settings -t 7200 -u chiachain
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
# Note that new runners may break this https://github.com/actions/cache/issues/292
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Cache test blocks and plots
|
||||
uses: actions/cache@v2
|
||||
id: test-blocks-plots
|
||||
with:
|
||||
path: |
|
||||
${{ github.workspace }}/.chia/blocks
|
||||
${{ github.workspace }}/.chia/test-plots
|
||||
key: 0.29.0
|
||||
|
||||
- name: Checkout test blocks and plots
|
||||
if: steps.test-blocks-plots.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf -
|
||||
mkdir ${{ github.workspace }}/.chia
|
||||
mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
brew install boost
|
||||
sh install.sh -d
|
||||
|
||||
# Omitted installing Timelord
|
||||
|
||||
- name: Test core-server code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 0 -m "not benchmark" tests/core/server/test_dos.py tests/core/server/test_rate_limits.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
117
.github/workflows/build-test-macos-core-ssl.yml
vendored
117
.github/workflows/build-test-macos-core-ssl.yml
vendored
@ -1,117 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: MacOS core-ssl Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: MacOS core-ssl Tests
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 30
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.9', '3.10']
|
||||
os: [macOS-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_core-ssl
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Create keychain for CI use
|
||||
run: |
|
||||
security create-keychain -p foo chiachain
|
||||
security default-keychain -s chiachain
|
||||
security unlock-keychain -p foo chiachain
|
||||
security set-keychain-settings -t 7200 -u chiachain
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
# Note that new runners may break this https://github.com/actions/cache/issues/292
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Cache test blocks and plots
|
||||
uses: actions/cache@v2
|
||||
id: test-blocks-plots
|
||||
with:
|
||||
path: |
|
||||
${{ github.workspace }}/.chia/blocks
|
||||
${{ github.workspace }}/.chia/test-plots
|
||||
key: 0.29.0
|
||||
|
||||
- name: Checkout test blocks and plots
|
||||
if: steps.test-blocks-plots.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf -
|
||||
mkdir ${{ github.workspace }}/.chia
|
||||
mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
brew install boost
|
||||
sh install.sh -d
|
||||
|
||||
# Omitted installing Timelord
|
||||
|
||||
- name: Test core-ssl code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 4 -m "not benchmark" tests/core/ssl/test_ssl.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
117
.github/workflows/build-test-macos-core-util.yml
vendored
117
.github/workflows/build-test-macos-core-util.yml
vendored
@ -1,117 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: MacOS core-util Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: MacOS core-util Tests
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 30
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.9', '3.10']
|
||||
os: [macOS-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_core-util
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Create keychain for CI use
|
||||
run: |
|
||||
security create-keychain -p foo chiachain
|
||||
security default-keychain -s chiachain
|
||||
security unlock-keychain -p foo chiachain
|
||||
security set-keychain-settings -t 7200 -u chiachain
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
# Note that new runners may break this https://github.com/actions/cache/issues/292
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Cache test blocks and plots
|
||||
uses: actions/cache@v2
|
||||
id: test-blocks-plots
|
||||
with:
|
||||
path: |
|
||||
${{ github.workspace }}/.chia/blocks
|
||||
${{ github.workspace }}/.chia/test-plots
|
||||
key: 0.29.0
|
||||
|
||||
- name: Checkout test blocks and plots
|
||||
if: steps.test-blocks-plots.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf -
|
||||
mkdir ${{ github.workspace }}/.chia
|
||||
mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
brew install boost
|
||||
sh install.sh -d
|
||||
|
||||
# Omitted installing Timelord
|
||||
|
||||
- name: Test core-util code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 4 -m "not benchmark" tests/core/util/test_cached_bls.py tests/core/util/test_config.py tests/core/util/test_db_wrapper.py tests/core/util/test_file_keyring_synchronization.py tests/core/util/test_files.py tests/core/util/test_jsonify.py tests/core/util/test_keychain.py tests/core/util/test_keyring_wrapper.py tests/core/util/test_lru_cache.py tests/core/util/test_significant_bits.py tests/core/util/test_streamable.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
117
.github/workflows/build-test-macos-core.yml
vendored
117
.github/workflows/build-test-macos-core.yml
vendored
@ -1,117 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: MacOS core Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: MacOS core Tests
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 30
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.9', '3.10']
|
||||
os: [macOS-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_core
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Create keychain for CI use
|
||||
run: |
|
||||
security create-keychain -p foo chiachain
|
||||
security default-keychain -s chiachain
|
||||
security unlock-keychain -p foo chiachain
|
||||
security set-keychain-settings -t 7200 -u chiachain
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
# Note that new runners may break this https://github.com/actions/cache/issues/292
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Cache test blocks and plots
|
||||
uses: actions/cache@v2
|
||||
id: test-blocks-plots
|
||||
with:
|
||||
path: |
|
||||
${{ github.workspace }}/.chia/blocks
|
||||
${{ github.workspace }}/.chia/test-plots
|
||||
key: 0.29.0
|
||||
|
||||
- name: Checkout test blocks and plots
|
||||
if: steps.test-blocks-plots.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf -
|
||||
mkdir ${{ github.workspace }}/.chia
|
||||
mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
brew install boost
|
||||
sh install.sh -d
|
||||
|
||||
# Omitted installing Timelord
|
||||
|
||||
- name: Test core code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 4 -m "not benchmark" tests/core/test_coins.py tests/core/test_cost_calculation.py tests/core/test_crawler_rpc.py tests/core/test_daemon_rpc.py tests/core/test_db_conversion.py tests/core/test_db_validation.py tests/core/test_farmer_harvester_rpc.py tests/core/test_filter.py tests/core/test_full_node_rpc.py tests/core/test_merkle_set.py tests/core/test_setproctitle.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
@ -1,117 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: MacOS farmer_harvester Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: MacOS farmer_harvester Tests
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 30
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.9', '3.10']
|
||||
os: [macOS-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_farmer_harvester
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Create keychain for CI use
|
||||
run: |
|
||||
security create-keychain -p foo chiachain
|
||||
security default-keychain -s chiachain
|
||||
security unlock-keychain -p foo chiachain
|
||||
security set-keychain-settings -t 7200 -u chiachain
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
# Note that new runners may break this https://github.com/actions/cache/issues/292
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Cache test blocks and plots
|
||||
uses: actions/cache@v2
|
||||
id: test-blocks-plots
|
||||
with:
|
||||
path: |
|
||||
${{ github.workspace }}/.chia/blocks
|
||||
${{ github.workspace }}/.chia/test-plots
|
||||
key: 0.29.0
|
||||
|
||||
- name: Checkout test blocks and plots
|
||||
if: steps.test-blocks-plots.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf -
|
||||
mkdir ${{ github.workspace }}/.chia
|
||||
mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
brew install boost
|
||||
sh install.sh -d
|
||||
|
||||
# Omitted installing Timelord
|
||||
|
||||
- name: Test farmer_harvester code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 0 -m "not benchmark" tests/farmer_harvester/test_farmer_harvester.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
103
.github/workflows/build-test-macos-generator.yml
vendored
103
.github/workflows/build-test-macos-generator.yml
vendored
@ -1,103 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: MacOS generator Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: MacOS generator Tests
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 30
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.9', '3.10']
|
||||
os: [macOS-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_generator
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Create keychain for CI use
|
||||
run: |
|
||||
security create-keychain -p foo chiachain
|
||||
security default-keychain -s chiachain
|
||||
security unlock-keychain -p foo chiachain
|
||||
security set-keychain-settings -t 7200 -u chiachain
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
# Note that new runners may break this https://github.com/actions/cache/issues/292
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
# Omitted checking out blocks and plots repo Chia-Network/test-cache
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
brew install boost
|
||||
sh install.sh -d
|
||||
|
||||
# Omitted installing Timelord
|
||||
|
||||
- name: Test generator code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 4 -m "not benchmark" tests/generator/test_compression.py tests/generator/test_generator_types.py tests/generator/test_list_to_batches.py tests/generator/test_rom.py tests/generator/test_scan.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
117
.github/workflows/build-test-macos-plot_sync.yml
vendored
117
.github/workflows/build-test-macos-plot_sync.yml
vendored
@ -1,117 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: MacOS plot_sync Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: MacOS plot_sync Tests
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 30
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.9', '3.10']
|
||||
os: [macOS-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_plot_sync
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Create keychain for CI use
|
||||
run: |
|
||||
security create-keychain -p foo chiachain
|
||||
security default-keychain -s chiachain
|
||||
security unlock-keychain -p foo chiachain
|
||||
security set-keychain-settings -t 7200 -u chiachain
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
# Note that new runners may break this https://github.com/actions/cache/issues/292
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Cache test blocks and plots
|
||||
uses: actions/cache@v2
|
||||
id: test-blocks-plots
|
||||
with:
|
||||
path: |
|
||||
${{ github.workspace }}/.chia/blocks
|
||||
${{ github.workspace }}/.chia/test-plots
|
||||
key: 0.29.0
|
||||
|
||||
- name: Checkout test blocks and plots
|
||||
if: steps.test-blocks-plots.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf -
|
||||
mkdir ${{ github.workspace }}/.chia
|
||||
mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
brew install boost
|
||||
sh install.sh -d
|
||||
|
||||
# Omitted installing Timelord
|
||||
|
||||
- name: Test plot_sync code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 4 -m "not benchmark" tests/plot_sync/test_delta.py tests/plot_sync/test_plot_sync.py tests/plot_sync/test_receiver.py tests/plot_sync/test_sender.py tests/plot_sync/test_sync_simulated.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
117
.github/workflows/build-test-macos-plotting.yml
vendored
117
.github/workflows/build-test-macos-plotting.yml
vendored
@ -1,117 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: MacOS plotting Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: MacOS plotting Tests
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 30
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.9', '3.10']
|
||||
os: [macOS-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_plotting
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Create keychain for CI use
|
||||
run: |
|
||||
security create-keychain -p foo chiachain
|
||||
security default-keychain -s chiachain
|
||||
security unlock-keychain -p foo chiachain
|
||||
security set-keychain-settings -t 7200 -u chiachain
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
# Note that new runners may break this https://github.com/actions/cache/issues/292
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Cache test blocks and plots
|
||||
uses: actions/cache@v2
|
||||
id: test-blocks-plots
|
||||
with:
|
||||
path: |
|
||||
${{ github.workspace }}/.chia/blocks
|
||||
${{ github.workspace }}/.chia/test-plots
|
||||
key: 0.29.0
|
||||
|
||||
- name: Checkout test blocks and plots
|
||||
if: steps.test-blocks-plots.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf -
|
||||
mkdir ${{ github.workspace }}/.chia
|
||||
mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
brew install boost
|
||||
sh install.sh -d
|
||||
|
||||
# Omitted installing Timelord
|
||||
|
||||
- name: Test plotting code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 4 -m "not benchmark" tests/plotting/test_plot_manager.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
117
.github/workflows/build-test-macos-pools.yml
vendored
117
.github/workflows/build-test-macos-pools.yml
vendored
@ -1,117 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: MacOS pools Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: MacOS pools Tests
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 60
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.9', '3.10']
|
||||
os: [macOS-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_pools
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Create keychain for CI use
|
||||
run: |
|
||||
security create-keychain -p foo chiachain
|
||||
security default-keychain -s chiachain
|
||||
security unlock-keychain -p foo chiachain
|
||||
security set-keychain-settings -t 7200 -u chiachain
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
# Note that new runners may break this https://github.com/actions/cache/issues/292
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Cache test blocks and plots
|
||||
uses: actions/cache@v2
|
||||
id: test-blocks-plots
|
||||
with:
|
||||
path: |
|
||||
${{ github.workspace }}/.chia/blocks
|
||||
${{ github.workspace }}/.chia/test-plots
|
||||
key: 0.29.0
|
||||
|
||||
- name: Checkout test blocks and plots
|
||||
if: steps.test-blocks-plots.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf -
|
||||
mkdir ${{ github.workspace }}/.chia
|
||||
mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
brew install boost
|
||||
sh install.sh -d
|
||||
|
||||
# Omitted installing Timelord
|
||||
|
||||
- name: Test pools code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 2 -m "not benchmark" tests/pools/test_pool_cmdline.py tests/pools/test_pool_config.py tests/pools/test_pool_puzzles_lifecycle.py tests/pools/test_pool_rpc.py tests/pools/test_pool_wallet.py tests/pools/test_wallet_pool_store.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
121
.github/workflows/build-test-macos-simulation.yml
vendored
121
.github/workflows/build-test-macos-simulation.yml
vendored
@ -1,121 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: MacOS simulation Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: MacOS simulation Tests
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 60
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.9', '3.10']
|
||||
os: [macOS-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_simulation
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Create keychain for CI use
|
||||
run: |
|
||||
security create-keychain -p foo chiachain
|
||||
security default-keychain -s chiachain
|
||||
security unlock-keychain -p foo chiachain
|
||||
security set-keychain-settings -t 7200 -u chiachain
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
# Note that new runners may break this https://github.com/actions/cache/issues/292
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Cache test blocks and plots
|
||||
uses: actions/cache@v2
|
||||
id: test-blocks-plots
|
||||
with:
|
||||
path: |
|
||||
${{ github.workspace }}/.chia/blocks
|
||||
${{ github.workspace }}/.chia/test-plots
|
||||
key: 0.29.0
|
||||
|
||||
- name: Checkout test blocks and plots
|
||||
if: steps.test-blocks-plots.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf -
|
||||
mkdir ${{ github.workspace }}/.chia
|
||||
mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
brew install boost
|
||||
sh install.sh -d
|
||||
|
||||
- name: Install timelord
|
||||
run: |
|
||||
. ./activate
|
||||
sh install-timelord.sh -n
|
||||
./vdf_bench square_asm 400000
|
||||
|
||||
- name: Test simulation code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 0 -m "not benchmark" tests/simulation/test_simulation.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
103
.github/workflows/build-test-macos-tools.yml
vendored
103
.github/workflows/build-test-macos-tools.yml
vendored
@ -1,103 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: MacOS tools Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: MacOS tools Tests
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 30
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.9', '3.10']
|
||||
os: [macOS-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_tools
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Create keychain for CI use
|
||||
run: |
|
||||
security create-keychain -p foo chiachain
|
||||
security default-keychain -s chiachain
|
||||
security unlock-keychain -p foo chiachain
|
||||
security set-keychain-settings -t 7200 -u chiachain
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
# Note that new runners may break this https://github.com/actions/cache/issues/292
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
# Omitted checking out blocks and plots repo Chia-Network/test-cache
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
brew install boost
|
||||
sh install.sh -d
|
||||
|
||||
# Omitted installing Timelord
|
||||
|
||||
- name: Test tools code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 4 -m "not benchmark" tests/tools/test_full_sync.py tests/tools/test_run_block.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
103
.github/workflows/build-test-macos-util.yml
vendored
103
.github/workflows/build-test-macos-util.yml
vendored
@ -1,103 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: MacOS util Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: MacOS util Tests
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 60
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.9', '3.10']
|
||||
os: [macOS-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_util
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Create keychain for CI use
|
||||
run: |
|
||||
security create-keychain -p foo chiachain
|
||||
security default-keychain -s chiachain
|
||||
security unlock-keychain -p foo chiachain
|
||||
security set-keychain-settings -t 7200 -u chiachain
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
# Note that new runners may break this https://github.com/actions/cache/issues/292
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
# Omitted checking out blocks and plots repo Chia-Network/test-cache
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
brew install boost
|
||||
sh install.sh -d
|
||||
|
||||
# Omitted installing Timelord
|
||||
|
||||
- name: Test util code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 4 -m "not benchmark" tests/util/test_chunks.py tests/util/test_full_block_utils.py tests/util/test_lock_queue.py tests/util/test_misc.py tests/util/test_network.py tests/util/test_network_protocol_files.py tests/util/test_paginator.py tests/util/test_struct_stream.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
@ -1,117 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: MacOS wallet-cat_wallet Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: MacOS wallet-cat_wallet Tests
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 50
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.9', '3.10']
|
||||
os: [macOS-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_wallet-cat_wallet
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Create keychain for CI use
|
||||
run: |
|
||||
security create-keychain -p foo chiachain
|
||||
security default-keychain -s chiachain
|
||||
security unlock-keychain -p foo chiachain
|
||||
security set-keychain-settings -t 7200 -u chiachain
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
# Note that new runners may break this https://github.com/actions/cache/issues/292
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Cache test blocks and plots
|
||||
uses: actions/cache@v2
|
||||
id: test-blocks-plots
|
||||
with:
|
||||
path: |
|
||||
${{ github.workspace }}/.chia/blocks
|
||||
${{ github.workspace }}/.chia/test-plots
|
||||
key: 0.29.0
|
||||
|
||||
- name: Checkout test blocks and plots
|
||||
if: steps.test-blocks-plots.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf -
|
||||
mkdir ${{ github.workspace }}/.chia
|
||||
mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
brew install boost
|
||||
sh install.sh -d
|
||||
|
||||
# Omitted installing Timelord
|
||||
|
||||
- name: Test wallet-cat_wallet code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 0 -m "not benchmark" tests/wallet/cat_wallet/test_cat_lifecycle.py tests/wallet/cat_wallet/test_cat_outer_puzzle.py tests/wallet/cat_wallet/test_cat_wallet.py tests/wallet/cat_wallet/test_offer_lifecycle.py tests/wallet/cat_wallet/test_trades.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
@ -1,117 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: MacOS wallet-did_wallet Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: MacOS wallet-did_wallet Tests
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 50
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.9', '3.10']
|
||||
os: [macOS-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_wallet-did_wallet
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Create keychain for CI use
|
||||
run: |
|
||||
security create-keychain -p foo chiachain
|
||||
security default-keychain -s chiachain
|
||||
security unlock-keychain -p foo chiachain
|
||||
security set-keychain-settings -t 7200 -u chiachain
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
# Note that new runners may break this https://github.com/actions/cache/issues/292
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Cache test blocks and plots
|
||||
uses: actions/cache@v2
|
||||
id: test-blocks-plots
|
||||
with:
|
||||
path: |
|
||||
${{ github.workspace }}/.chia/blocks
|
||||
${{ github.workspace }}/.chia/test-plots
|
||||
key: 0.29.0
|
||||
|
||||
- name: Checkout test blocks and plots
|
||||
if: steps.test-blocks-plots.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf -
|
||||
mkdir ${{ github.workspace }}/.chia
|
||||
mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
brew install boost
|
||||
sh install.sh -d
|
||||
|
||||
# Omitted installing Timelord
|
||||
|
||||
- name: Test wallet-did_wallet code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 0 -m "not benchmark" tests/wallet/did_wallet/test_did.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
@ -1,117 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: MacOS wallet-nft_wallet Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: MacOS wallet-nft_wallet Tests
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 30
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.9', '3.10']
|
||||
os: [macOS-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_wallet-nft_wallet
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Create keychain for CI use
|
||||
run: |
|
||||
security create-keychain -p foo chiachain
|
||||
security default-keychain -s chiachain
|
||||
security unlock-keychain -p foo chiachain
|
||||
security set-keychain-settings -t 7200 -u chiachain
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
# Note that new runners may break this https://github.com/actions/cache/issues/292
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Cache test blocks and plots
|
||||
uses: actions/cache@v2
|
||||
id: test-blocks-plots
|
||||
with:
|
||||
path: |
|
||||
${{ github.workspace }}/.chia/blocks
|
||||
${{ github.workspace }}/.chia/test-plots
|
||||
key: 0.29.0
|
||||
|
||||
- name: Checkout test blocks and plots
|
||||
if: steps.test-blocks-plots.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf -
|
||||
mkdir ${{ github.workspace }}/.chia
|
||||
mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
brew install boost
|
||||
sh install.sh -d
|
||||
|
||||
# Omitted installing Timelord
|
||||
|
||||
- name: Test wallet-nft_wallet code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 0 -m "not benchmark" tests/wallet/nft_wallet/test_nft_1_offers.py tests/wallet/nft_wallet/test_nft_lifecycle.py tests/wallet/nft_wallet/test_nft_offers.py tests/wallet/nft_wallet/test_nft_puzzles.py tests/wallet/nft_wallet/test_nft_wallet.py tests/wallet/nft_wallet/test_ownership_outer_puzzle.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
@ -1,103 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: MacOS wallet-rl_wallet Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: MacOS wallet-rl_wallet Tests
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 30
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.9', '3.10']
|
||||
os: [macOS-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_wallet-rl_wallet
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Create keychain for CI use
|
||||
run: |
|
||||
security create-keychain -p foo chiachain
|
||||
security default-keychain -s chiachain
|
||||
security unlock-keychain -p foo chiachain
|
||||
security set-keychain-settings -t 7200 -u chiachain
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
# Note that new runners may break this https://github.com/actions/cache/issues/292
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
# Omitted checking out blocks and plots repo Chia-Network/test-cache
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
brew install boost
|
||||
sh install.sh -d
|
||||
|
||||
# Omitted installing Timelord
|
||||
|
||||
- name: Test wallet-rl_wallet code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 0 -m "not benchmark" tests/wallet/rl_wallet/test_rl_rpc.py tests/wallet/rl_wallet/test_rl_wallet.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
117
.github/workflows/build-test-macos-wallet-rpc.yml
vendored
117
.github/workflows/build-test-macos-wallet-rpc.yml
vendored
@ -1,117 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: MacOS wallet-rpc Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: MacOS wallet-rpc Tests
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 30
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.9', '3.10']
|
||||
os: [macOS-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_wallet-rpc
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Create keychain for CI use
|
||||
run: |
|
||||
security create-keychain -p foo chiachain
|
||||
security default-keychain -s chiachain
|
||||
security unlock-keychain -p foo chiachain
|
||||
security set-keychain-settings -t 7200 -u chiachain
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
# Note that new runners may break this https://github.com/actions/cache/issues/292
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Cache test blocks and plots
|
||||
uses: actions/cache@v2
|
||||
id: test-blocks-plots
|
||||
with:
|
||||
path: |
|
||||
${{ github.workspace }}/.chia/blocks
|
||||
${{ github.workspace }}/.chia/test-plots
|
||||
key: 0.29.0
|
||||
|
||||
- name: Checkout test blocks and plots
|
||||
if: steps.test-blocks-plots.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf -
|
||||
mkdir ${{ github.workspace }}/.chia
|
||||
mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
brew install boost
|
||||
sh install.sh -d
|
||||
|
||||
# Omitted installing Timelord
|
||||
|
||||
- name: Test wallet-rpc code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 0 -m "not benchmark" tests/wallet/rpc/test_dl_wallet_rpc.py tests/wallet/rpc/test_wallet_rpc.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
@ -1,117 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: MacOS wallet-simple_sync Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: MacOS wallet-simple_sync Tests
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 30
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.9', '3.10']
|
||||
os: [macOS-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_wallet-simple_sync
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Create keychain for CI use
|
||||
run: |
|
||||
security create-keychain -p foo chiachain
|
||||
security default-keychain -s chiachain
|
||||
security unlock-keychain -p foo chiachain
|
||||
security set-keychain-settings -t 7200 -u chiachain
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
# Note that new runners may break this https://github.com/actions/cache/issues/292
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Cache test blocks and plots
|
||||
uses: actions/cache@v2
|
||||
id: test-blocks-plots
|
||||
with:
|
||||
path: |
|
||||
${{ github.workspace }}/.chia/blocks
|
||||
${{ github.workspace }}/.chia/test-plots
|
||||
key: 0.29.0
|
||||
|
||||
- name: Checkout test blocks and plots
|
||||
if: steps.test-blocks-plots.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf -
|
||||
mkdir ${{ github.workspace }}/.chia
|
||||
mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
brew install boost
|
||||
sh install.sh -d
|
||||
|
||||
# Omitted installing Timelord
|
||||
|
||||
- name: Test wallet-simple_sync code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 0 -m "not benchmark" tests/wallet/simple_sync/test_simple_sync_protocol.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
117
.github/workflows/build-test-macos-wallet-sync.yml
vendored
117
.github/workflows/build-test-macos-wallet-sync.yml
vendored
@ -1,117 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: MacOS wallet-sync Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: MacOS wallet-sync Tests
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 60
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.9', '3.10']
|
||||
os: [macOS-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_wallet-sync
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Create keychain for CI use
|
||||
run: |
|
||||
security create-keychain -p foo chiachain
|
||||
security default-keychain -s chiachain
|
||||
security unlock-keychain -p foo chiachain
|
||||
security set-keychain-settings -t 7200 -u chiachain
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
# Note that new runners may break this https://github.com/actions/cache/issues/292
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Cache test blocks and plots
|
||||
uses: actions/cache@v2
|
||||
id: test-blocks-plots
|
||||
with:
|
||||
path: |
|
||||
${{ github.workspace }}/.chia/blocks
|
||||
${{ github.workspace }}/.chia/test-plots
|
||||
key: 0.29.0
|
||||
|
||||
- name: Checkout test blocks and plots
|
||||
if: steps.test-blocks-plots.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf -
|
||||
mkdir ${{ github.workspace }}/.chia
|
||||
mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
brew install boost
|
||||
sh install.sh -d
|
||||
|
||||
# Omitted installing Timelord
|
||||
|
||||
- name: Test wallet-sync code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 0 -m "not benchmark" tests/wallet/sync/test_wallet_sync.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
117
.github/workflows/build-test-macos-wallet.yml
vendored
117
.github/workflows/build-test-macos-wallet.yml
vendored
@ -1,117 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: MacOS wallet Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: MacOS wallet Tests
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 40
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.9', '3.10']
|
||||
os: [macOS-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_wallet
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Create keychain for CI use
|
||||
run: |
|
||||
security create-keychain -p foo chiachain
|
||||
security default-keychain -s chiachain
|
||||
security unlock-keychain -p foo chiachain
|
||||
security set-keychain-settings -t 7200 -u chiachain
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
# Note that new runners may break this https://github.com/actions/cache/issues/292
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Cache test blocks and plots
|
||||
uses: actions/cache@v2
|
||||
id: test-blocks-plots
|
||||
with:
|
||||
path: |
|
||||
${{ github.workspace }}/.chia/blocks
|
||||
${{ github.workspace }}/.chia/test-plots
|
||||
key: 0.29.0
|
||||
|
||||
- name: Checkout test blocks and plots
|
||||
if: steps.test-blocks-plots.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf -
|
||||
mkdir ${{ github.workspace }}/.chia
|
||||
mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
brew install boost
|
||||
sh install.sh -d
|
||||
|
||||
# Omitted installing Timelord
|
||||
|
||||
- name: Test wallet code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 4 -m "not benchmark" tests/wallet/test_bech32m.py tests/wallet/test_chialisp.py tests/wallet/test_coin_selection.py tests/wallet/test_nft_store.py tests/wallet/test_puzzle_store.py tests/wallet/test_singleton.py tests/wallet/test_singleton_lifecycle.py tests/wallet/test_singleton_lifecycle_fast.py tests/wallet/test_taproot.py tests/wallet/test_wallet.py tests/wallet/test_wallet_blockchain.py tests/wallet/test_wallet_interested_store.py tests/wallet/test_wallet_key_val_store.py tests/wallet/test_wallet_retry.py tests/wallet/test_wallet_store.py tests/wallet/test_wallet_user_store.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
117
.github/workflows/build-test-macos-weight_proof.yml
vendored
117
.github/workflows/build-test-macos-weight_proof.yml
vendored
@ -1,117 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: MacOS weight_proof Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: MacOS weight_proof Tests
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 30
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.9', '3.10']
|
||||
os: [macOS-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_weight_proof
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Create keychain for CI use
|
||||
run: |
|
||||
security create-keychain -p foo chiachain
|
||||
security default-keychain -s chiachain
|
||||
security unlock-keychain -p foo chiachain
|
||||
security set-keychain-settings -t 7200 -u chiachain
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
# Note that new runners may break this https://github.com/actions/cache/issues/292
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Cache test blocks and plots
|
||||
uses: actions/cache@v2
|
||||
id: test-blocks-plots
|
||||
with:
|
||||
path: |
|
||||
${{ github.workspace }}/.chia/blocks
|
||||
${{ github.workspace }}/.chia/test-plots
|
||||
key: 0.29.0
|
||||
|
||||
- name: Checkout test blocks and plots
|
||||
if: steps.test-blocks-plots.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf -
|
||||
mkdir ${{ github.workspace }}/.chia
|
||||
mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
brew install boost
|
||||
sh install.sh -d
|
||||
|
||||
# Omitted installing Timelord
|
||||
|
||||
- name: Test weight_proof code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 4 -m "not benchmark" tests/weight_proof/test_weight_proof.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
119
.github/workflows/build-test-ubuntu-blockchain.yml
vendored
119
.github/workflows/build-test-ubuntu-blockchain.yml
vendored
@ -1,119 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: Ubuntu blockchain Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Ubuntu blockchain Test
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 60
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.7', '3.8', '3.9', '3.10']
|
||||
os: [ubuntu-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_blockchain
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Cache npm
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Cache test blocks and plots
|
||||
uses: actions/cache@v2
|
||||
id: test-blocks-plots
|
||||
with:
|
||||
path: |
|
||||
${{ github.workspace }}/.chia/blocks
|
||||
${{ github.workspace }}/.chia/test-plots
|
||||
key: 0.29.0
|
||||
|
||||
- name: Checkout test blocks and plots
|
||||
if: steps.test-blocks-plots.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf -
|
||||
mkdir ${{ github.workspace }}/.chia
|
||||
mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
sh install.sh -d
|
||||
|
||||
# Omitted installing Timelord
|
||||
|
||||
- name: Test blockchain code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 4 -m "not benchmark" tests/blockchain/test_blockchain.py tests/blockchain/test_blockchain_transactions.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
|
||||
# Omitted resource usage check
|
||||
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
105
.github/workflows/build-test-ubuntu-clvm.yml
vendored
105
.github/workflows/build-test-ubuntu-clvm.yml
vendored
@ -1,105 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: Ubuntu clvm Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Ubuntu clvm Test
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 30
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.7', '3.8', '3.9', '3.10']
|
||||
os: [ubuntu-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_clvm
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Cache npm
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
# Omitted checking out blocks and plots repo Chia-Network/test-cache
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
sh install.sh -d
|
||||
|
||||
# Omitted installing Timelord
|
||||
|
||||
- name: Test clvm code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 4 -m "not benchmark" tests/clvm/test_chialisp_deserialization.py tests/clvm/test_clvm_compilation.py tests/clvm/test_clvm_step.py tests/clvm/test_program.py tests/clvm/test_puzzle_compression.py tests/clvm/test_puzzle_drivers.py tests/clvm/test_puzzles.py tests/clvm/test_serialized_program.py tests/clvm/test_singletons.py tests/clvm/test_spend_sim.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
|
||||
# Omitted resource usage check
|
||||
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
105
.github/workflows/build-test-ubuntu-core-cmds.yml
vendored
105
.github/workflows/build-test-ubuntu-core-cmds.yml
vendored
@ -1,105 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: Ubuntu core-cmds Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Ubuntu core-cmds Test
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 30
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.7', '3.8', '3.9', '3.10']
|
||||
os: [ubuntu-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_core-cmds
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Cache npm
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
# Omitted checking out blocks and plots repo Chia-Network/test-cache
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
sh install.sh -d
|
||||
|
||||
# Omitted installing Timelord
|
||||
|
||||
- name: Test core-cmds code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 4 -m "not benchmark" tests/core/cmds/test_keys.py tests/core/cmds/test_wallet.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
|
||||
# Omitted resource usage check
|
||||
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
@ -1,105 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: Ubuntu core-consensus Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Ubuntu core-consensus Test
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 30
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.7', '3.8', '3.9', '3.10']
|
||||
os: [ubuntu-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_core-consensus
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Cache npm
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
# Omitted checking out blocks and plots repo Chia-Network/test-cache
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
sh install.sh -d
|
||||
|
||||
# Omitted installing Timelord
|
||||
|
||||
- name: Test core-consensus code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 4 -m "not benchmark" tests/core/consensus/test_pot_iterations.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
|
||||
# Omitted resource usage check
|
||||
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
@ -1,105 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: Ubuntu core-custom_types Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Ubuntu core-custom_types Test
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 30
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.7', '3.8', '3.9', '3.10']
|
||||
os: [ubuntu-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_core-custom_types
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Cache npm
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
# Omitted checking out blocks and plots repo Chia-Network/test-cache
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
sh install.sh -d
|
||||
|
||||
# Omitted installing Timelord
|
||||
|
||||
- name: Test core-custom_types code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 4 -m "not benchmark" tests/core/custom_types/test_coin.py tests/core/custom_types/test_proof_of_space.py tests/core/custom_types/test_spend_bundle.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
|
||||
# Omitted resource usage check
|
||||
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
123
.github/workflows/build-test-ubuntu-core-daemon.yml
vendored
123
.github/workflows/build-test-ubuntu-core-daemon.yml
vendored
@ -1,123 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: Ubuntu core-daemon Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Ubuntu core-daemon Test
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 30
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.7', '3.8', '3.9', '3.10']
|
||||
os: [ubuntu-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_core-daemon
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Cache npm
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Cache test blocks and plots
|
||||
uses: actions/cache@v2
|
||||
id: test-blocks-plots
|
||||
with:
|
||||
path: |
|
||||
${{ github.workspace }}/.chia/blocks
|
||||
${{ github.workspace }}/.chia/test-plots
|
||||
key: 0.29.0
|
||||
|
||||
- name: Checkout test blocks and plots
|
||||
if: steps.test-blocks-plots.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf -
|
||||
mkdir ${{ github.workspace }}/.chia
|
||||
mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
sh install.sh -d
|
||||
|
||||
- name: Install timelord
|
||||
run: |
|
||||
. ./activate
|
||||
sh install-timelord.sh -n
|
||||
./vdf_bench square_asm 400000
|
||||
|
||||
- name: Test core-daemon code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 0 -m "not benchmark" tests/core/daemon/test_daemon.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
|
||||
# Omitted resource usage check
|
||||
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
@ -1,119 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: Ubuntu core-data_layer Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Ubuntu core-data_layer Test
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 40
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.7', '3.8', '3.9', '3.10']
|
||||
os: [ubuntu-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_core-data_layer
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Cache npm
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Cache test blocks and plots
|
||||
uses: actions/cache@v2
|
||||
id: test-blocks-plots
|
||||
with:
|
||||
path: |
|
||||
${{ github.workspace }}/.chia/blocks
|
||||
${{ github.workspace }}/.chia/test-plots
|
||||
key: 0.29.0
|
||||
|
||||
- name: Checkout test blocks and plots
|
||||
if: steps.test-blocks-plots.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf -
|
||||
mkdir ${{ github.workspace }}/.chia
|
||||
mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
sh install.sh -d
|
||||
|
||||
# Omitted installing Timelord
|
||||
|
||||
- name: Test core-data_layer code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 0 -m "not benchmark" tests/core/data_layer/test_data_cli.py tests/core/data_layer/test_data_rpc.py tests/core/data_layer/test_data_store.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
|
||||
# Omitted resource usage check
|
||||
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
@ -1,119 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: Ubuntu core-full_node-full_sync Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Ubuntu core-full_node-full_sync Test
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 60
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.7', '3.8', '3.9', '3.10']
|
||||
os: [ubuntu-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_core-full_node-full_sync
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Cache npm
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Cache test blocks and plots
|
||||
uses: actions/cache@v2
|
||||
id: test-blocks-plots
|
||||
with:
|
||||
path: |
|
||||
${{ github.workspace }}/.chia/blocks
|
||||
${{ github.workspace }}/.chia/test-plots
|
||||
key: 0.29.0
|
||||
|
||||
- name: Checkout test blocks and plots
|
||||
if: steps.test-blocks-plots.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf -
|
||||
mkdir ${{ github.workspace }}/.chia
|
||||
mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
sh install.sh -d
|
||||
|
||||
# Omitted installing Timelord
|
||||
|
||||
- name: Test core-full_node-full_sync code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 4 -m "not benchmark" tests/core/full_node/full_sync/test_full_sync.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
|
||||
# Omitted resource usage check
|
||||
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
@ -1,122 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: Ubuntu core-full_node-stores Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Ubuntu core-full_node-stores Test
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 40
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.7', '3.8', '3.9', '3.10']
|
||||
os: [ubuntu-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_core-full_node-stores
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Cache npm
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Cache test blocks and plots
|
||||
uses: actions/cache@v2
|
||||
id: test-blocks-plots
|
||||
with:
|
||||
path: |
|
||||
${{ github.workspace }}/.chia/blocks
|
||||
${{ github.workspace }}/.chia/test-plots
|
||||
key: 0.29.0
|
||||
|
||||
- name: Checkout test blocks and plots
|
||||
if: steps.test-blocks-plots.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf -
|
||||
mkdir ${{ github.workspace }}/.chia
|
||||
mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
sh install.sh -d
|
||||
|
||||
# Omitted installing Timelord
|
||||
|
||||
- name: Test core-full_node-stores code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 4 -m "not benchmark" -p monitor tests/core/full_node/stores/test_block_store.py tests/core/full_node/stores/test_coin_store.py tests/core/full_node/stores/test_full_node_store.py tests/core/full_node/stores/test_hint_store.py tests/core/full_node/stores/test_sync_store.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Check resource usage
|
||||
run: |
|
||||
sqlite3 -readonly -separator " " .pymon "select item,cpu_usage,total_time,mem_usage from TEST_METRICS order by mem_usage desc;" >metrics.out
|
||||
./tests/check_pytest_monitor_output.py <metrics.out
|
||||
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
@ -1,122 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: Ubuntu core-full_node Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Ubuntu core-full_node Test
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 50
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.7', '3.8', '3.9', '3.10']
|
||||
os: [ubuntu-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_core-full_node
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Cache npm
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Cache test blocks and plots
|
||||
uses: actions/cache@v2
|
||||
id: test-blocks-plots
|
||||
with:
|
||||
path: |
|
||||
${{ github.workspace }}/.chia/blocks
|
||||
${{ github.workspace }}/.chia/test-plots
|
||||
key: 0.29.0
|
||||
|
||||
- name: Checkout test blocks and plots
|
||||
if: steps.test-blocks-plots.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf -
|
||||
mkdir ${{ github.workspace }}/.chia
|
||||
mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
sh install.sh -d
|
||||
|
||||
# Omitted installing Timelord
|
||||
|
||||
- name: Test core-full_node code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 4 -m "not benchmark" -p monitor tests/core/full_node/test_address_manager.py tests/core/full_node/test_block_height_map.py tests/core/full_node/test_conditions.py tests/core/full_node/test_full_node.py tests/core/full_node/test_generator_tools.py tests/core/full_node/test_hint_management.py tests/core/full_node/test_mempool.py tests/core/full_node/test_mempool_performance.py tests/core/full_node/test_node_load.py tests/core/full_node/test_peer_store_resolver.py tests/core/full_node/test_performance.py tests/core/full_node/test_transactions.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Check resource usage
|
||||
run: |
|
||||
sqlite3 -readonly -separator " " .pymon "select item,cpu_usage,total_time,mem_usage from TEST_METRICS order by mem_usage desc;" >metrics.out
|
||||
./tests/check_pytest_monitor_output.py <metrics.out
|
||||
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
119
.github/workflows/build-test-ubuntu-core-server.yml
vendored
119
.github/workflows/build-test-ubuntu-core-server.yml
vendored
@ -1,119 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: Ubuntu core-server Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Ubuntu core-server Test
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 30
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.7', '3.8', '3.9', '3.10']
|
||||
os: [ubuntu-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_core-server
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Cache npm
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Cache test blocks and plots
|
||||
uses: actions/cache@v2
|
||||
id: test-blocks-plots
|
||||
with:
|
||||
path: |
|
||||
${{ github.workspace }}/.chia/blocks
|
||||
${{ github.workspace }}/.chia/test-plots
|
||||
key: 0.29.0
|
||||
|
||||
- name: Checkout test blocks and plots
|
||||
if: steps.test-blocks-plots.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf -
|
||||
mkdir ${{ github.workspace }}/.chia
|
||||
mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
sh install.sh -d
|
||||
|
||||
# Omitted installing Timelord
|
||||
|
||||
- name: Test core-server code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 0 -m "not benchmark" tests/core/server/test_dos.py tests/core/server/test_rate_limits.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
|
||||
# Omitted resource usage check
|
||||
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
119
.github/workflows/build-test-ubuntu-core-ssl.yml
vendored
119
.github/workflows/build-test-ubuntu-core-ssl.yml
vendored
@ -1,119 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: Ubuntu core-ssl Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Ubuntu core-ssl Test
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 30
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.7', '3.8', '3.9', '3.10']
|
||||
os: [ubuntu-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_core-ssl
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Cache npm
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Cache test blocks and plots
|
||||
uses: actions/cache@v2
|
||||
id: test-blocks-plots
|
||||
with:
|
||||
path: |
|
||||
${{ github.workspace }}/.chia/blocks
|
||||
${{ github.workspace }}/.chia/test-plots
|
||||
key: 0.29.0
|
||||
|
||||
- name: Checkout test blocks and plots
|
||||
if: steps.test-blocks-plots.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf -
|
||||
mkdir ${{ github.workspace }}/.chia
|
||||
mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
sh install.sh -d
|
||||
|
||||
# Omitted installing Timelord
|
||||
|
||||
- name: Test core-ssl code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 4 -m "not benchmark" tests/core/ssl/test_ssl.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
|
||||
# Omitted resource usage check
|
||||
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
119
.github/workflows/build-test-ubuntu-core-util.yml
vendored
119
.github/workflows/build-test-ubuntu-core-util.yml
vendored
@ -1,119 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: Ubuntu core-util Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Ubuntu core-util Test
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 30
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.7', '3.8', '3.9', '3.10']
|
||||
os: [ubuntu-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_core-util
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Cache npm
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Cache test blocks and plots
|
||||
uses: actions/cache@v2
|
||||
id: test-blocks-plots
|
||||
with:
|
||||
path: |
|
||||
${{ github.workspace }}/.chia/blocks
|
||||
${{ github.workspace }}/.chia/test-plots
|
||||
key: 0.29.0
|
||||
|
||||
- name: Checkout test blocks and plots
|
||||
if: steps.test-blocks-plots.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf -
|
||||
mkdir ${{ github.workspace }}/.chia
|
||||
mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
sh install.sh -d
|
||||
|
||||
# Omitted installing Timelord
|
||||
|
||||
- name: Test core-util code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 4 -m "not benchmark" tests/core/util/test_cached_bls.py tests/core/util/test_config.py tests/core/util/test_db_wrapper.py tests/core/util/test_file_keyring_synchronization.py tests/core/util/test_files.py tests/core/util/test_jsonify.py tests/core/util/test_keychain.py tests/core/util/test_keyring_wrapper.py tests/core/util/test_lru_cache.py tests/core/util/test_significant_bits.py tests/core/util/test_streamable.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
|
||||
# Omitted resource usage check
|
||||
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
119
.github/workflows/build-test-ubuntu-core.yml
vendored
119
.github/workflows/build-test-ubuntu-core.yml
vendored
@ -1,119 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: Ubuntu core Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Ubuntu core Test
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 30
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.7', '3.8', '3.9', '3.10']
|
||||
os: [ubuntu-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_core
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Cache npm
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Cache test blocks and plots
|
||||
uses: actions/cache@v2
|
||||
id: test-blocks-plots
|
||||
with:
|
||||
path: |
|
||||
${{ github.workspace }}/.chia/blocks
|
||||
${{ github.workspace }}/.chia/test-plots
|
||||
key: 0.29.0
|
||||
|
||||
- name: Checkout test blocks and plots
|
||||
if: steps.test-blocks-plots.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf -
|
||||
mkdir ${{ github.workspace }}/.chia
|
||||
mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
sh install.sh -d
|
||||
|
||||
# Omitted installing Timelord
|
||||
|
||||
- name: Test core code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 4 -m "not benchmark" tests/core/test_coins.py tests/core/test_cost_calculation.py tests/core/test_crawler_rpc.py tests/core/test_daemon_rpc.py tests/core/test_db_conversion.py tests/core/test_db_validation.py tests/core/test_farmer_harvester_rpc.py tests/core/test_filter.py tests/core/test_full_node_rpc.py tests/core/test_merkle_set.py tests/core/test_setproctitle.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
|
||||
# Omitted resource usage check
|
||||
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
@ -1,119 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: Ubuntu farmer_harvester Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Ubuntu farmer_harvester Test
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 30
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.7', '3.8', '3.9', '3.10']
|
||||
os: [ubuntu-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_farmer_harvester
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Cache npm
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Cache test blocks and plots
|
||||
uses: actions/cache@v2
|
||||
id: test-blocks-plots
|
||||
with:
|
||||
path: |
|
||||
${{ github.workspace }}/.chia/blocks
|
||||
${{ github.workspace }}/.chia/test-plots
|
||||
key: 0.29.0
|
||||
|
||||
- name: Checkout test blocks and plots
|
||||
if: steps.test-blocks-plots.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf -
|
||||
mkdir ${{ github.workspace }}/.chia
|
||||
mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
sh install.sh -d
|
||||
|
||||
# Omitted installing Timelord
|
||||
|
||||
- name: Test farmer_harvester code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 0 -m "not benchmark" tests/farmer_harvester/test_farmer_harvester.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
|
||||
# Omitted resource usage check
|
||||
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
105
.github/workflows/build-test-ubuntu-generator.yml
vendored
105
.github/workflows/build-test-ubuntu-generator.yml
vendored
@ -1,105 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: Ubuntu generator Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Ubuntu generator Test
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 30
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.7', '3.8', '3.9', '3.10']
|
||||
os: [ubuntu-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_generator
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Cache npm
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
# Omitted checking out blocks and plots repo Chia-Network/test-cache
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
sh install.sh -d
|
||||
|
||||
# Omitted installing Timelord
|
||||
|
||||
- name: Test generator code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 4 -m "not benchmark" tests/generator/test_compression.py tests/generator/test_generator_types.py tests/generator/test_list_to_batches.py tests/generator/test_rom.py tests/generator/test_scan.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
|
||||
# Omitted resource usage check
|
||||
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
119
.github/workflows/build-test-ubuntu-plot_sync.yml
vendored
119
.github/workflows/build-test-ubuntu-plot_sync.yml
vendored
@ -1,119 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: Ubuntu plot_sync Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Ubuntu plot_sync Test
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 30
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.7', '3.8', '3.9', '3.10']
|
||||
os: [ubuntu-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_plot_sync
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Cache npm
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Cache test blocks and plots
|
||||
uses: actions/cache@v2
|
||||
id: test-blocks-plots
|
||||
with:
|
||||
path: |
|
||||
${{ github.workspace }}/.chia/blocks
|
||||
${{ github.workspace }}/.chia/test-plots
|
||||
key: 0.29.0
|
||||
|
||||
- name: Checkout test blocks and plots
|
||||
if: steps.test-blocks-plots.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf -
|
||||
mkdir ${{ github.workspace }}/.chia
|
||||
mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
sh install.sh -d
|
||||
|
||||
# Omitted installing Timelord
|
||||
|
||||
- name: Test plot_sync code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 4 -m "not benchmark" tests/plot_sync/test_delta.py tests/plot_sync/test_plot_sync.py tests/plot_sync/test_receiver.py tests/plot_sync/test_sender.py tests/plot_sync/test_sync_simulated.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
|
||||
# Omitted resource usage check
|
||||
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
119
.github/workflows/build-test-ubuntu-plotting.yml
vendored
119
.github/workflows/build-test-ubuntu-plotting.yml
vendored
@ -1,119 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: Ubuntu plotting Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Ubuntu plotting Test
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 30
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.7', '3.8', '3.9', '3.10']
|
||||
os: [ubuntu-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_plotting
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Cache npm
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Cache test blocks and plots
|
||||
uses: actions/cache@v2
|
||||
id: test-blocks-plots
|
||||
with:
|
||||
path: |
|
||||
${{ github.workspace }}/.chia/blocks
|
||||
${{ github.workspace }}/.chia/test-plots
|
||||
key: 0.29.0
|
||||
|
||||
- name: Checkout test blocks and plots
|
||||
if: steps.test-blocks-plots.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf -
|
||||
mkdir ${{ github.workspace }}/.chia
|
||||
mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
sh install.sh -d
|
||||
|
||||
# Omitted installing Timelord
|
||||
|
||||
- name: Test plotting code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 4 -m "not benchmark" tests/plotting/test_plot_manager.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
|
||||
# Omitted resource usage check
|
||||
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
119
.github/workflows/build-test-ubuntu-pools.yml
vendored
119
.github/workflows/build-test-ubuntu-pools.yml
vendored
@ -1,119 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: Ubuntu pools Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Ubuntu pools Test
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 60
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.7', '3.8', '3.9', '3.10']
|
||||
os: [ubuntu-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_pools
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Cache npm
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Cache test blocks and plots
|
||||
uses: actions/cache@v2
|
||||
id: test-blocks-plots
|
||||
with:
|
||||
path: |
|
||||
${{ github.workspace }}/.chia/blocks
|
||||
${{ github.workspace }}/.chia/test-plots
|
||||
key: 0.29.0
|
||||
|
||||
- name: Checkout test blocks and plots
|
||||
if: steps.test-blocks-plots.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf -
|
||||
mkdir ${{ github.workspace }}/.chia
|
||||
mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
sh install.sh -d
|
||||
|
||||
# Omitted installing Timelord
|
||||
|
||||
- name: Test pools code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 2 -m "not benchmark" tests/pools/test_pool_cmdline.py tests/pools/test_pool_config.py tests/pools/test_pool_puzzles_lifecycle.py tests/pools/test_pool_rpc.py tests/pools/test_pool_wallet.py tests/pools/test_wallet_pool_store.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
|
||||
# Omitted resource usage check
|
||||
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
123
.github/workflows/build-test-ubuntu-simulation.yml
vendored
123
.github/workflows/build-test-ubuntu-simulation.yml
vendored
@ -1,123 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: Ubuntu simulation Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Ubuntu simulation Test
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 60
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.7', '3.8', '3.9', '3.10']
|
||||
os: [ubuntu-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_simulation
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Cache npm
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Cache test blocks and plots
|
||||
uses: actions/cache@v2
|
||||
id: test-blocks-plots
|
||||
with:
|
||||
path: |
|
||||
${{ github.workspace }}/.chia/blocks
|
||||
${{ github.workspace }}/.chia/test-plots
|
||||
key: 0.29.0
|
||||
|
||||
- name: Checkout test blocks and plots
|
||||
if: steps.test-blocks-plots.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf -
|
||||
mkdir ${{ github.workspace }}/.chia
|
||||
mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
sh install.sh -d
|
||||
|
||||
- name: Install timelord
|
||||
run: |
|
||||
. ./activate
|
||||
sh install-timelord.sh -n
|
||||
./vdf_bench square_asm 400000
|
||||
|
||||
- name: Test simulation code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 0 -m "not benchmark" tests/simulation/test_simulation.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
|
||||
# Omitted resource usage check
|
||||
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
105
.github/workflows/build-test-ubuntu-tools.yml
vendored
105
.github/workflows/build-test-ubuntu-tools.yml
vendored
@ -1,105 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: Ubuntu tools Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Ubuntu tools Test
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 30
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.7', '3.8', '3.9', '3.10']
|
||||
os: [ubuntu-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_tools
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Cache npm
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
# Omitted checking out blocks and plots repo Chia-Network/test-cache
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
sh install.sh -d
|
||||
|
||||
# Omitted installing Timelord
|
||||
|
||||
- name: Test tools code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 4 -m "not benchmark" tests/tools/test_full_sync.py tests/tools/test_run_block.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
|
||||
# Omitted resource usage check
|
||||
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
105
.github/workflows/build-test-ubuntu-util.yml
vendored
105
.github/workflows/build-test-ubuntu-util.yml
vendored
@ -1,105 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: Ubuntu util Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Ubuntu util Test
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 60
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.7', '3.8', '3.9', '3.10']
|
||||
os: [ubuntu-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_util
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Cache npm
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
# Omitted checking out blocks and plots repo Chia-Network/test-cache
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
sh install.sh -d
|
||||
|
||||
# Omitted installing Timelord
|
||||
|
||||
- name: Test util code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 4 -m "not benchmark" tests/util/test_chunks.py tests/util/test_full_block_utils.py tests/util/test_lock_queue.py tests/util/test_misc.py tests/util/test_network.py tests/util/test_network_protocol_files.py tests/util/test_paginator.py tests/util/test_struct_stream.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
|
||||
# Omitted resource usage check
|
||||
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
@ -1,119 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: Ubuntu wallet-cat_wallet Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Ubuntu wallet-cat_wallet Test
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 50
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.7', '3.8', '3.9', '3.10']
|
||||
os: [ubuntu-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_wallet-cat_wallet
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Cache npm
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Cache test blocks and plots
|
||||
uses: actions/cache@v2
|
||||
id: test-blocks-plots
|
||||
with:
|
||||
path: |
|
||||
${{ github.workspace }}/.chia/blocks
|
||||
${{ github.workspace }}/.chia/test-plots
|
||||
key: 0.29.0
|
||||
|
||||
- name: Checkout test blocks and plots
|
||||
if: steps.test-blocks-plots.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf -
|
||||
mkdir ${{ github.workspace }}/.chia
|
||||
mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
sh install.sh -d
|
||||
|
||||
# Omitted installing Timelord
|
||||
|
||||
- name: Test wallet-cat_wallet code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 0 -m "not benchmark" tests/wallet/cat_wallet/test_cat_lifecycle.py tests/wallet/cat_wallet/test_cat_outer_puzzle.py tests/wallet/cat_wallet/test_cat_wallet.py tests/wallet/cat_wallet/test_offer_lifecycle.py tests/wallet/cat_wallet/test_trades.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
|
||||
# Omitted resource usage check
|
||||
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
@ -1,119 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: Ubuntu wallet-did_wallet Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Ubuntu wallet-did_wallet Test
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 50
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.7', '3.8', '3.9', '3.10']
|
||||
os: [ubuntu-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_wallet-did_wallet
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Cache npm
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Cache test blocks and plots
|
||||
uses: actions/cache@v2
|
||||
id: test-blocks-plots
|
||||
with:
|
||||
path: |
|
||||
${{ github.workspace }}/.chia/blocks
|
||||
${{ github.workspace }}/.chia/test-plots
|
||||
key: 0.29.0
|
||||
|
||||
- name: Checkout test blocks and plots
|
||||
if: steps.test-blocks-plots.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf -
|
||||
mkdir ${{ github.workspace }}/.chia
|
||||
mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
sh install.sh -d
|
||||
|
||||
# Omitted installing Timelord
|
||||
|
||||
- name: Test wallet-did_wallet code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 0 -m "not benchmark" tests/wallet/did_wallet/test_did.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
|
||||
# Omitted resource usage check
|
||||
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
@ -1,119 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: Ubuntu wallet-nft_wallet Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Ubuntu wallet-nft_wallet Test
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 30
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.7', '3.8', '3.9', '3.10']
|
||||
os: [ubuntu-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_wallet-nft_wallet
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Cache npm
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Cache test blocks and plots
|
||||
uses: actions/cache@v2
|
||||
id: test-blocks-plots
|
||||
with:
|
||||
path: |
|
||||
${{ github.workspace }}/.chia/blocks
|
||||
${{ github.workspace }}/.chia/test-plots
|
||||
key: 0.29.0
|
||||
|
||||
- name: Checkout test blocks and plots
|
||||
if: steps.test-blocks-plots.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf -
|
||||
mkdir ${{ github.workspace }}/.chia
|
||||
mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
sh install.sh -d
|
||||
|
||||
# Omitted installing Timelord
|
||||
|
||||
- name: Test wallet-nft_wallet code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 0 -m "not benchmark" tests/wallet/nft_wallet/test_nft_1_offers.py tests/wallet/nft_wallet/test_nft_lifecycle.py tests/wallet/nft_wallet/test_nft_offers.py tests/wallet/nft_wallet/test_nft_puzzles.py tests/wallet/nft_wallet/test_nft_wallet.py tests/wallet/nft_wallet/test_ownership_outer_puzzle.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
|
||||
# Omitted resource usage check
|
||||
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
@ -1,105 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: Ubuntu wallet-rl_wallet Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Ubuntu wallet-rl_wallet Test
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 30
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.7', '3.8', '3.9', '3.10']
|
||||
os: [ubuntu-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_wallet-rl_wallet
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Cache npm
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
# Omitted checking out blocks and plots repo Chia-Network/test-cache
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
sh install.sh -d
|
||||
|
||||
# Omitted installing Timelord
|
||||
|
||||
- name: Test wallet-rl_wallet code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 0 -m "not benchmark" tests/wallet/rl_wallet/test_rl_rpc.py tests/wallet/rl_wallet/test_rl_wallet.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
|
||||
# Omitted resource usage check
|
||||
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
119
.github/workflows/build-test-ubuntu-wallet-rpc.yml
vendored
119
.github/workflows/build-test-ubuntu-wallet-rpc.yml
vendored
@ -1,119 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: Ubuntu wallet-rpc Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Ubuntu wallet-rpc Test
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 30
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.7', '3.8', '3.9', '3.10']
|
||||
os: [ubuntu-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_wallet-rpc
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Cache npm
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Cache test blocks and plots
|
||||
uses: actions/cache@v2
|
||||
id: test-blocks-plots
|
||||
with:
|
||||
path: |
|
||||
${{ github.workspace }}/.chia/blocks
|
||||
${{ github.workspace }}/.chia/test-plots
|
||||
key: 0.29.0
|
||||
|
||||
- name: Checkout test blocks and plots
|
||||
if: steps.test-blocks-plots.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf -
|
||||
mkdir ${{ github.workspace }}/.chia
|
||||
mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
sh install.sh -d
|
||||
|
||||
# Omitted installing Timelord
|
||||
|
||||
- name: Test wallet-rpc code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 0 -m "not benchmark" tests/wallet/rpc/test_dl_wallet_rpc.py tests/wallet/rpc/test_wallet_rpc.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
|
||||
# Omitted resource usage check
|
||||
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
@ -1,119 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: Ubuntu wallet-simple_sync Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Ubuntu wallet-simple_sync Test
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 30
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.7', '3.8', '3.9', '3.10']
|
||||
os: [ubuntu-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_wallet-simple_sync
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Cache npm
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Cache test blocks and plots
|
||||
uses: actions/cache@v2
|
||||
id: test-blocks-plots
|
||||
with:
|
||||
path: |
|
||||
${{ github.workspace }}/.chia/blocks
|
||||
${{ github.workspace }}/.chia/test-plots
|
||||
key: 0.29.0
|
||||
|
||||
- name: Checkout test blocks and plots
|
||||
if: steps.test-blocks-plots.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf -
|
||||
mkdir ${{ github.workspace }}/.chia
|
||||
mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
sh install.sh -d
|
||||
|
||||
# Omitted installing Timelord
|
||||
|
||||
- name: Test wallet-simple_sync code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 0 -m "not benchmark" tests/wallet/simple_sync/test_simple_sync_protocol.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
|
||||
# Omitted resource usage check
|
||||
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
119
.github/workflows/build-test-ubuntu-wallet-sync.yml
vendored
119
.github/workflows/build-test-ubuntu-wallet-sync.yml
vendored
@ -1,119 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: Ubuntu wallet-sync Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Ubuntu wallet-sync Test
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 60
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.7', '3.8', '3.9', '3.10']
|
||||
os: [ubuntu-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_wallet-sync
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Cache npm
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Cache test blocks and plots
|
||||
uses: actions/cache@v2
|
||||
id: test-blocks-plots
|
||||
with:
|
||||
path: |
|
||||
${{ github.workspace }}/.chia/blocks
|
||||
${{ github.workspace }}/.chia/test-plots
|
||||
key: 0.29.0
|
||||
|
||||
- name: Checkout test blocks and plots
|
||||
if: steps.test-blocks-plots.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf -
|
||||
mkdir ${{ github.workspace }}/.chia
|
||||
mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
sh install.sh -d
|
||||
|
||||
# Omitted installing Timelord
|
||||
|
||||
- name: Test wallet-sync code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 0 -m "not benchmark" tests/wallet/sync/test_wallet_sync.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
|
||||
# Omitted resource usage check
|
||||
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
119
.github/workflows/build-test-ubuntu-wallet.yml
vendored
119
.github/workflows/build-test-ubuntu-wallet.yml
vendored
@ -1,119 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: Ubuntu wallet Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Ubuntu wallet Test
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 40
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.7', '3.8', '3.9', '3.10']
|
||||
os: [ubuntu-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_wallet
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Cache npm
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Cache test blocks and plots
|
||||
uses: actions/cache@v2
|
||||
id: test-blocks-plots
|
||||
with:
|
||||
path: |
|
||||
${{ github.workspace }}/.chia/blocks
|
||||
${{ github.workspace }}/.chia/test-plots
|
||||
key: 0.29.0
|
||||
|
||||
- name: Checkout test blocks and plots
|
||||
if: steps.test-blocks-plots.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf -
|
||||
mkdir ${{ github.workspace }}/.chia
|
||||
mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
sh install.sh -d
|
||||
|
||||
# Omitted installing Timelord
|
||||
|
||||
- name: Test wallet code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 4 -m "not benchmark" tests/wallet/test_bech32m.py tests/wallet/test_chialisp.py tests/wallet/test_coin_selection.py tests/wallet/test_nft_store.py tests/wallet/test_puzzle_store.py tests/wallet/test_singleton.py tests/wallet/test_singleton_lifecycle.py tests/wallet/test_singleton_lifecycle_fast.py tests/wallet/test_taproot.py tests/wallet/test_wallet.py tests/wallet/test_wallet_blockchain.py tests/wallet/test_wallet_interested_store.py tests/wallet/test_wallet_key_val_store.py tests/wallet/test_wallet_retry.py tests/wallet/test_wallet_store.py tests/wallet/test_wallet_user_store.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
|
||||
# Omitted resource usage check
|
||||
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
119
.github/workflows/build-test-ubuntu-weight_proof.yml
vendored
119
.github/workflows/build-test-ubuntu-weight_proof.yml
vendored
@ -1,119 +0,0 @@
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
||||
name: Ubuntu weight_proof Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'long_lived/**'
|
||||
- main
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Ubuntu weight_proof Test
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 30
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.7', '3.8', '3.9', '3.10']
|
||||
os: [ubuntu-latest]
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_weight_proof
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Cache npm
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Cache test blocks and plots
|
||||
uses: actions/cache@v2
|
||||
id: test-blocks-plots
|
||||
with:
|
||||
path: |
|
||||
${{ github.workspace }}/.chia/blocks
|
||||
${{ github.workspace }}/.chia/test-plots
|
||||
key: 0.29.0
|
||||
|
||||
- name: Checkout test blocks and plots
|
||||
if: steps.test-blocks-plots.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf -
|
||||
mkdir ${{ github.workspace }}/.chia
|
||||
mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
sh install.sh -d
|
||||
|
||||
# Omitted installing Timelord
|
||||
|
||||
- name: Test weight_proof code with pytest
|
||||
run: |
|
||||
. ./activate
|
||||
venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 4 -m "not benchmark" tests/weight_proof/test_weight_proof.py
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
venv/bin/coverage combine --rcfile=.coveragerc .coverage.*
|
||||
venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
venv/bin/coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
|
||||
# Omitted resource usage check
|
||||
|
||||
#
|
||||
# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme
|
||||
#
|
@ -223,13 +223,13 @@ jobs:
|
||||
py3createtorrent -f -t udp://tracker.opentrackr.org:1337/announce ${{ github.workspace }}\chia-blockchain-gui\release-builds\windows-installer\ChiaSetup-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}.exe -o ${{ github.workspace }}\chia-blockchain-gui\release-builds\windows-installer\ChiaSetup-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}.exe.torrent --webseed https://download.chia.net/install/ChiaSetup-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}.exe
|
||||
ls
|
||||
|
||||
- name: Upload Beta Installer
|
||||
- name: Upload Dev Installer
|
||||
if: steps.check_secrets.outputs.HAS_AWS_SECRET && github.ref == 'refs/heads/main'
|
||||
env:
|
||||
CHIA_INSTALLER_VERSION: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}
|
||||
run: |
|
||||
aws s3 cp ${{ github.workspace }}\chia-blockchain-gui\release-builds\windows-installer\ChiaSetup-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}.exe s3://download.chia.net/beta/ChiaSetup-latest-beta.exe
|
||||
aws s3 cp ${{ github.workspace }}\chia-blockchain-gui\release-builds\windows-installer\ChiaSetup-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}.exe.sha256 s3://download.chia.net/beta/ChiaSetup-latest-beta.exe.sha256
|
||||
aws s3 cp ${{ github.workspace }}\chia-blockchain-gui\release-builds\windows-installer\ChiaSetup-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}.exe s3://download.chia.net/latest-dev/ChiaSetup-latest-dev.exe
|
||||
aws s3 cp ${{ github.workspace }}\chia-blockchain-gui\release-builds\windows-installer\ChiaSetup-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}.exe.sha256 s3://download.chia.net/latest-dev/ChiaSetup-latest-dev.exe.sha256
|
||||
|
||||
- name: Upload Release Files
|
||||
if: steps.check_secrets.outputs.HAS_AWS_SECRET && startsWith(github.ref, 'refs/tags/')
|
||||
|
6
.github/workflows/super-linter.yml
vendored
6
.github/workflows/super-linter.yml
vendored
@ -57,14 +57,14 @@ jobs:
|
||||
# Run Linter against code base #
|
||||
################################
|
||||
- name: Lint Code Base
|
||||
uses: github/super-linter@v4.9.2
|
||||
uses: github/super-linter@v4.9.3
|
||||
# uses: docker://github/super-linter:v3.10.2
|
||||
env:
|
||||
VALIDATE_ALL_CODEBASE: true
|
||||
DEFAULT_BRANCH: main
|
||||
LINTER_RULES_PATH: .
|
||||
MARKDOWN_CONFIG_FILE: .markdown-lint.yml
|
||||
PYTHON_FLAKE8_CONFIG_FILE: .flake8
|
||||
# PYTHON_FLAKE8_CONFIG_FILE: .flake8
|
||||
PYTHON_ISORT_CONFIG_FILE: .isort.cfg
|
||||
PYTHON_PYLINT_CONFIG_FILE: pylintrc
|
||||
VALIDATE_BASH: true
|
||||
@ -77,7 +77,7 @@ jobs:
|
||||
VALIDATE_MD: true
|
||||
VALIDATE_POWERSHELL: true
|
||||
VALIDATE_PYTHON_PYLINT: true
|
||||
VALIDATE_PYTHON_FLAKE8: true
|
||||
# VALIDATE_PYTHON_FLAKE8: true
|
||||
# VALIDATE_PYTHON_ISORT: true
|
||||
VALIDATE_SHELL_SHFMT: true
|
||||
VALIDATE_TYPESCRIPT_ES: true
|
||||
|
227
.github/workflows/test-single.yml
vendored
Normal file
227
.github/workflows/test-single.yml
vendored
Normal file
@ -0,0 +1,227 @@
|
||||
name: test
|
||||
|
||||
# This reusable workflow structure was chosen for the sole purpose of working around
|
||||
# the 256 job per matrix limit. The initial total test job count was 290. This
|
||||
# approach shifts the 256 limit to be per OS rather than overall. A simpler single
|
||||
# regular workflow with matrixing against the OS would be preferred.
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
emoji:
|
||||
required: true
|
||||
type: string
|
||||
matrix:
|
||||
required: true
|
||||
type: string
|
||||
name:
|
||||
required: true
|
||||
type: string
|
||||
file_name:
|
||||
required: true
|
||||
type: string
|
||||
concurrency_name:
|
||||
required: true
|
||||
type: string
|
||||
configuration:
|
||||
required: true
|
||||
type: string
|
||||
runs-on:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
|
||||
concurrency:
|
||||
# SHA is added to the end if on `main` to let all main workflows run
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ inputs.concurrency_name }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: ${{ matrix.os.emoji }} ${{ matrix.configuration.name }} - ${{ matrix.python.name }}
|
||||
runs-on: ${{ matrix.os.runs-on }}
|
||||
timeout-minutes: ${{ matrix.configuration.job_timeout }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
configuration: ${{ fromJson(inputs.configuration) }}
|
||||
os:
|
||||
- emoji: ${{ inputs.emoji }}
|
||||
matrix: ${{ inputs.matrix }}
|
||||
name: ${{ inputs.name }}
|
||||
file_name: ${{ inputs.file_name }}
|
||||
runs-on: ${{ inputs.runs-on }}
|
||||
python:
|
||||
- name: '3.7'
|
||||
file_name: '3.7'
|
||||
action: '3.7'
|
||||
apt: '3.7'
|
||||
install_sh: '3.7'
|
||||
matrix: '3.7'
|
||||
- name: '3.8'
|
||||
file_name: '3.8'
|
||||
action: '3.8'
|
||||
apt: '3.8'
|
||||
install_sh: '3.8'
|
||||
matrix: '3.8'
|
||||
- name: '3.9'
|
||||
file_name: '3.9'
|
||||
action: '3.9'
|
||||
apt: '3.9'
|
||||
install_sh: '3.9'
|
||||
matrix: '3.9'
|
||||
- name: '3.10'
|
||||
file_name: '3.10'
|
||||
action: '3.10'
|
||||
apt: '3.10'
|
||||
install_sh: '3.10'
|
||||
matrix: '3.10'
|
||||
exclude:
|
||||
- os:
|
||||
matrix: macos
|
||||
python:
|
||||
matrix: '3.7'
|
||||
- os:
|
||||
matrix: macos
|
||||
python:
|
||||
matrix: '3.8'
|
||||
- os:
|
||||
matrix: windows
|
||||
configuration:
|
||||
install_timelord: true
|
||||
- os:
|
||||
matrix: windows
|
||||
configuration:
|
||||
name: core.full_node
|
||||
|
||||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
JOB_FILE_NAME: tests_${{ matrix.os.file_name }}_python-${{ matrix.python.file_name }}_${{ matrix.configuration.name }}
|
||||
|
||||
steps:
|
||||
- name: Configure git
|
||||
run: |
|
||||
git config --global core.autocrlf false
|
||||
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python.action }}
|
||||
|
||||
- name: Create keychain for CI use (macOS)
|
||||
if: matrix.os.matrix == 'macos'
|
||||
run: |
|
||||
security create-keychain -p foo chiachain
|
||||
security default-keychain -s chiachain
|
||||
security unlock-keychain -p foo chiachain
|
||||
security set-keychain-settings -t 7200 -u chiachain
|
||||
|
||||
- name: Cache npm (Ubuntu)
|
||||
if: matrix.os.matrix == 'ubuntu'
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
# Note that new runners may break this https://github.com/actions/cache/issues/292
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Cache test blocks and plots
|
||||
if: matrix.configuration.checkout_blocks_and_plots
|
||||
uses: actions/cache@v3
|
||||
id: test-blocks-plots
|
||||
with:
|
||||
path: |
|
||||
${{ github.workspace }}/.chia/blocks
|
||||
${{ github.workspace }}/.chia/test-plots
|
||||
key: 0.29.0
|
||||
|
||||
- name: Checkout test blocks and plots (macOS, Ubuntu)
|
||||
if: steps.test-blocks-plots.outputs.cache-hit != 'true' && (matrix.os.matrix == 'ubuntu' || matrix.os.matrix == 'macos')
|
||||
run: |
|
||||
wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf -
|
||||
mkdir ${{ github.workspace }}/.chia
|
||||
mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia
|
||||
|
||||
- name: Checkout test blocks and plots (Windows)
|
||||
if: steps.test-blocks-plots.outputs.cache-hit != 'true' && matrix.os.matrix == 'windows'
|
||||
run: |
|
||||
Invoke-WebRequest -OutFile blocks_and_plots.zip https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.zip; Expand-Archive blocks_and_plots.zip -DestinationPath .
|
||||
mkdir ${{ github.workspace }}/.chia
|
||||
mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia
|
||||
|
||||
- name: Install boost (macOS)
|
||||
if: matrix.os.matrix == 'macos'
|
||||
run: |
|
||||
brew install boost
|
||||
|
||||
- name: Run install script (macOS, Ubuntu)
|
||||
if: matrix.os.matrix == 'macos' || matrix.os.matrix == 'ubuntu'
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python.install_sh }}
|
||||
run: |
|
||||
sh install.sh -d
|
||||
echo "$(cd venv/bin/; pwd)" >> $GITHUB_PATH
|
||||
echo "VIRTUAL_ENV=$(cd venv/; pwd)" >> $GITHUB_ENV
|
||||
|
||||
- name: Run install script (Windows)
|
||||
if: matrix.os.matrix == 'windows'
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python.install_sh }}
|
||||
run: |
|
||||
./Install.ps1 -d
|
||||
(Resolve-Path venv/Scripts/).Path >> $Env:GITHUB_PATH
|
||||
$env_path = (Resolve-Path venv/).Path
|
||||
Write-Output "VIRTUAL_ENV=$env_path" >> $Env:GITHUB_ENV
|
||||
|
||||
- name: Install timelord
|
||||
if: matrix.configuration.install_timelord
|
||||
run: |
|
||||
sh install-timelord.sh -n
|
||||
./vdf_bench square_asm 400000
|
||||
|
||||
- name: Test blockchain code with pytest
|
||||
env:
|
||||
ENABLE_PYTEST_MONITOR: ${{ matrix.os.matrix == 'ubuntu' && matrix.configuration.enable_pytest_monitor || '' }}
|
||||
run: |
|
||||
coverage run --rcfile=.coveragerc --module pytest --durations=10 ${{ matrix.configuration.pytest_parallel_args[matrix.os.matrix] }} -m "not benchmark" ${{ env.ENABLE_PYTEST_MONITOR }} ${{ matrix.configuration.test_files }}
|
||||
|
||||
- name: Process coverage data
|
||||
run: |
|
||||
coverage combine --rcfile=.coveragerc
|
||||
coverage xml --rcfile=.coveragerc -o coverage.xml
|
||||
mkdir coverage_reports
|
||||
cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}"
|
||||
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml"
|
||||
coverage report --rcfile=.coveragerc --show-missing
|
||||
|
||||
- name: Publish coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage_reports/*
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Check resource usage
|
||||
if: matrix.os.matrix == 'ubuntu' && matrix.configuration.check_resource_usage
|
||||
run: |
|
||||
sqlite3 -readonly -separator " " .pymon "select item,cpu_usage,total_time,mem_usage from TEST_METRICS order by mem_usage desc;" >metrics.out
|
||||
./tests/check_pytest_monitor_output.py <metrics.out
|
77
.github/workflows/test.yml
vendored
Normal file
77
.github/workflows/test.yml
vendored
Normal file
@ -0,0 +1,77 @@
|
||||
name: test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- long_lived/**
|
||||
- main
|
||||
- release/**
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
workflow_dispatch: null
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}--${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
configure:
|
||||
name: Configure matrix
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.9'
|
||||
|
||||
- name: Generate matrix configuration
|
||||
id: configure
|
||||
run: |
|
||||
python tests/build-job-matrix.py --per directory --verbose > matrix.json
|
||||
cat matrix.json
|
||||
echo ::set-output name=configuration::$(cat matrix.json)
|
||||
echo ::set-output name=steps::$(cat some.json)
|
||||
|
||||
outputs:
|
||||
configuration: ${{ steps.configure.outputs.configuration }}
|
||||
|
||||
macos:
|
||||
uses: ./.github/workflows/test-single.yml
|
||||
needs: configure
|
||||
with:
|
||||
emoji: 🍎
|
||||
matrix: macos
|
||||
name: macOS
|
||||
file_name: macos
|
||||
concurrency_name: macos
|
||||
configuration: ${{ needs.configure.outputs.configuration }}
|
||||
runs-on: macos-latest
|
||||
ubuntu:
|
||||
uses: ./.github/workflows/test-single.yml
|
||||
needs: configure
|
||||
with:
|
||||
emoji: 🐧
|
||||
matrix: ubuntu
|
||||
name: Ubuntu
|
||||
file_name: ubuntu
|
||||
concurrency_name: ubuntu
|
||||
configuration: ${{ needs.configure.outputs.configuration }}
|
||||
runs-on: ubuntu-latest
|
||||
windows:
|
||||
uses: ./.github/workflows/test-single.yml
|
||||
needs: configure
|
||||
with:
|
||||
emoji: 🪟
|
||||
matrix: windows
|
||||
name: Windows
|
||||
file_name: windows
|
||||
concurrency_name: windows
|
||||
configuration: ${{ needs.configure.outputs.configuration }}
|
||||
runs-on: windows-latest
|
2
.github/workflows/upload-pypi-source.yml
vendored
2
.github/workflows/upload-pypi-source.yml
vendored
@ -56,7 +56,7 @@ jobs:
|
||||
|
||||
- name: Lint source with flake8
|
||||
run: |
|
||||
flake8 chia tests
|
||||
flake8 benchmarks build_scripts chia tests tools *.py
|
||||
|
||||
- name: Lint source with mypy
|
||||
run: |
|
||||
|
@ -1,11 +1,6 @@
|
||||
repos:
|
||||
- repo: local
|
||||
hooks:
|
||||
- id: build-workflows
|
||||
name: Validate github action workflows
|
||||
entry: ./tests/build-workflows.py --fail-on-update
|
||||
language: python
|
||||
pass_filenames: false
|
||||
- id: check-sql
|
||||
name: Validate SQL statements
|
||||
entry: ./tests/check_sql_statements.py
|
||||
|
@ -30,7 +30,7 @@ def make_coins(num: int) -> Tuple[List[Coin], List[bytes32]]:
|
||||
for i in range(num):
|
||||
c = make_coin()
|
||||
additions.append(c)
|
||||
hashes.append(c.get_hash())
|
||||
hashes.append(c.name())
|
||||
|
||||
return additions, hashes
|
||||
|
||||
@ -148,8 +148,8 @@ async def run_new_block_benchmark(version: int):
|
||||
total_add += 1
|
||||
|
||||
farmer_coin, pool_coin = rewards(uint32(height))
|
||||
all_coins += [c.get_hash()]
|
||||
all_unspent += [c.get_hash()]
|
||||
all_coins += [c.name()]
|
||||
all_unspent += [c.name()]
|
||||
all_unspent += [pool_coin.name(), farmer_coin.name()]
|
||||
total_add += 2
|
||||
|
||||
|
@ -2,6 +2,7 @@ from pathlib import Path
|
||||
import click
|
||||
from chia.cmds.db_upgrade_func import db_upgrade_func
|
||||
from chia.cmds.db_validate_func import db_validate_func
|
||||
from chia.cmds.db_backup_func import db_backup_func
|
||||
|
||||
|
||||
@click.group("db", short_help="Manage the blockchain database")
|
||||
@ -61,3 +62,19 @@ def db_validate_cmd(ctx: click.Context, validate_blocks: bool, **kwargs) -> None
|
||||
)
|
||||
except RuntimeError as e:
|
||||
print(f"FAILED: {e}")
|
||||
|
||||
|
||||
@db_cmd.command("backup", short_help="backup the blockchain database using VACUUM INTO command")
|
||||
@click.option("--backup_file", default=None, type=click.Path(), help="Specifies the backup file")
|
||||
@click.option("--no_indexes", default=False, is_flag=True, help="Create backup without indexes")
|
||||
@click.pass_context
|
||||
def db_backup_cmd(ctx: click.Context, no_indexes: bool, **kwargs) -> None:
|
||||
try:
|
||||
db_backup_file = kwargs.get("backup_file")
|
||||
db_backup_func(
|
||||
Path(ctx.obj["root_path"]),
|
||||
None if db_backup_file is None else Path(db_backup_file),
|
||||
no_indexes=no_indexes,
|
||||
)
|
||||
except RuntimeError as e:
|
||||
print(f"FAILED: {e}")
|
||||
|
75
chia/cmds/db_backup_func.py
Normal file
75
chia/cmds/db_backup_func.py
Normal file
@ -0,0 +1,75 @@
|
||||
from pathlib import Path
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
from chia.util.config import load_config
|
||||
from chia.util.path import path_from_root
|
||||
|
||||
|
||||
def db_backup_func(
|
||||
root_path: Path,
|
||||
backup_db_file: Optional[Path] = None,
|
||||
*,
|
||||
no_indexes: bool,
|
||||
) -> None:
|
||||
config: Dict[str, Any] = load_config(root_path, "config.yaml")["full_node"]
|
||||
selected_network: str = config["selected_network"]
|
||||
db_pattern: str = config["database_path"]
|
||||
db_path_replaced: str = db_pattern.replace("CHALLENGE", selected_network)
|
||||
source_db = path_from_root(root_path, db_path_replaced)
|
||||
if backup_db_file is None:
|
||||
db_path_replaced_backup = db_path_replaced.replace("blockchain_", "vacuumed_blockchain_")
|
||||
backup_db_file = path_from_root(root_path, db_path_replaced_backup)
|
||||
|
||||
backup_db(source_db, backup_db_file, no_indexes=no_indexes)
|
||||
|
||||
print(f"\n\nDatabase backup finished : {backup_db_file}\n")
|
||||
|
||||
|
||||
def backup_db(source_db: Path, backup_db: Path, *, no_indexes: bool) -> None:
|
||||
import sqlite3
|
||||
from contextlib import closing
|
||||
|
||||
# VACUUM INTO is only avaiable starting with SQLite version 3.27.0
|
||||
if not no_indexes and sqlite3.sqlite_version_info < (3, 27, 0):
|
||||
raise RuntimeError(
|
||||
f"SQLite {sqlite3.sqlite_version} not supported. Version needed is 3.27.0"
|
||||
f"\n\tuse '--no_indexes' option to create a backup without indexes instead."
|
||||
f"\n\tIn case of a restore, the missing indexes will be recreated during full node startup."
|
||||
)
|
||||
|
||||
if not backup_db.parent.exists():
|
||||
print(f"backup destination path doesn't exist. {backup_db.parent}")
|
||||
raise RuntimeError(f"can't find {backup_db}")
|
||||
|
||||
print(f"reading from blockchain database: {source_db}")
|
||||
print(f"writing to backup file: {backup_db}")
|
||||
with closing(sqlite3.connect(source_db)) as in_db:
|
||||
try:
|
||||
if no_indexes:
|
||||
in_db.execute("ATTACH DATABASE ? AS backup", (str(backup_db),))
|
||||
in_db.execute("pragma backup.journal_mode=OFF")
|
||||
in_db.execute("pragma backup.synchronous=OFF")
|
||||
# Use writable_schema=1 to allow create table using internal sqlite names like sqlite_stat1
|
||||
in_db.execute("pragma backup.writable_schema=1")
|
||||
cursor = in_db.cursor()
|
||||
for row in cursor.execute(
|
||||
"select replace(sql,'CREATE TABLE ', 'CREATE TABLE backup.') from sqlite_master "
|
||||
"where upper(type)='TABLE'"
|
||||
):
|
||||
in_db.execute(row[0])
|
||||
|
||||
in_db.execute("BEGIN TRANSACTION")
|
||||
for row in cursor.execute(
|
||||
"select 'INSERT INTO backup.'||name||' SELECT * FROM main.'||name from sqlite_master "
|
||||
"where upper(type)='TABLE'"
|
||||
):
|
||||
in_db.execute(row[0])
|
||||
in_db.execute("COMMIT")
|
||||
in_db.execute("DETACH DATABASE backup")
|
||||
else:
|
||||
in_db.execute("VACUUM INTO ?", [str(backup_db)])
|
||||
except sqlite3.OperationalError as e:
|
||||
raise RuntimeError(
|
||||
f"backup failed with error: '{e}'"
|
||||
f"\n\tYour backup file {backup_db} is probably left over in an insconsistent state."
|
||||
)
|
@ -8,7 +8,7 @@ import textwrap
|
||||
import os
|
||||
|
||||
from chia.util.config import load_config, lock_and_load_config, save_config
|
||||
from chia.util.path import mkdir, path_from_root
|
||||
from chia.util.path import path_from_root
|
||||
from chia.util.ints import uint32
|
||||
from chia.types.blockchain_format.sized_bytes import bytes32
|
||||
|
||||
@ -44,7 +44,7 @@ def db_upgrade_func(
|
||||
if out_db_path is None:
|
||||
db_path_replaced = db_pattern.replace("CHALLENGE", selected_network).replace("_v1_", "_v2_")
|
||||
out_db_path = path_from_root(root_path, db_path_replaced)
|
||||
mkdir(out_db_path.parent)
|
||||
out_db_path.parent.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
total, used, free = shutil.disk_usage(out_db_path.parent)
|
||||
in_db_size = in_db_path.stat().st_size
|
||||
|
@ -17,14 +17,14 @@ from chia.util.network import is_localhost
|
||||
SECONDS_PER_BLOCK = (24 * 3600) / 4608
|
||||
|
||||
|
||||
async def get_harvesters(farmer_rpc_port: Optional[int]) -> Optional[Dict[str, Any]]:
|
||||
async def get_harvesters_summary(farmer_rpc_port: Optional[int]) -> Optional[Dict[str, Any]]:
|
||||
try:
|
||||
config = load_config(DEFAULT_ROOT_PATH, "config.yaml")
|
||||
self_hostname = config["self_hostname"]
|
||||
if farmer_rpc_port is None:
|
||||
farmer_rpc_port = config["farmer"]["rpc_port"]
|
||||
farmer_client = await FarmerRpcClient.create(self_hostname, uint16(farmer_rpc_port), DEFAULT_ROOT_PATH, config)
|
||||
plots = await farmer_client.get_harvesters()
|
||||
plots = await farmer_client.get_harvesters_summary()
|
||||
except Exception as e:
|
||||
if isinstance(e, aiohttp.ClientConnectorError):
|
||||
print(f"Connection error. Check if farmer is running at {farmer_rpc_port}")
|
||||
@ -184,7 +184,7 @@ async def summary(
|
||||
harvester_rpc_port: Optional[int],
|
||||
farmer_rpc_port: Optional[int],
|
||||
) -> None:
|
||||
all_harvesters = await get_harvesters(farmer_rpc_port)
|
||||
harvesters_summary = await get_harvesters_summary(farmer_rpc_port)
|
||||
blockchain_state = await get_blockchain_state(rpc_port)
|
||||
farmer_running = await is_farmer_running(farmer_rpc_port)
|
||||
|
||||
@ -221,10 +221,10 @@ async def summary(
|
||||
total_plot_size = 0
|
||||
total_plots = 0
|
||||
|
||||
if all_harvesters is not None:
|
||||
harvesters_local: dict = {}
|
||||
harvesters_remote: dict = {}
|
||||
for harvester in all_harvesters["harvesters"]:
|
||||
if harvesters_summary is not None:
|
||||
harvesters_local: Dict[str, Dict[str, Any]] = {}
|
||||
harvesters_remote: Dict[str, Dict[str, Any]] = {}
|
||||
for harvester in harvesters_summary["harvesters"]:
|
||||
ip = harvester["connection"]["host"]
|
||||
if is_localhost(ip):
|
||||
harvesters_local[harvester["connection"]["node_id"]] = harvester
|
||||
@ -234,11 +234,16 @@ async def summary(
|
||||
harvesters_remote[ip][harvester["connection"]["node_id"]] = harvester
|
||||
|
||||
def process_harvesters(harvester_peers_in: dict):
|
||||
for harvester_peer_id, plots in harvester_peers_in.items():
|
||||
total_plot_size_harvester = sum(map(lambda x: x["file_size"], plots["plots"]))
|
||||
PlotStats.total_plot_size += total_plot_size_harvester
|
||||
PlotStats.total_plots += len(plots["plots"])
|
||||
print(f" {len(plots['plots'])} plots of size: {format_bytes(total_plot_size_harvester)}")
|
||||
for harvester_peer_id, harvester_dict in harvester_peers_in.items():
|
||||
syncing = harvester_dict["syncing"]
|
||||
if syncing is not None and syncing["initial"]:
|
||||
print(f" Loading plots: {syncing['plot_files_processed']} / {syncing['plot_files_total']}")
|
||||
else:
|
||||
total_plot_size_harvester = harvester_dict["total_plot_size"]
|
||||
plot_count_harvester = harvester_dict["plots"]
|
||||
PlotStats.total_plot_size += total_plot_size_harvester
|
||||
PlotStats.total_plots += plot_count_harvester
|
||||
print(f" {plot_count_harvester} plots of size: {format_bytes(total_plot_size_harvester)}")
|
||||
|
||||
if len(harvesters_local) > 0:
|
||||
print(f"Local Harvester{'s' if len(harvesters_local) > 1 else ''}")
|
||||
@ -262,11 +267,11 @@ async def summary(
|
||||
print("Estimated network space: Unknown")
|
||||
|
||||
minutes = -1
|
||||
if blockchain_state is not None and all_harvesters is not None:
|
||||
if blockchain_state is not None and harvesters_summary is not None:
|
||||
proportion = PlotStats.total_plot_size / blockchain_state["space"] if blockchain_state["space"] else -1
|
||||
minutes = int((await get_average_block_time(rpc_port) / 60) / proportion) if proportion else -1
|
||||
|
||||
if all_harvesters is not None and PlotStats.total_plots == 0:
|
||||
if harvesters_summary is not None and PlotStats.total_plots == 0:
|
||||
print("Expected time to win: Never (no plots)")
|
||||
else:
|
||||
print("Expected time to win: " + format_minutes(minutes))
|
||||
|
@ -26,7 +26,7 @@ from chia.util.config import (
|
||||
)
|
||||
from chia.util.db_version import set_db_version
|
||||
from chia.util.keychain import Keychain
|
||||
from chia.util.path import mkdir, path_from_root
|
||||
from chia.util.path import path_from_root
|
||||
from chia.util.ssl_check import (
|
||||
DEFAULT_PERMISSIONS_CERT_FILE,
|
||||
DEFAULT_PERMISSIONS_KEY_FILE,
|
||||
@ -174,7 +174,7 @@ def check_keys(new_root: Path, keychain: Optional[Keychain] = None) -> None:
|
||||
def copy_files_rec(old_path: Path, new_path: Path):
|
||||
if old_path.is_file():
|
||||
print(f"{new_path}")
|
||||
mkdir(new_path.parent)
|
||||
new_path.parent.mkdir(parents=True, exist_ok=True)
|
||||
shutil.copy(old_path, new_path)
|
||||
elif old_path.is_dir():
|
||||
for old_path_child in old_path.iterdir():
|
||||
@ -508,7 +508,7 @@ def chia_init(
|
||||
db_path_replaced = new_db_path.replace("CHALLENGE", config["selected_network"])
|
||||
db_path = path_from_root(root_path, db_path_replaced)
|
||||
|
||||
mkdir(db_path.parent)
|
||||
db_path.parent.mkdir(parents=True, exist_ok=True)
|
||||
with sqlite3.connect(db_path) as connection:
|
||||
set_db_version(connection, 1)
|
||||
|
||||
@ -518,7 +518,7 @@ def chia_init(
|
||||
config = load_config(root_path, "config.yaml")["full_node"]
|
||||
db_path_replaced = config["database_path"].replace("CHALLENGE", config["selected_network"])
|
||||
db_path = path_from_root(root_path, db_path_replaced)
|
||||
mkdir(db_path.parent)
|
||||
db_path.parent.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
with sqlite3.connect(db_path) as connection:
|
||||
set_db_version(connection, 2)
|
||||
|
@ -369,19 +369,22 @@ async def claim_cmd(args: dict, wallet_client: WalletRpcClient, fingerprint: int
|
||||
async def change_payout_instructions(launcher_id: str, address: str) -> None:
|
||||
new_pool_configs: List[PoolWalletConfig] = []
|
||||
id_found = False
|
||||
if decode_puzzle_hash(address):
|
||||
old_configs: List[PoolWalletConfig] = load_pool_config(DEFAULT_ROOT_PATH)
|
||||
for pool_config in old_configs:
|
||||
if pool_config.launcher_id == hexstr_to_bytes(launcher_id):
|
||||
id_found = True
|
||||
pool_config = replace(pool_config, payout_instructions=decode_puzzle_hash(address).hex())
|
||||
new_pool_configs.append(pool_config)
|
||||
if id_found:
|
||||
print(f"Launcher Id: {launcher_id} Found, Updating Config.")
|
||||
await update_pool_config(DEFAULT_ROOT_PATH, new_pool_configs)
|
||||
print(f"Payout Instructions for launcher id: {launcher_id} successfully updated to: {address}.")
|
||||
print(f"You will need to change the payout instructions on every device you use to: {address}.")
|
||||
else:
|
||||
print(f"Launcher Id: {launcher_id} Not found.")
|
||||
else:
|
||||
try:
|
||||
puzzle_hash = decode_puzzle_hash(address)
|
||||
except ValueError:
|
||||
print(f"Invalid Address: {address}")
|
||||
return
|
||||
|
||||
old_configs: List[PoolWalletConfig] = load_pool_config(DEFAULT_ROOT_PATH)
|
||||
for pool_config in old_configs:
|
||||
if pool_config.launcher_id == hexstr_to_bytes(launcher_id):
|
||||
id_found = True
|
||||
pool_config = replace(pool_config, payout_instructions=puzzle_hash.hex())
|
||||
new_pool_configs.append(pool_config)
|
||||
if id_found:
|
||||
print(f"Launcher Id: {launcher_id} Found, Updating Config.")
|
||||
await update_pool_config(DEFAULT_ROOT_PATH, new_pool_configs)
|
||||
print(f"Payout Instructions for launcher id: {launcher_id} successfully updated to: {address}.")
|
||||
print(f"You will need to change the payout instructions on every device you use to: {address}.")
|
||||
else:
|
||||
print(f"Launcher Id: {launcher_id} Not found.")
|
||||
|
@ -152,7 +152,10 @@ def create_cmd(
|
||||
|
||||
asyncio.run(create_plots(Params(), plot_keys))
|
||||
if not exclude_final_dir:
|
||||
add_plot_directory(root_path, final_dir)
|
||||
try:
|
||||
add_plot_directory(root_path, final_dir)
|
||||
except ValueError as e:
|
||||
print(e)
|
||||
|
||||
|
||||
@plots_cmd.command("check", short_help="Checks plots")
|
||||
@ -189,7 +192,11 @@ def check_cmd(
|
||||
def add_cmd(ctx: click.Context, final_dir: str):
|
||||
from chia.plotting.util import add_plot_directory
|
||||
|
||||
add_plot_directory(ctx.obj["root_path"], final_dir)
|
||||
try:
|
||||
add_plot_directory(ctx.obj["root_path"], final_dir)
|
||||
print(f"Successfully added: {final_dir}")
|
||||
except ValueError as e:
|
||||
print(e)
|
||||
|
||||
|
||||
@plots_cmd.command("remove", short_help="Removes a directory of plots from config.yaml")
|
||||
|
@ -10,7 +10,7 @@ from chia.util.config import load_config
|
||||
from chia.util.default_root import DEFAULT_ROOT_PATH
|
||||
from chia.util.ints import uint16
|
||||
|
||||
services: List[str] = ["crawler", "farmer", "full_node", "harvester", "timelord", "wallet"]
|
||||
services: List[str] = ["crawler", "farmer", "full_node", "harvester", "timelord", "wallet", "data_layer"]
|
||||
|
||||
|
||||
async def call_endpoint(service: str, endpoint: str, request: Dict[str, Any], config: Dict[str, Any]) -> Dict[str, Any]:
|
||||
|
@ -1,13 +1,15 @@
|
||||
from typing import Any, Optional, Union, Dict
|
||||
from typing import Any, Callable, Dict, List, Optional, Union
|
||||
|
||||
from chia.types.blockchain_format.sized_bytes import bytes32
|
||||
import click
|
||||
|
||||
from chia.util.network import is_trusted_inner
|
||||
|
||||
async def print_connections(node_client, trusted_peers: Dict):
|
||||
import time
|
||||
|
||||
async def print_connections(client, time, NodeType, trusted_peers: Dict):
|
||||
connections = await client.get_connections()
|
||||
from chia.server.outbound_message import NodeType
|
||||
from chia.util.network import is_trusted_inner
|
||||
|
||||
connections = await node_client.get_connections()
|
||||
print("Connections:")
|
||||
print("Type IP Ports NodeID Last Connect" + " MiB Up|Dwn")
|
||||
for con in connections:
|
||||
@ -57,236 +59,270 @@ async def print_connections(client, time, NodeType, trusted_peers: Dict):
|
||||
print(con_str)
|
||||
|
||||
|
||||
async def show_async(
|
||||
rpc_port: Optional[int],
|
||||
state: bool,
|
||||
show_connections: bool,
|
||||
exit_node: bool,
|
||||
add_connection: str,
|
||||
remove_connection: str,
|
||||
block_header_hash_by_height: str,
|
||||
block_by_header_hash: str,
|
||||
) -> None:
|
||||
import aiohttp
|
||||
import traceback
|
||||
async def print_blockchain_state(node_client, config: Dict):
|
||||
# node_client is FullNodeRpcClient
|
||||
import time
|
||||
from typing import List, Optional
|
||||
|
||||
from chia.consensus.block_record import BlockRecord
|
||||
from chia.rpc.full_node_rpc_client import FullNodeRpcClient
|
||||
from chia.server.outbound_message import NodeType
|
||||
from chia.util.ints import uint64
|
||||
from chia.util.misc import format_bytes
|
||||
|
||||
blockchain_state = await node_client.get_blockchain_state()
|
||||
if blockchain_state is None:
|
||||
print("There is no blockchain found yet. Try again shortly")
|
||||
return True
|
||||
peak: Optional[BlockRecord] = blockchain_state["peak"]
|
||||
node_id = blockchain_state["node_id"]
|
||||
difficulty = blockchain_state["difficulty"]
|
||||
sub_slot_iters = blockchain_state["sub_slot_iters"]
|
||||
synced = blockchain_state["sync"]["synced"]
|
||||
sync_mode = blockchain_state["sync"]["sync_mode"]
|
||||
total_iters = peak.total_iters if peak is not None else 0
|
||||
num_blocks: int = 10
|
||||
network_name = config["selected_network"]
|
||||
genesis_challenge = config["farmer"]["network_overrides"]["constants"][network_name]["GENESIS_CHALLENGE"]
|
||||
full_node_port = config["full_node"]["port"]
|
||||
full_node_rpc_port = config["full_node"]["rpc_port"]
|
||||
|
||||
print(f"Network: {network_name} Port: {full_node_port} RPC Port: {full_node_rpc_port}")
|
||||
print(f"Node ID: {node_id}")
|
||||
print(f"Genesis Challenge: {genesis_challenge}")
|
||||
|
||||
if synced:
|
||||
print("Current Blockchain Status: Full Node Synced")
|
||||
print("\nPeak: Hash:", peak.header_hash if peak is not None else "")
|
||||
elif peak is not None and sync_mode:
|
||||
sync_max_block = blockchain_state["sync"]["sync_tip_height"]
|
||||
sync_current_block = blockchain_state["sync"]["sync_progress_height"]
|
||||
print(
|
||||
f"Current Blockchain Status: Syncing {sync_current_block}/{sync_max_block} "
|
||||
f"({sync_max_block - sync_current_block} behind)."
|
||||
)
|
||||
print("Peak: Hash:", peak.header_hash if peak is not None else "")
|
||||
elif peak is not None:
|
||||
print(f"Current Blockchain Status: Not Synced. Peak height: {peak.height}")
|
||||
else:
|
||||
print("\nSearching for an initial chain\n")
|
||||
print("You may be able to expedite with 'chia show -a host:port' using a known node.\n")
|
||||
|
||||
if peak is not None:
|
||||
if peak.is_transaction_block:
|
||||
peak_time = peak.timestamp
|
||||
else:
|
||||
peak_hash = peak.header_hash
|
||||
curr = await node_client.get_block_record(peak_hash)
|
||||
while curr is not None and not curr.is_transaction_block:
|
||||
curr = await node_client.get_block_record(curr.prev_hash)
|
||||
if curr is not None:
|
||||
peak_time = curr.timestamp
|
||||
else:
|
||||
peak_time = uint64(0)
|
||||
peak_time_struct = time.struct_time(time.localtime(peak_time))
|
||||
|
||||
print(
|
||||
" Time:",
|
||||
f"{time.strftime('%a %b %d %Y %T %Z', peak_time_struct)}",
|
||||
f" Height: {peak.height:>10}\n",
|
||||
)
|
||||
|
||||
print("Estimated network space: ", end="")
|
||||
print(format_bytes(blockchain_state["space"]))
|
||||
print(f"Current difficulty: {difficulty}")
|
||||
print(f"Current VDF sub_slot_iters: {sub_slot_iters}")
|
||||
print("Total iterations since the start of the blockchain:", total_iters)
|
||||
print("\n Height: | Hash:")
|
||||
|
||||
added_blocks: List[BlockRecord] = []
|
||||
curr = await node_client.get_block_record(peak.header_hash)
|
||||
while curr is not None and len(added_blocks) < num_blocks and curr.height > 0:
|
||||
added_blocks.append(curr)
|
||||
curr = await node_client.get_block_record(curr.prev_hash)
|
||||
|
||||
for b in added_blocks:
|
||||
print(f"{b.height:>9} | {b.header_hash}")
|
||||
else:
|
||||
print("Blockchain has no blocks yet")
|
||||
|
||||
|
||||
async def print_block_from_hash(node_client, config: Dict, block_by_header_hash: str):
|
||||
import time
|
||||
|
||||
from chia.consensus.block_record import BlockRecord
|
||||
from chia.types.blockchain_format.sized_bytes import bytes32
|
||||
from chia.types.full_block import FullBlock
|
||||
from chia.util.bech32m import encode_puzzle_hash
|
||||
from chia.util.byte_types import hexstr_to_bytes
|
||||
|
||||
block: Optional[BlockRecord] = await node_client.get_block_record(hexstr_to_bytes(block_by_header_hash))
|
||||
full_block: Optional[FullBlock] = await node_client.get_block(hexstr_to_bytes(block_by_header_hash))
|
||||
# Would like to have a verbose flag for this
|
||||
if block is not None:
|
||||
assert full_block is not None
|
||||
prev_b = await node_client.get_block_record(block.prev_hash)
|
||||
if prev_b is not None:
|
||||
difficulty = block.weight - prev_b.weight
|
||||
else:
|
||||
difficulty = block.weight
|
||||
if block.is_transaction_block:
|
||||
assert full_block.transactions_info is not None
|
||||
block_time = time.struct_time(
|
||||
time.localtime(
|
||||
full_block.foliage_transaction_block.timestamp if full_block.foliage_transaction_block else None
|
||||
)
|
||||
)
|
||||
block_time_string = time.strftime("%a %b %d %Y %T %Z", block_time)
|
||||
cost = str(full_block.transactions_info.cost)
|
||||
tx_filter_hash: Union[str, bytes32] = "Not a transaction block"
|
||||
if full_block.foliage_transaction_block:
|
||||
tx_filter_hash = full_block.foliage_transaction_block.filter_hash
|
||||
fees: Any = block.fees
|
||||
else:
|
||||
block_time_string = "Not a transaction block"
|
||||
cost = "Not a transaction block"
|
||||
tx_filter_hash = "Not a transaction block"
|
||||
fees = "Not a transaction block"
|
||||
address_prefix = config["network_overrides"]["config"][config["selected_network"]]["address_prefix"]
|
||||
farmer_address = encode_puzzle_hash(block.farmer_puzzle_hash, address_prefix)
|
||||
pool_address = encode_puzzle_hash(block.pool_puzzle_hash, address_prefix)
|
||||
pool_pk = (
|
||||
full_block.reward_chain_block.proof_of_space.pool_public_key
|
||||
if full_block.reward_chain_block.proof_of_space.pool_public_key is not None
|
||||
else "Pay to pool puzzle hash"
|
||||
)
|
||||
print(
|
||||
f"Block Height {block.height}\n"
|
||||
f"Header Hash 0x{block.header_hash.hex()}\n"
|
||||
f"Timestamp {block_time_string}\n"
|
||||
f"Weight {block.weight}\n"
|
||||
f"Previous Block 0x{block.prev_hash.hex()}\n"
|
||||
f"Difficulty {difficulty}\n"
|
||||
f"Sub-slot iters {block.sub_slot_iters}\n"
|
||||
f"Cost {cost}\n"
|
||||
f"Total VDF Iterations {block.total_iters}\n"
|
||||
f"Is a Transaction Block?{block.is_transaction_block}\n"
|
||||
f"Deficit {block.deficit}\n"
|
||||
f"PoSpace 'k' Size {full_block.reward_chain_block.proof_of_space.size}\n"
|
||||
f"Plot Public Key 0x{full_block.reward_chain_block.proof_of_space.plot_public_key}\n"
|
||||
f"Pool Public Key {pool_pk}\n"
|
||||
f"Tx Filter Hash {tx_filter_hash}\n"
|
||||
f"Farmer Address {farmer_address}\n"
|
||||
f"Pool Address {pool_address}\n"
|
||||
f"Fees Amount {fees}\n"
|
||||
)
|
||||
else:
|
||||
print("Block with header hash", block_by_header_hash, "not found")
|
||||
|
||||
|
||||
async def add_node_connection(node_client, add_connection: str):
|
||||
if ":" not in add_connection:
|
||||
print("Enter a valid IP and port in the following format: 10.5.4.3:8000")
|
||||
else:
|
||||
ip, port = (
|
||||
":".join(add_connection.split(":")[:-1]),
|
||||
add_connection.split(":")[-1],
|
||||
)
|
||||
print(f"Connecting to {ip}, {port}")
|
||||
try:
|
||||
await node_client.open_connection(ip, int(port))
|
||||
except Exception:
|
||||
print(f"Failed to connect to {ip}:{port}")
|
||||
|
||||
|
||||
async def remove_node_connection(node_client, remove_connection: str):
|
||||
from chia.server.outbound_message import NodeType
|
||||
|
||||
result_txt = ""
|
||||
if len(remove_connection) != 8:
|
||||
result_txt = "Invalid NodeID. Do not include '.'"
|
||||
else:
|
||||
connections = await node_client.get_connections()
|
||||
for con in connections:
|
||||
if remove_connection == con["node_id"].hex()[:8]:
|
||||
print("Attempting to disconnect", "NodeID", remove_connection)
|
||||
try:
|
||||
await node_client.close_connection(con["node_id"])
|
||||
except Exception:
|
||||
result_txt = f"Failed to disconnect NodeID {remove_connection}"
|
||||
else:
|
||||
result_txt = f"NodeID {remove_connection}... {NodeType(con['type']).name} "
|
||||
f"{con['peer_host']} disconnected"
|
||||
elif result_txt == "":
|
||||
result_txt = f"NodeID {remove_connection}... not found"
|
||||
print(result_txt)
|
||||
|
||||
|
||||
async def execute_with_node(rpc_port: Optional[int], function: Callable, *args):
|
||||
import traceback
|
||||
|
||||
from aiohttp import ClientConnectorError
|
||||
|
||||
from chia.rpc.full_node_rpc_client import FullNodeRpcClient
|
||||
from chia.util.config import load_config
|
||||
from chia.util.default_root import DEFAULT_ROOT_PATH
|
||||
from chia.util.ints import uint16
|
||||
from chia.util.misc import format_bytes
|
||||
|
||||
config = load_config(DEFAULT_ROOT_PATH, "config.yaml")
|
||||
self_hostname = config["self_hostname"]
|
||||
if rpc_port is None:
|
||||
rpc_port = config["full_node"]["rpc_port"]
|
||||
try:
|
||||
config = load_config(DEFAULT_ROOT_PATH, "config.yaml")
|
||||
self_hostname = config["self_hostname"]
|
||||
if rpc_port is None:
|
||||
rpc_port = config["full_node"]["rpc_port"]
|
||||
client = await FullNodeRpcClient.create(self_hostname, uint16(rpc_port), DEFAULT_ROOT_PATH, config)
|
||||
|
||||
if state:
|
||||
blockchain_state = await client.get_blockchain_state()
|
||||
if blockchain_state is None:
|
||||
print("There is no blockchain found yet. Try again shortly")
|
||||
return None
|
||||
peak: Optional[BlockRecord] = blockchain_state["peak"]
|
||||
node_id = blockchain_state["node_id"]
|
||||
difficulty = blockchain_state["difficulty"]
|
||||
sub_slot_iters = blockchain_state["sub_slot_iters"]
|
||||
synced = blockchain_state["sync"]["synced"]
|
||||
sync_mode = blockchain_state["sync"]["sync_mode"]
|
||||
total_iters = peak.total_iters if peak is not None else 0
|
||||
num_blocks: int = 10
|
||||
network_name = config["selected_network"]
|
||||
genesis_challenge = config["farmer"]["network_overrides"]["constants"][network_name]["GENESIS_CHALLENGE"]
|
||||
full_node_port = config["full_node"]["port"]
|
||||
full_node_rpc_port = config["full_node"]["rpc_port"]
|
||||
|
||||
print(f"Network: {network_name} Port: {full_node_port} RPC Port: {full_node_rpc_port}")
|
||||
print(f"Node ID: {node_id}")
|
||||
|
||||
print(f"Genesis Challenge: {genesis_challenge}")
|
||||
|
||||
if synced:
|
||||
print("Current Blockchain Status: Full Node Synced")
|
||||
print("\nPeak: Hash:", peak.header_hash if peak is not None else "")
|
||||
elif peak is not None and sync_mode:
|
||||
sync_max_block = blockchain_state["sync"]["sync_tip_height"]
|
||||
sync_current_block = blockchain_state["sync"]["sync_progress_height"]
|
||||
print(
|
||||
f"Current Blockchain Status: Syncing {sync_current_block}/{sync_max_block} "
|
||||
f"({sync_max_block - sync_current_block} behind)."
|
||||
)
|
||||
print("Peak: Hash:", peak.header_hash if peak is not None else "")
|
||||
elif peak is not None:
|
||||
print(f"Current Blockchain Status: Not Synced. Peak height: {peak.height}")
|
||||
else:
|
||||
print("\nSearching for an initial chain\n")
|
||||
print("You may be able to expedite with 'chia show -a host:port' using a known node.\n")
|
||||
|
||||
if peak is not None:
|
||||
if peak.is_transaction_block:
|
||||
peak_time = peak.timestamp
|
||||
else:
|
||||
peak_hash = peak.header_hash
|
||||
curr = await client.get_block_record(peak_hash)
|
||||
while curr is not None and not curr.is_transaction_block:
|
||||
curr = await client.get_block_record(curr.prev_hash)
|
||||
peak_time = curr.timestamp
|
||||
peak_time_struct = time.struct_time(time.localtime(peak_time))
|
||||
|
||||
print(
|
||||
" Time:",
|
||||
f"{time.strftime('%a %b %d %Y %T %Z', peak_time_struct)}",
|
||||
f" Height: {peak.height:>10}\n",
|
||||
)
|
||||
|
||||
print("Estimated network space: ", end="")
|
||||
print(format_bytes(blockchain_state["space"]))
|
||||
print(f"Current difficulty: {difficulty}")
|
||||
print(f"Current VDF sub_slot_iters: {sub_slot_iters}")
|
||||
print("Total iterations since the start of the blockchain:", total_iters)
|
||||
print("")
|
||||
print(" Height: | Hash:")
|
||||
|
||||
added_blocks: List[BlockRecord] = []
|
||||
curr = await client.get_block_record(peak.header_hash)
|
||||
while curr is not None and len(added_blocks) < num_blocks and curr.height > 0:
|
||||
added_blocks.append(curr)
|
||||
curr = await client.get_block_record(curr.prev_hash)
|
||||
|
||||
for b in added_blocks:
|
||||
print(f"{b.height:>9} | {b.header_hash}")
|
||||
else:
|
||||
print("Blockchain has no blocks yet")
|
||||
|
||||
# if called together with show_connections, leave a blank line
|
||||
if show_connections:
|
||||
print("")
|
||||
if show_connections:
|
||||
trusted_peers: Dict = config["full_node"].get("trusted_peers", {})
|
||||
await print_connections(client, time, NodeType, trusted_peers)
|
||||
# if called together with state, leave a blank line
|
||||
if state:
|
||||
print("")
|
||||
if exit_node:
|
||||
node_stop = await client.stop_node()
|
||||
print(node_stop, "Node stopped")
|
||||
if add_connection:
|
||||
if ":" not in add_connection:
|
||||
print("Enter a valid IP and port in the following format: 10.5.4.3:8000")
|
||||
else:
|
||||
ip, port = (
|
||||
":".join(add_connection.split(":")[:-1]),
|
||||
add_connection.split(":")[-1],
|
||||
)
|
||||
print(f"Connecting to {ip}, {port}")
|
||||
try:
|
||||
await client.open_connection(ip, int(port))
|
||||
except Exception:
|
||||
print(f"Failed to connect to {ip}:{port}")
|
||||
if remove_connection:
|
||||
result_txt = ""
|
||||
if len(remove_connection) != 8:
|
||||
result_txt = "Invalid NodeID. Do not include '.'"
|
||||
else:
|
||||
connections = await client.get_connections()
|
||||
for con in connections:
|
||||
if remove_connection == con["node_id"].hex()[:8]:
|
||||
print("Attempting to disconnect", "NodeID", remove_connection)
|
||||
try:
|
||||
await client.close_connection(con["node_id"])
|
||||
except Exception:
|
||||
result_txt = f"Failed to disconnect NodeID {remove_connection}"
|
||||
else:
|
||||
result_txt = f"NodeID {remove_connection}... {NodeType(con['type']).name} "
|
||||
f"{con['peer_host']} disconnected"
|
||||
elif result_txt == "":
|
||||
result_txt = f"NodeID {remove_connection}... not found"
|
||||
print(result_txt)
|
||||
if block_header_hash_by_height != "":
|
||||
block_header = await client.get_block_record_by_height(block_header_hash_by_height)
|
||||
if block_header is not None:
|
||||
print(f"Header hash of block {block_header_hash_by_height}: " f"{block_header.header_hash.hex()}")
|
||||
else:
|
||||
print("Block height", block_header_hash_by_height, "not found")
|
||||
if block_by_header_hash != "":
|
||||
block: Optional[BlockRecord] = await client.get_block_record(hexstr_to_bytes(block_by_header_hash))
|
||||
full_block: Optional[FullBlock] = await client.get_block(hexstr_to_bytes(block_by_header_hash))
|
||||
# Would like to have a verbose flag for this
|
||||
if block is not None:
|
||||
assert full_block is not None
|
||||
prev_b = await client.get_block_record(block.prev_hash)
|
||||
if prev_b is not None:
|
||||
difficulty = block.weight - prev_b.weight
|
||||
else:
|
||||
difficulty = block.weight
|
||||
if block.is_transaction_block:
|
||||
assert full_block.transactions_info is not None
|
||||
block_time = time.struct_time(
|
||||
time.localtime(
|
||||
full_block.foliage_transaction_block.timestamp
|
||||
if full_block.foliage_transaction_block
|
||||
else None
|
||||
)
|
||||
)
|
||||
block_time_string = time.strftime("%a %b %d %Y %T %Z", block_time)
|
||||
cost = str(full_block.transactions_info.cost)
|
||||
tx_filter_hash: Union[str, bytes32] = "Not a transaction block"
|
||||
if full_block.foliage_transaction_block:
|
||||
tx_filter_hash = full_block.foliage_transaction_block.filter_hash
|
||||
fees: Any = block.fees
|
||||
else:
|
||||
block_time_string = "Not a transaction block"
|
||||
cost = "Not a transaction block"
|
||||
tx_filter_hash = "Not a transaction block"
|
||||
fees = "Not a transaction block"
|
||||
address_prefix = config["network_overrides"]["config"][config["selected_network"]]["address_prefix"]
|
||||
farmer_address = encode_puzzle_hash(block.farmer_puzzle_hash, address_prefix)
|
||||
pool_address = encode_puzzle_hash(block.pool_puzzle_hash, address_prefix)
|
||||
pool_pk = (
|
||||
full_block.reward_chain_block.proof_of_space.pool_public_key
|
||||
if full_block.reward_chain_block.proof_of_space.pool_public_key is not None
|
||||
else "Pay to pool puzzle hash"
|
||||
)
|
||||
print(
|
||||
f"Block Height {block.height}\n"
|
||||
f"Header Hash 0x{block.header_hash.hex()}\n"
|
||||
f"Timestamp {block_time_string}\n"
|
||||
f"Weight {block.weight}\n"
|
||||
f"Previous Block 0x{block.prev_hash.hex()}\n"
|
||||
f"Difficulty {difficulty}\n"
|
||||
f"Sub-slot iters {block.sub_slot_iters}\n"
|
||||
f"Cost {cost}\n"
|
||||
f"Total VDF Iterations {block.total_iters}\n"
|
||||
f"Is a Transaction Block?{block.is_transaction_block}\n"
|
||||
f"Deficit {block.deficit}\n"
|
||||
f"PoSpace 'k' Size {full_block.reward_chain_block.proof_of_space.size}\n"
|
||||
f"Plot Public Key 0x{full_block.reward_chain_block.proof_of_space.plot_public_key}\n"
|
||||
f"Pool Public Key {pool_pk}\n"
|
||||
f"Tx Filter Hash {tx_filter_hash}\n"
|
||||
f"Farmer Address {farmer_address}\n"
|
||||
f"Pool Address {pool_address}\n"
|
||||
f"Fees Amount {fees}\n"
|
||||
)
|
||||
else:
|
||||
print("Block with header hash", block_header_hash_by_height, "not found")
|
||||
node_client: FullNodeRpcClient = await FullNodeRpcClient.create(
|
||||
self_hostname, uint16(rpc_port), DEFAULT_ROOT_PATH, config
|
||||
)
|
||||
await function(node_client, config, *args)
|
||||
|
||||
except Exception as e:
|
||||
if isinstance(e, aiohttp.ClientConnectorError):
|
||||
if isinstance(e, ClientConnectorError):
|
||||
print(f"Connection error. Check if full node rpc is running at {rpc_port}")
|
||||
print("This is normal if full node is still starting up")
|
||||
else:
|
||||
tb = traceback.format_exc()
|
||||
print(f"Exception from 'show' {tb}")
|
||||
|
||||
client.close()
|
||||
await client.await_closed()
|
||||
node_client.close()
|
||||
await node_client.await_closed()
|
||||
|
||||
|
||||
async def show_async(
|
||||
node_client,
|
||||
config: Dict,
|
||||
state: bool,
|
||||
show_connections: bool,
|
||||
add_connection: str,
|
||||
remove_connection: str,
|
||||
block_header_hash_by_height: str,
|
||||
block_by_header_hash: str,
|
||||
) -> None:
|
||||
|
||||
# Check State
|
||||
if state:
|
||||
if await print_blockchain_state(node_client, config) is True:
|
||||
return None # if no blockchain is found
|
||||
# if called together with show_connections, leave a blank line
|
||||
if show_connections:
|
||||
print("")
|
||||
|
||||
# Check or edit node connections
|
||||
if show_connections:
|
||||
trusted_peers: Dict = config["full_node"].get("trusted_peers", {})
|
||||
await print_connections(node_client, trusted_peers)
|
||||
# if called together with state, leave a blank line
|
||||
if state:
|
||||
print("")
|
||||
if add_connection:
|
||||
await add_node_connection(node_client, add_connection)
|
||||
if remove_connection:
|
||||
await remove_node_connection(node_client, remove_connection)
|
||||
|
||||
# Get Block Information
|
||||
if block_header_hash_by_height != "":
|
||||
block_header = await node_client.get_block_record_by_height(block_header_hash_by_height)
|
||||
if block_header is not None:
|
||||
print(f"Header hash of block {block_header_hash_by_height}: " f"{block_header.header_hash.hex()}")
|
||||
else:
|
||||
print("Block height", block_header_hash_by_height, "not found")
|
||||
if block_by_header_hash != "":
|
||||
await print_block_from_hash(node_client, config, block_by_header_hash)
|
||||
|
||||
|
||||
@click.command("show", short_help="Show node information")
|
||||
@ -311,7 +347,6 @@ async def show_async(
|
||||
@click.option(
|
||||
"-c", "--connections", help="List nodes connected to this Full Node", is_flag=True, type=bool, default=False
|
||||
)
|
||||
@click.option("-e", "--exit-node", help="Shut down the running Full Node", is_flag=True, default=False)
|
||||
@click.option("-a", "--add-connection", help="Connect to another Full Node by ip:port", type=str, default="")
|
||||
@click.option(
|
||||
"-r", "--remove-connection", help="Remove a Node by the first 8 characters of NodeID", type=str, default=""
|
||||
@ -325,7 +360,6 @@ def show_cmd(
|
||||
wallet_rpc_port: Optional[int],
|
||||
state: bool,
|
||||
connections: bool,
|
||||
exit_node: bool,
|
||||
add_connection: str,
|
||||
remove_connection: str,
|
||||
block_header_hash_by_height: str,
|
||||
@ -334,11 +368,11 @@ def show_cmd(
|
||||
import asyncio
|
||||
|
||||
asyncio.run(
|
||||
show_async(
|
||||
execute_with_node(
|
||||
rpc_port,
|
||||
show_async,
|
||||
state,
|
||||
connections,
|
||||
exit_node,
|
||||
add_connection,
|
||||
remove_connection,
|
||||
block_header_hash_by_height,
|
||||
|
@ -8,17 +8,16 @@ from typing import Any, Awaitable, Callable, Dict, List, Optional, Tuple, Union
|
||||
|
||||
import aiohttp
|
||||
|
||||
from chia.cmds.cmds_util import transaction_status_msg, transaction_submitted_msg
|
||||
from chia.cmds.show import print_connections
|
||||
from chia.cmds.units import units
|
||||
from chia.rpc.wallet_rpc_client import WalletRpcClient
|
||||
from chia.server.outbound_message import NodeType
|
||||
from chia.server.start_wallet import SERVICE_NAME
|
||||
from chia.types.blockchain_format.sized_bytes import bytes32
|
||||
from chia.util.bech32m import bech32_decode, decode_puzzle_hash, encode_puzzle_hash
|
||||
from chia.util.config import load_config
|
||||
from chia.util.default_root import DEFAULT_ROOT_PATH
|
||||
from chia.util.ints import uint16, uint32, uint64
|
||||
from chia.cmds.cmds_util import transaction_submitted_msg, transaction_status_msg
|
||||
from chia.wallet.did_wallet.did_info import DID_HRP
|
||||
from chia.wallet.nft_wallet.nft_info import NFT_HRP, NFTInfo
|
||||
from chia.wallet.trade_record import TradeRecord
|
||||
@ -236,7 +235,7 @@ async def send(args: dict, wallet_client: WalletRpcClient, fingerprint: int) ->
|
||||
return None
|
||||
|
||||
print("Transaction not yet submitted to nodes")
|
||||
print(f"Do 'chia wallet get_transaction -f {fingerprint} -tx 0x{tx_id}' to get status")
|
||||
print(f"To get status, use command: chia wallet get_transaction -f {fingerprint} -tx 0x{tx_id}")
|
||||
|
||||
|
||||
async def get_address(args: dict, wallet_client: WalletRpcClient, fingerprint: int) -> None:
|
||||
@ -617,7 +616,7 @@ async def print_balances(args: dict, wallet_client: WalletRpcClient, fingerprint
|
||||
|
||||
print(" ")
|
||||
trusted_peers: Dict = config["wallet"].get("trusted_peers", {})
|
||||
await print_connections(wallet_client, time, NodeType, trusted_peers)
|
||||
await print_connections(wallet_client, trusted_peers)
|
||||
|
||||
|
||||
async def get_wallet(wallet_client: WalletRpcClient, fingerprint: int = None) -> Optional[Tuple[WalletRpcClient, int]]:
|
||||
|
@ -211,10 +211,10 @@ async def validate_block_body(
|
||||
assert npc_result.conds is not None
|
||||
|
||||
for spend in npc_result.conds.spends:
|
||||
removals.append(spend.coin_id)
|
||||
removals_puzzle_dic[spend.coin_id] = spend.puzzle_hash
|
||||
removals.append(bytes32(spend.coin_id))
|
||||
removals_puzzle_dic[bytes32(spend.coin_id)] = bytes32(spend.puzzle_hash)
|
||||
for puzzle_hash, amount, _ in spend.create_coin:
|
||||
c = Coin(spend.coin_id, puzzle_hash, uint64(amount))
|
||||
c = Coin(bytes32(spend.coin_id), bytes32(puzzle_hash), uint64(amount))
|
||||
additions.append((c, c.name()))
|
||||
else:
|
||||
assert npc_result is None
|
||||
@ -431,7 +431,7 @@ async def validate_block_body(
|
||||
assert_fee_sum: uint64 = uint64(0)
|
||||
if npc_result:
|
||||
assert npc_result.conds is not None
|
||||
assert_fee_sum = npc_result.conds.reserve_fee
|
||||
assert_fee_sum = uint64(npc_result.conds.reserve_fee)
|
||||
|
||||
# 17. Check that the assert fee sum <= fees, and that each reserved fee is non-negative
|
||||
if fees < assert_fee_sum:
|
||||
|
@ -8,7 +8,7 @@ from concurrent.futures.process import ProcessPoolExecutor
|
||||
from enum import Enum
|
||||
from multiprocessing.context import BaseContext
|
||||
from pathlib import Path
|
||||
from typing import Any, Dict, List, Optional, Set, Tuple
|
||||
from typing import Dict, List, Optional, Set, Tuple
|
||||
|
||||
from chia.consensus.block_body_validation import validate_block_body
|
||||
from chia.consensus.block_header_validation import validate_unfinished_header_block
|
||||
@ -48,7 +48,6 @@ from chia.util.generator_tools import get_block_header, tx_removals_and_addition
|
||||
from chia.util.inline_executor import InlineExecutor
|
||||
from chia.util.ints import uint16, uint32, uint64, uint128
|
||||
from chia.util.setproctitle import getproctitle, setproctitle
|
||||
from chia.util.streamable import recurse_jsonify
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@ -78,7 +77,6 @@ class StateChangeSummary:
|
||||
|
||||
class Blockchain(BlockchainInterface):
|
||||
constants: ConsensusConstants
|
||||
constants_json: Dict[str, Any]
|
||||
|
||||
# peak of the blockchain
|
||||
_peak_height: Optional[uint32]
|
||||
@ -144,7 +142,6 @@ class Blockchain(BlockchainInterface):
|
||||
self.constants = consensus_constants
|
||||
self.coin_store = coin_store
|
||||
self.block_store = block_store
|
||||
self.constants_json = recurse_jsonify(self.constants)
|
||||
self._shut_down = False
|
||||
await self._load_chain_from_store(blockchain_dir)
|
||||
self._seen_compact_proofs = set()
|
||||
@ -296,8 +293,8 @@ class Blockchain(BlockchainInterface):
|
||||
)
|
||||
raise
|
||||
|
||||
# This is done outside the try-except in case it fails, since we do not want to revert anything if it does
|
||||
await self.__height_map.maybe_flush()
|
||||
# This is done outside the try-except in case it fails, since we do not want to revert anything if it does
|
||||
await self.__height_map.maybe_flush()
|
||||
|
||||
if state_change_summary is not None:
|
||||
# new coin records added
|
||||
@ -608,7 +605,6 @@ class Blockchain(BlockchainInterface):
|
||||
) -> List[PreValidationResult]:
|
||||
return await pre_validate_blocks_multiprocessing(
|
||||
self.constants,
|
||||
self.constants_json,
|
||||
self,
|
||||
blocks,
|
||||
self.pool,
|
||||
@ -624,7 +620,7 @@ class Blockchain(BlockchainInterface):
|
||||
task = asyncio.get_running_loop().run_in_executor(
|
||||
self.pool,
|
||||
_run_generator,
|
||||
self.constants_json,
|
||||
self.constants,
|
||||
unfinished_block,
|
||||
bytes(generator),
|
||||
height,
|
||||
|
@ -3,7 +3,7 @@ import logging
|
||||
import traceback
|
||||
from concurrent.futures import Executor
|
||||
from dataclasses import dataclass
|
||||
from typing import Any, Awaitable, Callable, Dict, List, Optional, Sequence, Tuple
|
||||
from typing import Awaitable, Callable, Dict, List, Optional, Sequence, Tuple
|
||||
|
||||
from blspy import AugSchemeMPL, G1Element
|
||||
|
||||
@ -30,7 +30,7 @@ from chia.util.condition_tools import pkm_pairs
|
||||
from chia.util.errors import Err, ValidationError
|
||||
from chia.util.generator_tools import get_block_header, tx_removals_and_additions
|
||||
from chia.util.ints import uint16, uint32, uint64
|
||||
from chia.util.streamable import Streamable, dataclass_from_dict, streamable
|
||||
from chia.util.streamable import Streamable, streamable
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@ -45,7 +45,7 @@ class PreValidationResult(Streamable):
|
||||
|
||||
|
||||
def batch_pre_validate_blocks(
|
||||
constants_dict: Dict[str, Any],
|
||||
constants: ConsensusConstants,
|
||||
blocks_pickled: Dict[bytes, bytes],
|
||||
full_blocks_pickled: Optional[List[bytes]],
|
||||
header_blocks_pickled: Optional[List[bytes]],
|
||||
@ -60,7 +60,6 @@ def batch_pre_validate_blocks(
|
||||
for k, v in blocks_pickled.items():
|
||||
blocks[bytes32(k)] = BlockRecord.from_bytes(v)
|
||||
results: List[PreValidationResult] = []
|
||||
constants: ConsensusConstants = dataclass_from_dict(ConsensusConstants, constants_dict)
|
||||
if full_blocks_pickled is not None and header_blocks_pickled is not None:
|
||||
assert ValueError("Only one should be passed here")
|
||||
|
||||
@ -164,7 +163,6 @@ def batch_pre_validate_blocks(
|
||||
|
||||
async def pre_validate_blocks_multiprocessing(
|
||||
constants: ConsensusConstants,
|
||||
constants_json: Dict[str, Any],
|
||||
block_records: BlockchainInterface,
|
||||
blocks: Sequence[FullBlock],
|
||||
pool: Executor,
|
||||
@ -183,7 +181,7 @@ async def pre_validate_blocks_multiprocessing(
|
||||
|
||||
Args:
|
||||
check_filter:
|
||||
constants_json:
|
||||
constants:
|
||||
pool:
|
||||
constants:
|
||||
block_records:
|
||||
@ -344,7 +342,7 @@ async def pre_validate_blocks_multiprocessing(
|
||||
asyncio.get_running_loop().run_in_executor(
|
||||
pool,
|
||||
batch_pre_validate_blocks,
|
||||
constants_json,
|
||||
constants,
|
||||
final_pickled,
|
||||
b_pickled,
|
||||
hb_pickled,
|
||||
@ -365,7 +363,7 @@ async def pre_validate_blocks_multiprocessing(
|
||||
|
||||
|
||||
def _run_generator(
|
||||
constants_dict: bytes,
|
||||
constants: ConsensusConstants,
|
||||
unfinished_block_bytes: bytes,
|
||||
block_generator_bytes: bytes,
|
||||
height: uint32,
|
||||
@ -375,7 +373,6 @@ def _run_generator(
|
||||
validate the heavy parts of a block (clvm program) in a different process.
|
||||
"""
|
||||
try:
|
||||
constants: ConsensusConstants = dataclass_from_dict(ConsensusConstants, constants_dict)
|
||||
unfinished_block: UnfinishedBlock = UnfinishedBlock.from_bytes(unfinished_block_bytes)
|
||||
assert unfinished_block.transactions_info is not None
|
||||
block_generator: BlockGenerator = BlockGenerator.from_bytes(block_generator_bytes)
|
||||
|
@ -34,7 +34,6 @@ from chia.util.keychain import (
|
||||
supports_keyring_passphrase,
|
||||
supports_os_passphrase_storage,
|
||||
)
|
||||
from chia.util.path import mkdir
|
||||
from chia.util.service_groups import validate_service
|
||||
from chia.util.setproctitle import setproctitle
|
||||
from chia.util.ws_message import WsRpcMessage, create_payload, format_response
|
||||
@ -893,7 +892,10 @@ class WebSocketServer:
|
||||
exclude_final_dir: bool = job["exclude_final_dir"]
|
||||
log.info(f"Post-processing plotter job with ID {id}") # lgtm [py/clear-text-logging-sensitive-data]
|
||||
if not exclude_final_dir:
|
||||
add_plot_directory(self.root_path, final_dir)
|
||||
try:
|
||||
add_plot_directory(self.root_path, final_dir)
|
||||
except ValueError as e:
|
||||
log.warning(f"_post_process_plotting_job: {e}")
|
||||
|
||||
async def _start_plotting(self, id: str, loop: asyncio.AbstractEventLoop, queue: str = "default"):
|
||||
current_process = None
|
||||
@ -1232,7 +1234,7 @@ def launch_plotter(root_path: Path, service_name: str, service_array: List[str],
|
||||
if plotter_path.exists():
|
||||
plotter_path.unlink()
|
||||
else:
|
||||
mkdir(plotter_path.parent)
|
||||
plotter_path.parent.mkdir(parents=True, exist_ok=True)
|
||||
outfile = open(plotter_path.resolve(), "w")
|
||||
log.info(f"Service array: {service_array}") # lgtm [py/clear-text-logging-sensitive-data]
|
||||
process = subprocess.Popen(
|
||||
@ -1246,7 +1248,7 @@ def launch_plotter(root_path: Path, service_name: str, service_array: List[str],
|
||||
|
||||
pid_path = pid_path_for_service(root_path, service_name, id)
|
||||
try:
|
||||
mkdir(pid_path.parent)
|
||||
pid_path.parent.mkdir(parents=True, exist_ok=True)
|
||||
with open(pid_path, "w") as f:
|
||||
f.write(f"{process.pid}\n")
|
||||
except Exception:
|
||||
@ -1293,7 +1295,7 @@ def launch_service(root_path: Path, service_command) -> Tuple[subprocess.Popen,
|
||||
)
|
||||
pid_path = pid_path_for_service(root_path, service_command)
|
||||
try:
|
||||
mkdir(pid_path.parent)
|
||||
pid_path.parent.mkdir(parents=True, exist_ok=True)
|
||||
with open(pid_path, "w") as f:
|
||||
f.write(f"{process.pid}\n")
|
||||
except Exception:
|
||||
@ -1359,7 +1361,7 @@ def singleton(lockfile: Path, text: str = "semaphore") -> Optional[TextIO]:
|
||||
"""
|
||||
|
||||
if not lockfile.parent.exists():
|
||||
mkdir(lockfile.parent)
|
||||
lockfile.parent.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
try:
|
||||
if has_fcntl:
|
||||
|
@ -6,7 +6,7 @@ import time
|
||||
import traceback
|
||||
import asyncio
|
||||
import aiohttp
|
||||
from chia.data_layer.data_layer_types import InternalNode, TerminalNode, Subscription, DiffData
|
||||
from chia.data_layer.data_layer_util import InternalNode, TerminalNode, Subscription, DiffData, Status, Root
|
||||
from chia.data_layer.data_store import DataStore
|
||||
from chia.rpc.wallet_rpc_client import WalletRpcClient
|
||||
from chia.server.server import ChiaServer
|
||||
@ -14,7 +14,7 @@ from chia.types.blockchain_format.sized_bytes import bytes32
|
||||
from chia.util.config import load_config
|
||||
from chia.util.db_wrapper import DBWrapper
|
||||
from chia.util.ints import uint32, uint64
|
||||
from chia.util.path import mkdir, path_from_root
|
||||
from chia.util.path import path_from_root
|
||||
from chia.wallet.transaction_record import TransactionRecord
|
||||
from chia.data_layer.data_layer_wallet import SingletonRecord
|
||||
from chia.data_layer.download_data import insert_from_delta_file, write_files_for_root
|
||||
@ -35,6 +35,7 @@ class DataLayer:
|
||||
wallet_id: uint64
|
||||
initialized: bool
|
||||
none_bytes: bytes32
|
||||
lock: asyncio.Lock
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
@ -55,14 +56,15 @@ class DataLayer:
|
||||
self._shut_down: bool = False
|
||||
db_path_replaced: str = config["database_path"].replace("CHALLENGE", config["selected_network"])
|
||||
self.db_path = path_from_root(root_path, db_path_replaced)
|
||||
mkdir(self.db_path.parent)
|
||||
self.db_path.parent.mkdir(parents=True, exist_ok=True)
|
||||
server_files_replaced: str = config.get(
|
||||
"server_files_location", "data_layer/db/server_files_location_CHALLENGE"
|
||||
).replace("CHALLENGE", config["selected_network"])
|
||||
self.server_files_location = path_from_root(root_path, server_files_replaced)
|
||||
mkdir(self.server_files_location)
|
||||
self.server_files_location.mkdir(parents=True, exist_ok=True)
|
||||
self.data_layer_server = DataLayerServer(root_path, self.config, self.log)
|
||||
self.none_bytes = bytes32([0] * 32)
|
||||
self.lock = asyncio.Lock()
|
||||
|
||||
def _set_state_changed_callback(self, callback: Callable[..., object]) -> None:
|
||||
self.state_changed_callback = callback
|
||||
@ -112,23 +114,34 @@ class DataLayer:
|
||||
changelist: List[Dict[str, Any]],
|
||||
fee: uint64,
|
||||
) -> TransactionRecord:
|
||||
# Make sure we update based on the latest confirmed root.
|
||||
async with self.lock:
|
||||
await self._update_confirmation_status(tree_id=tree_id)
|
||||
pending_root: Optional[Root] = await self.data_store.get_pending_root(tree_id=tree_id)
|
||||
if pending_root is not None:
|
||||
raise Exception("Already have a pending root waiting for confirmation.")
|
||||
|
||||
# check before any DL changes that this singleton is currently owned by this wallet
|
||||
singleton_records: List[SingletonRecord] = await self.get_owned_stores()
|
||||
if not any(tree_id == singleton.launcher_id for singleton in singleton_records):
|
||||
raise ValueError(f"Singleton with launcher ID {tree_id} is not owned by DL Wallet")
|
||||
|
||||
t1 = time.monotonic()
|
||||
await self.data_store.insert_batch(tree_id, changelist, lock=True)
|
||||
batch_hash = await self.data_store.insert_batch(tree_id, changelist, lock=True)
|
||||
t2 = time.monotonic()
|
||||
self.log.info(f"Data store batch update process time: {t2 - t1}.")
|
||||
root = await self.data_store.get_tree_root(tree_id=tree_id, lock=True)
|
||||
# todo return empty node hash from get_tree_root
|
||||
if root.node_hash is not None:
|
||||
node_hash = root.node_hash
|
||||
if batch_hash is not None:
|
||||
node_hash = batch_hash
|
||||
else:
|
||||
node_hash = self.none_bytes # todo change
|
||||
|
||||
transaction_record = await self.wallet_rpc.dl_update_root(tree_id, node_hash, fee)
|
||||
assert transaction_record
|
||||
# todo register callback to change status in data store
|
||||
# await self.data_store.change_root_status(root, Status.COMMITTED)
|
||||
return transaction_record
|
||||
|
||||
async def get_value(self, store_id: bytes32, key: bytes) -> Optional[bytes]:
|
||||
async with self.lock:
|
||||
await self._update_confirmation_status(tree_id=store_id)
|
||||
res = await self.data_store.get_node_by_key(tree_id=store_id, key=key)
|
||||
if res is None:
|
||||
self.log.error("Failed to fetch key")
|
||||
@ -136,6 +149,8 @@ class DataLayer:
|
||||
return res.value
|
||||
|
||||
async def get_keys_values(self, store_id: bytes32, root_hash: Optional[bytes32]) -> List[TerminalNode]:
|
||||
async with self.lock:
|
||||
await self._update_confirmation_status(tree_id=store_id)
|
||||
res = await self.data_store.get_keys_values(store_id, root_hash)
|
||||
if res is None:
|
||||
self.log.error("Failed to fetch keys values")
|
||||
@ -172,6 +187,61 @@ class DataLayer:
|
||||
prev = record
|
||||
return root_history
|
||||
|
||||
async def _update_confirmation_status(self, tree_id: bytes32) -> None:
|
||||
try:
|
||||
root = await self.data_store.get_tree_root(tree_id=tree_id)
|
||||
except asyncio.CancelledError:
|
||||
raise
|
||||
except Exception:
|
||||
root = None
|
||||
singleton_record: Optional[SingletonRecord] = await self.wallet_rpc.dl_latest_singleton(tree_id, True)
|
||||
if singleton_record is None:
|
||||
return
|
||||
if root is None:
|
||||
pending_root = await self.data_store.get_pending_root(tree_id=tree_id)
|
||||
if pending_root is not None:
|
||||
if pending_root.generation == 0 and pending_root.node_hash is None:
|
||||
await self.data_store.change_root_status(pending_root, Status.COMMITTED)
|
||||
await self.data_store.clear_pending_roots(tree_id=tree_id)
|
||||
return
|
||||
else:
|
||||
root = None
|
||||
if root is None:
|
||||
self.log.info(f"Don't have pending root for {tree_id}.")
|
||||
return
|
||||
if root.generation == singleton_record.generation:
|
||||
return
|
||||
if root.generation > singleton_record.generation:
|
||||
self.log.info(
|
||||
f"Local root ahead of chain root: {root.generation} {singleton_record.generation}. "
|
||||
"Maybe we're doing a batch update."
|
||||
)
|
||||
return
|
||||
wallet_history = await self.wallet_rpc.dl_history(
|
||||
launcher_id=tree_id,
|
||||
min_generation=uint32(root.generation + 1),
|
||||
max_generation=singleton_record.generation,
|
||||
)
|
||||
new_hashes = [record.root for record in reversed(wallet_history)]
|
||||
root_hash = self.none_bytes if root.node_hash is None else root.node_hash
|
||||
generation_shift = 0
|
||||
while len(new_hashes) > 0 and new_hashes[0] == root_hash:
|
||||
generation_shift += 1
|
||||
new_hashes.pop(0)
|
||||
if generation_shift > 0:
|
||||
await self.data_store.shift_root_generations(tree_id=tree_id, shift_size=generation_shift)
|
||||
else:
|
||||
expected_root_hash = None if new_hashes[0] == self.none_bytes else new_hashes[0]
|
||||
pending_root = await self.data_store.get_pending_root(tree_id=tree_id)
|
||||
if (
|
||||
pending_root is not None
|
||||
and pending_root.generation == root.generation + 1
|
||||
and pending_root.node_hash == expected_root_hash
|
||||
):
|
||||
await self.data_store.change_root_status(pending_root, Status.COMMITTED)
|
||||
await self.data_store.build_ancestor_table_for_latest_root(tree_id=tree_id)
|
||||
await self.data_store.clear_pending_roots(tree_id=tree_id)
|
||||
|
||||
async def fetch_and_validate(self, subscription: Subscription) -> None:
|
||||
tree_id = subscription.tree_id
|
||||
singleton_record: Optional[SingletonRecord] = await self.wallet_rpc.dl_latest_singleton(tree_id, True)
|
||||
@ -182,14 +252,18 @@ class DataLayer:
|
||||
self.log.info(f"Fetch data: No data on chain for {tree_id}.")
|
||||
return
|
||||
|
||||
async with self.lock:
|
||||
await self._update_confirmation_status(tree_id=tree_id)
|
||||
|
||||
if not await self.data_store.tree_id_exists(tree_id=tree_id):
|
||||
await self.data_store.create_tree(tree_id=tree_id)
|
||||
|
||||
for url in subscription.urls:
|
||||
root = await self.data_store.get_tree_root(tree_id=tree_id)
|
||||
if root.generation > singleton_record.generation:
|
||||
self.log.info(
|
||||
"Fetch data: local DL store is ahead of chain generation. "
|
||||
f"Most likely waiting for our batch update to be confirmed on chain. Tree ID: {tree_id}"
|
||||
f"Local root: {root}. Singleton: {singleton_record}"
|
||||
)
|
||||
break
|
||||
if root.generation == singleton_record.generation:
|
||||
@ -238,6 +312,9 @@ class DataLayer:
|
||||
if singleton_record is None:
|
||||
self.log.info(f"Upload files: no on-chain record for {tree_id}.")
|
||||
return
|
||||
async with self.lock:
|
||||
await self._update_confirmation_status(tree_id=tree_id)
|
||||
|
||||
root = await self.data_store.get_tree_root(tree_id=tree_id)
|
||||
publish_generation = min(singleton_record.generation, 0 if root is None else root.generation)
|
||||
# If we make some batch updates, which get confirmed to the chain, we need to create the files.
|
||||
|
@ -19,9 +19,8 @@ class DataLayerServer:
|
||||
self.port = self.config["host_port"]
|
||||
|
||||
# Setup UPnP for the data_layer_service port
|
||||
# hinting being addressed in https://github.com/Chia-Network/chia-blockchain/pull/11816
|
||||
self.upnp: UPnP = UPnP() # type: ignore[no-untyped-call]
|
||||
self.upnp.remap(self.port) # type: ignore[no-untyped-call]
|
||||
self.upnp: UPnP = UPnP()
|
||||
self.upnp.remap(self.port)
|
||||
|
||||
server_files_replaced: str = self.config.get(
|
||||
"server_files_location", "data_layer/db/server_files_location_CHALLENGE"
|
||||
@ -37,10 +36,9 @@ class DataLayerServer:
|
||||
self.log.info("Started Data Layer Server.")
|
||||
|
||||
async def stop(self) -> None:
|
||||
# hinting being addressed in https://github.com/Chia-Network/chia-blockchain/pull/11816
|
||||
self.upnp.release(self.port) # type: ignore[no-untyped-call]
|
||||
self.upnp.release(self.port)
|
||||
# this is a blocking call, waiting for the UPnP thread to exit
|
||||
self.upnp.shutdown() # type: ignore[no-untyped-call]
|
||||
self.upnp.shutdown()
|
||||
|
||||
self.log.info("Stopped Data Layer Server.")
|
||||
await self.runner.cleanup()
|
||||
|
@ -1,197 +0,0 @@
|
||||
from dataclasses import dataclass, field
|
||||
from enum import IntEnum
|
||||
from typing import Dict, List, Optional, Tuple, Type, Union
|
||||
|
||||
import aiosqlite as aiosqlite
|
||||
|
||||
from chia.types.blockchain_format.program import Program
|
||||
from chia.types.blockchain_format.sized_bytes import bytes32
|
||||
from chia.util.byte_types import hexstr_to_bytes
|
||||
from chia.util.streamable import Streamable, streamable
|
||||
|
||||
|
||||
class Status(IntEnum):
|
||||
PENDING = 1
|
||||
COMMITTED = 2
|
||||
|
||||
|
||||
class NodeType(IntEnum):
|
||||
# EMPTY = 0
|
||||
INTERNAL = 1
|
||||
TERMINAL = 2
|
||||
|
||||
|
||||
class Side(IntEnum):
|
||||
LEFT = 0
|
||||
RIGHT = 1
|
||||
|
||||
|
||||
class OperationType(IntEnum):
|
||||
INSERT = 0
|
||||
DELETE = 1
|
||||
|
||||
|
||||
class CommitState(IntEnum):
|
||||
OPEN = 0
|
||||
FINALIZED = 1
|
||||
ROLLED_BACK = 2
|
||||
|
||||
|
||||
Node = Union["TerminalNode", "InternalNode"]
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class TerminalNode:
|
||||
hash: bytes32
|
||||
# generation: int
|
||||
key: bytes
|
||||
value: bytes
|
||||
|
||||
atom: None = field(init=False, default=None)
|
||||
|
||||
@property
|
||||
def pair(self) -> Tuple[bytes32, bytes32]:
|
||||
return Program.to(self.key), Program.to(self.value)
|
||||
|
||||
# It is unclear how to properly satisfy the generic Row normally, let alone for
|
||||
# dict-like rows. https://github.com/python/typeshed/issues/8027
|
||||
@classmethod
|
||||
def from_row(cls, row: aiosqlite.Row) -> "TerminalNode": # type: ignore[type-arg]
|
||||
return cls(
|
||||
hash=bytes32.fromhex(row["hash"]),
|
||||
# generation=row["generation"],
|
||||
key=bytes.fromhex(row["key"]),
|
||||
value=bytes.fromhex(row["value"]),
|
||||
)
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class ProofOfInclusionLayer:
|
||||
other_hash_side: Side
|
||||
other_hash: bytes32
|
||||
combined_hash: bytes32
|
||||
|
||||
@classmethod
|
||||
def from_internal_node(
|
||||
cls,
|
||||
internal_node: "InternalNode",
|
||||
traversal_child_hash: bytes32,
|
||||
) -> "ProofOfInclusionLayer":
|
||||
return ProofOfInclusionLayer(
|
||||
other_hash_side=internal_node.other_child_side(hash=traversal_child_hash),
|
||||
other_hash=internal_node.other_child_hash(hash=traversal_child_hash),
|
||||
combined_hash=internal_node.hash,
|
||||
)
|
||||
|
||||
|
||||
other_side_to_bit = {Side.LEFT: 1, Side.RIGHT: 0}
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class ProofOfInclusion:
|
||||
node_hash: bytes32
|
||||
root_hash: bytes32
|
||||
# children before parents
|
||||
layers: List[ProofOfInclusionLayer]
|
||||
|
||||
def as_program(self) -> Program:
|
||||
sibling_sides = sum(
|
||||
other_side_to_bit[layer.other_hash_side] << index for index, layer in enumerate(self.layers)
|
||||
)
|
||||
sibling_hashes = [layer.other_hash for layer in self.layers]
|
||||
|
||||
# https://github.com/Chia-Network/clvm/pull/102
|
||||
# https://github.com/Chia-Network/clvm/pull/106
|
||||
return Program.to([sibling_sides, sibling_hashes]) # type: ignore[no-any-return]
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class InternalNode:
|
||||
hash: bytes32
|
||||
# generation: int
|
||||
left_hash: bytes32
|
||||
right_hash: bytes32
|
||||
|
||||
pair: Optional[Tuple[Node, Node]] = None
|
||||
atom: None = None
|
||||
|
||||
# It is unclear how to properly satisfy the generic Row normally, let alone for
|
||||
# dict-like rows. https://github.com/python/typeshed/issues/8027
|
||||
@classmethod
|
||||
def from_row(cls, row: aiosqlite.Row) -> "InternalNode": # type: ignore[type-arg]
|
||||
return cls(
|
||||
hash=bytes32(hexstr_to_bytes(row["hash"])),
|
||||
# generation=row["generation"],
|
||||
left_hash=bytes32(hexstr_to_bytes(row["left"])),
|
||||
right_hash=bytes32(hexstr_to_bytes(row["right"])),
|
||||
)
|
||||
|
||||
def other_child_hash(self, hash: bytes32) -> bytes32:
|
||||
if self.left_hash == hash:
|
||||
return self.right_hash
|
||||
elif self.right_hash == hash:
|
||||
return self.left_hash
|
||||
|
||||
# TODO: real exception considerations
|
||||
raise Exception("provided hash not present")
|
||||
|
||||
def other_child_side(self, hash: bytes32) -> Side:
|
||||
if self.left_hash == hash:
|
||||
return Side.RIGHT
|
||||
elif self.right_hash == hash:
|
||||
return Side.LEFT
|
||||
|
||||
# TODO: real exception considerations
|
||||
raise Exception("provided hash not present")
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class Root:
|
||||
tree_id: bytes32
|
||||
node_hash: Optional[bytes32]
|
||||
generation: int
|
||||
status: Status
|
||||
|
||||
# It is unclear how to properly satisfy the generic Row normally, let alone for
|
||||
# dict-like rows. https://github.com/python/typeshed/issues/8027
|
||||
@classmethod
|
||||
def from_row(cls, row: aiosqlite.Row) -> "Root": # type: ignore[type-arg]
|
||||
raw_node_hash = row["node_hash"]
|
||||
if raw_node_hash is None:
|
||||
node_hash = None
|
||||
else:
|
||||
node_hash = bytes32(hexstr_to_bytes(raw_node_hash))
|
||||
|
||||
return cls(
|
||||
tree_id=bytes32(hexstr_to_bytes(row["tree_id"])),
|
||||
node_hash=node_hash,
|
||||
generation=row["generation"],
|
||||
status=Status(row["status"]),
|
||||
)
|
||||
|
||||
|
||||
node_type_to_class: Dict[NodeType, Union[Type[InternalNode], Type[TerminalNode]]] = {
|
||||
NodeType.INTERNAL: InternalNode,
|
||||
NodeType.TERMINAL: TerminalNode,
|
||||
}
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class Subscription:
|
||||
tree_id: bytes32
|
||||
urls: List[str]
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class DiffData:
|
||||
type: OperationType
|
||||
key: bytes
|
||||
value: bytes
|
||||
|
||||
|
||||
@streamable
|
||||
@dataclass(frozen=True)
|
||||
class SerializedNode(Streamable):
|
||||
is_terminal: bool
|
||||
value1: bytes
|
||||
value2: bytes
|
@ -1,7 +1,40 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass, field
|
||||
from enum import IntEnum
|
||||
from typing import Dict, List, Optional, Tuple, Type, Union
|
||||
|
||||
# TODO: remove or formalize this
|
||||
import aiosqlite as aiosqlite
|
||||
from typing_extensions import final
|
||||
|
||||
from chia.data_layer.data_layer_types import Node, node_type_to_class
|
||||
from chia.types.blockchain_format.program import Program
|
||||
from chia.types.blockchain_format.sized_bytes import bytes32
|
||||
from chia.util.byte_types import hexstr_to_bytes
|
||||
from chia.util.streamable import Streamable, streamable
|
||||
|
||||
|
||||
def internal_hash(left_hash: bytes32, right_hash: bytes32) -> bytes32:
|
||||
# ignoring hint error here for:
|
||||
# https://github.com/Chia-Network/clvm/pull/102
|
||||
# https://github.com/Chia-Network/clvm/pull/106
|
||||
return Program.to((left_hash, right_hash)).get_tree_hash(left_hash, right_hash) # type: ignore[no-any-return]
|
||||
|
||||
|
||||
def calculate_internal_hash(hash: bytes32, other_hash_side: Side, other_hash: bytes32) -> bytes32:
|
||||
if other_hash_side == Side.LEFT:
|
||||
return internal_hash(left_hash=other_hash, right_hash=hash)
|
||||
elif other_hash_side == Side.RIGHT:
|
||||
return internal_hash(left_hash=hash, right_hash=other_hash)
|
||||
|
||||
raise Exception(f"Invalid side: {other_hash_side!r}")
|
||||
|
||||
|
||||
def leaf_hash(key: bytes, value: bytes) -> bytes32:
|
||||
# ignoring hint error here for:
|
||||
# https://github.com/Chia-Network/clvm/pull/102
|
||||
# https://github.com/Chia-Network/clvm/pull/106
|
||||
return Program.to((key, value)).get_tree_hash() # type: ignore[no-any-return]
|
||||
|
||||
|
||||
async def _debug_dump(db: aiosqlite.Connection, description: str = "") -> None:
|
||||
@ -14,8 +47,228 @@ async def _debug_dump(db: aiosqlite.Connection, description: str = "") -> None:
|
||||
print(f" {dict(row)}")
|
||||
|
||||
|
||||
# It is unclear how to properly satisfy the generic Row normally, let alone for
|
||||
# dict-like rows. https://github.com/python/typeshed/issues/8027
|
||||
def row_to_node(row: aiosqlite.Row) -> Node: # type: ignore[type-arg]
|
||||
def row_to_node(row: aiosqlite.Row) -> Node:
|
||||
cls = node_type_to_class[row["node_type"]]
|
||||
return cls.from_row(row=row)
|
||||
|
||||
|
||||
class Status(IntEnum):
|
||||
PENDING = 1
|
||||
COMMITTED = 2
|
||||
|
||||
|
||||
class NodeType(IntEnum):
|
||||
# EMPTY = 0
|
||||
INTERNAL = 1
|
||||
TERMINAL = 2
|
||||
|
||||
|
||||
class Side(IntEnum):
|
||||
LEFT = 0
|
||||
RIGHT = 1
|
||||
|
||||
def other(self) -> "Side":
|
||||
if self == Side.LEFT:
|
||||
return Side.RIGHT
|
||||
|
||||
return Side.LEFT
|
||||
|
||||
|
||||
class OperationType(IntEnum):
|
||||
INSERT = 0
|
||||
DELETE = 1
|
||||
|
||||
|
||||
class CommitState(IntEnum):
|
||||
OPEN = 0
|
||||
FINALIZED = 1
|
||||
ROLLED_BACK = 2
|
||||
|
||||
|
||||
Node = Union["TerminalNode", "InternalNode"]
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class TerminalNode:
|
||||
hash: bytes32
|
||||
# generation: int
|
||||
key: bytes
|
||||
value: bytes
|
||||
|
||||
atom: None = field(init=False, default=None)
|
||||
|
||||
@property
|
||||
def pair(self) -> Tuple[bytes32, bytes32]:
|
||||
return Program.to(self.key), Program.to(self.value)
|
||||
|
||||
@classmethod
|
||||
def from_row(cls, row: aiosqlite.Row) -> "TerminalNode":
|
||||
return cls(
|
||||
hash=bytes32.fromhex(row["hash"]),
|
||||
# generation=row["generation"],
|
||||
key=bytes.fromhex(row["key"]),
|
||||
value=bytes.fromhex(row["value"]),
|
||||
)
|
||||
|
||||
|
||||
@final
|
||||
@dataclass(frozen=True)
|
||||
class ProofOfInclusionLayer:
|
||||
other_hash_side: Side
|
||||
other_hash: bytes32
|
||||
combined_hash: bytes32
|
||||
|
||||
@classmethod
|
||||
def from_internal_node(
|
||||
cls,
|
||||
internal_node: "InternalNode",
|
||||
traversal_child_hash: bytes32,
|
||||
) -> "ProofOfInclusionLayer":
|
||||
return ProofOfInclusionLayer(
|
||||
other_hash_side=internal_node.other_child_side(hash=traversal_child_hash),
|
||||
other_hash=internal_node.other_child_hash(hash=traversal_child_hash),
|
||||
combined_hash=internal_node.hash,
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def from_hashes(cls, primary_hash: bytes32, other_hash_side: Side, other_hash: bytes32) -> "ProofOfInclusionLayer":
|
||||
combined_hash = calculate_internal_hash(
|
||||
hash=primary_hash,
|
||||
other_hash_side=other_hash_side,
|
||||
other_hash=other_hash,
|
||||
)
|
||||
|
||||
return cls(other_hash_side=other_hash_side, other_hash=other_hash, combined_hash=combined_hash)
|
||||
|
||||
|
||||
other_side_to_bit = {Side.LEFT: 1, Side.RIGHT: 0}
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class ProofOfInclusion:
|
||||
node_hash: bytes32
|
||||
# children before parents
|
||||
layers: List[ProofOfInclusionLayer]
|
||||
|
||||
@property
|
||||
def root_hash(self) -> bytes32:
|
||||
if len(self.layers) == 0:
|
||||
return self.node_hash
|
||||
|
||||
return self.layers[-1].combined_hash
|
||||
|
||||
def as_program(self) -> Program:
|
||||
sibling_sides = sum(
|
||||
other_side_to_bit[layer.other_hash_side] << index for index, layer in enumerate(self.layers)
|
||||
)
|
||||
sibling_hashes = [layer.other_hash for layer in self.layers]
|
||||
|
||||
# https://github.com/Chia-Network/clvm/pull/102
|
||||
# https://github.com/Chia-Network/clvm/pull/106
|
||||
return Program.to([sibling_sides, sibling_hashes]) # type: ignore[no-any-return]
|
||||
|
||||
def valid(self) -> bool:
|
||||
existing_hash = self.node_hash
|
||||
|
||||
for layer in self.layers:
|
||||
calculated_hash = calculate_internal_hash(
|
||||
hash=existing_hash, other_hash_side=layer.other_hash_side, other_hash=layer.other_hash
|
||||
)
|
||||
|
||||
if calculated_hash != layer.combined_hash:
|
||||
return False
|
||||
|
||||
existing_hash = calculated_hash
|
||||
|
||||
if existing_hash != self.root_hash:
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class InternalNode:
|
||||
hash: bytes32
|
||||
# generation: int
|
||||
left_hash: bytes32
|
||||
right_hash: bytes32
|
||||
|
||||
pair: Optional[Tuple[Node, Node]] = None
|
||||
atom: None = None
|
||||
|
||||
@classmethod
|
||||
def from_row(cls, row: aiosqlite.Row) -> "InternalNode":
|
||||
return cls(
|
||||
hash=bytes32(hexstr_to_bytes(row["hash"])),
|
||||
# generation=row["generation"],
|
||||
left_hash=bytes32(hexstr_to_bytes(row["left"])),
|
||||
right_hash=bytes32(hexstr_to_bytes(row["right"])),
|
||||
)
|
||||
|
||||
def other_child_hash(self, hash: bytes32) -> bytes32:
|
||||
if self.left_hash == hash:
|
||||
return self.right_hash
|
||||
elif self.right_hash == hash:
|
||||
return self.left_hash
|
||||
|
||||
# TODO: real exception considerations
|
||||
raise Exception("provided hash not present")
|
||||
|
||||
def other_child_side(self, hash: bytes32) -> Side:
|
||||
if self.left_hash == hash:
|
||||
return Side.RIGHT
|
||||
elif self.right_hash == hash:
|
||||
return Side.LEFT
|
||||
|
||||
# TODO: real exception considerations
|
||||
raise Exception("provided hash not present")
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class Root:
|
||||
tree_id: bytes32
|
||||
node_hash: Optional[bytes32]
|
||||
generation: int
|
||||
status: Status
|
||||
|
||||
@classmethod
|
||||
def from_row(cls, row: aiosqlite.Row) -> "Root":
|
||||
raw_node_hash = row["node_hash"]
|
||||
if raw_node_hash is None:
|
||||
node_hash = None
|
||||
else:
|
||||
node_hash = bytes32(hexstr_to_bytes(raw_node_hash))
|
||||
|
||||
return cls(
|
||||
tree_id=bytes32(hexstr_to_bytes(row["tree_id"])),
|
||||
node_hash=node_hash,
|
||||
generation=row["generation"],
|
||||
status=Status(row["status"]),
|
||||
)
|
||||
|
||||
|
||||
node_type_to_class: Dict[NodeType, Union[Type[InternalNode], Type[TerminalNode]]] = {
|
||||
NodeType.INTERNAL: InternalNode,
|
||||
NodeType.TERMINAL: TerminalNode,
|
||||
}
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class Subscription:
|
||||
tree_id: bytes32
|
||||
urls: List[str]
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class DiffData:
|
||||
type: OperationType
|
||||
key: bytes
|
||||
value: bytes
|
||||
|
||||
|
||||
@streamable
|
||||
@dataclass(frozen=True)
|
||||
class SerializedNode(Streamable):
|
||||
is_terminal: bool
|
||||
value1: bytes
|
||||
value2: bytes
|
||||
|
@ -548,7 +548,7 @@ class DataLayerWallet:
|
||||
if launcher_coin is None:
|
||||
raise ValueError(f"DL Wallet does not have launcher info for id {launcher_id}")
|
||||
else:
|
||||
parent_lineage = LineageProof(launcher_coin.parent_coin_info, None, launcher_coin.amount)
|
||||
parent_lineage = LineageProof(launcher_coin.parent_coin_info, None, uint64(launcher_coin.amount))
|
||||
else:
|
||||
parent_lineage = parent_singleton.lineage_proof
|
||||
|
||||
|
@ -12,7 +12,7 @@ from chia.data_layer.data_layer_errors import (
|
||||
TerminalLeftRightError,
|
||||
TreeGenerationIncrementingError,
|
||||
)
|
||||
from chia.data_layer.data_layer_types import (
|
||||
from chia.data_layer.data_layer_util import (
|
||||
InternalNode,
|
||||
Node,
|
||||
NodeType,
|
||||
@ -26,8 +26,10 @@ from chia.data_layer.data_layer_types import (
|
||||
DiffData,
|
||||
OperationType,
|
||||
SerializedNode,
|
||||
internal_hash,
|
||||
leaf_hash,
|
||||
row_to_node,
|
||||
)
|
||||
from chia.data_layer.data_layer_util import row_to_node
|
||||
from chia.types.blockchain_format.program import Program
|
||||
from chia.types.blockchain_format.sized_bytes import bytes32
|
||||
from chia.util.byte_types import hexstr_to_bytes
|
||||
@ -80,7 +82,7 @@ class DataStore:
|
||||
generation INTEGER NOT NULL,
|
||||
node_hash TEXT,
|
||||
status INTEGER NOT NULL,
|
||||
PRIMARY KEY(tree_id, generation),
|
||||
PRIMARY KEY(status, tree_id, generation),
|
||||
FOREIGN KEY(node_hash) REFERENCES node(hash)
|
||||
)
|
||||
"""
|
||||
@ -98,7 +100,6 @@ class DataStore:
|
||||
tree_id TEXT NOT NULL,
|
||||
generation INTEGER NOT NULL,
|
||||
PRIMARY KEY(hash, tree_id, generation),
|
||||
FOREIGN KEY(tree_id, generation) REFERENCES root(tree_id, generation),
|
||||
FOREIGN KEY(ancestor) REFERENCES node(hash)
|
||||
)
|
||||
"""
|
||||
@ -121,7 +122,11 @@ class DataStore:
|
||||
return self
|
||||
|
||||
async def _insert_root(
|
||||
self, tree_id: bytes32, node_hash: Optional[bytes32], status: Status, generation: Optional[int] = None
|
||||
self,
|
||||
tree_id: bytes32,
|
||||
node_hash: Optional[bytes32],
|
||||
status: Status,
|
||||
generation: Optional[int] = None,
|
||||
) -> None:
|
||||
# This should be replaced by an SQLite schema level check.
|
||||
# https://github.com/Chia-Network/chia-blockchain/pull/9284
|
||||
@ -148,7 +153,8 @@ class DataStore:
|
||||
)
|
||||
|
||||
# `node_hash` is now a root, so it has no ancestor.
|
||||
if node_hash is not None:
|
||||
# Don't change the ancestor table unless the root is committed.
|
||||
if node_hash is not None and status == Status.COMMITTED:
|
||||
values = {
|
||||
"hash": node_hash.hex(),
|
||||
"tree_id": tree_id.hex(),
|
||||
@ -202,17 +208,14 @@ class DataStore:
|
||||
if node_type == NodeType.INTERNAL:
|
||||
left_hash = bytes32(value1)
|
||||
right_hash = bytes32(value2)
|
||||
node_hash = Program.to((left_hash, right_hash)).get_tree_hash(left_hash, right_hash)
|
||||
node_hash = internal_hash(left_hash, right_hash)
|
||||
await self._insert_node(node_hash.hex(), node_type, value1.hex(), value2.hex(), None, None)
|
||||
else:
|
||||
node_hash = Program.to((value1, value2)).get_tree_hash()
|
||||
node_hash = leaf_hash(key=value1, value=value2)
|
||||
await self._insert_node(node_hash.hex(), node_type, None, None, value1.hex(), value2.hex())
|
||||
|
||||
async def _insert_internal_node(self, left_hash: bytes32, right_hash: bytes32) -> bytes32:
|
||||
# forcing type hint here for:
|
||||
# https://github.com/Chia-Network/clvm/pull/102
|
||||
# https://github.com/Chia-Network/clvm/pull/106
|
||||
node_hash: bytes32 = Program.to((left_hash, right_hash)).get_tree_hash(left_hash, right_hash)
|
||||
node_hash: bytes32 = internal_hash(left_hash=left_hash, right_hash=right_hash)
|
||||
|
||||
await self._insert_node(
|
||||
node_hash=node_hash.hex(),
|
||||
@ -232,7 +235,7 @@ class DataStore:
|
||||
tree_id: bytes32,
|
||||
generation: int,
|
||||
) -> None:
|
||||
node_hash = Program.to((left_hash, right_hash)).get_tree_hash(left_hash, right_hash)
|
||||
node_hash = internal_hash(left_hash=left_hash, right_hash=right_hash)
|
||||
|
||||
for hash in (left_hash, right_hash):
|
||||
values = {
|
||||
@ -279,6 +282,37 @@ class DataStore:
|
||||
|
||||
return node_hash
|
||||
|
||||
async def get_pending_root(self, tree_id: bytes32, *, lock: bool = True) -> Optional[Root]:
|
||||
async with self.db_wrapper.locked_transaction(lock=lock):
|
||||
cursor = await self.db.execute(
|
||||
"SELECT * FROM root WHERE tree_id == :tree_id AND status == :status",
|
||||
{"tree_id": tree_id.hex(), "status": Status.PENDING.value},
|
||||
)
|
||||
|
||||
row = await cursor.fetchone()
|
||||
|
||||
if row is None:
|
||||
return None
|
||||
|
||||
maybe_extra_result = await cursor.fetchone()
|
||||
if maybe_extra_result is not None:
|
||||
raise Exception(f"multiple pending roots found for id: {tree_id.hex()}")
|
||||
|
||||
return Root.from_row(row=row)
|
||||
|
||||
async def clear_pending_roots(self, tree_id: bytes32, *, lock: bool = True) -> None:
|
||||
async with self.db_wrapper.locked_transaction(lock=lock):
|
||||
await self.db.execute(
|
||||
"DELETE FROM root WHERE tree_id == :tree_id AND status == :status",
|
||||
{"tree_id": tree_id.hex(), "status": Status.PENDING.value},
|
||||
)
|
||||
|
||||
async def shift_root_generations(self, tree_id: bytes32, shift_size: int, *, lock: bool = False) -> None:
|
||||
async with self.db_wrapper.locked_transaction(lock=lock):
|
||||
root = await self.get_tree_root(tree_id=tree_id, lock=False)
|
||||
for _ in range(shift_size):
|
||||
await self._insert_root(tree_id=tree_id, node_hash=root.node_hash, status=Status.COMMITTED)
|
||||
|
||||
async def change_root_status(self, root: Root, status: Status = Status.PENDING) -> None:
|
||||
async with self.db_wrapper.locked_transaction(lock=True):
|
||||
await self.db.execute(
|
||||
@ -289,10 +323,26 @@ class DataStore:
|
||||
root.generation,
|
||||
),
|
||||
)
|
||||
# `node_hash` is now a root, so it has no ancestor.
|
||||
# Don't change the ancestor table unless the root is committed.
|
||||
if root.node_hash is not None and status == Status.COMMITTED:
|
||||
values = {
|
||||
"hash": root.node_hash.hex(),
|
||||
"tree_id": root.tree_id.hex(),
|
||||
"generation": root.generation,
|
||||
}
|
||||
await self.db.execute(
|
||||
"""
|
||||
INSERT INTO ancestors(hash, ancestor, tree_id, generation)
|
||||
VALUES (:hash, NULL, :tree_id, :generation)
|
||||
""",
|
||||
values,
|
||||
)
|
||||
|
||||
async def check(self) -> None:
|
||||
for check in self._checks:
|
||||
await check(self)
|
||||
# pylint seems to think these are bound methods not unbound methods.
|
||||
await check(self) # pylint: disable=too-many-function-args
|
||||
|
||||
async def _check_internal_key_value_are_null(self, *, lock: bool = True) -> None:
|
||||
async with self.db_wrapper.locked_transaction(lock=lock):
|
||||
@ -362,9 +412,7 @@ class DataStore:
|
||||
async for row in cursor:
|
||||
node = row_to_node(row=row)
|
||||
if isinstance(node, InternalNode):
|
||||
expected_hash = Program.to((node.left_hash, node.right_hash)).get_tree_hash(
|
||||
node.left_hash, node.right_hash
|
||||
)
|
||||
expected_hash = internal_hash(left_hash=node.left_hash, right_hash=node.right_hash)
|
||||
elif isinstance(node, TerminalNode):
|
||||
expected_hash = Program.to((node.key, node.value)).get_tree_hash()
|
||||
|
||||
@ -405,8 +453,8 @@ class DataStore:
|
||||
async def get_tree_generation(self, tree_id: bytes32, *, lock: bool = True) -> int:
|
||||
async with self.db_wrapper.locked_transaction(lock=lock):
|
||||
cursor = await self.db.execute(
|
||||
"SELECT MAX(generation) FROM root WHERE tree_id == :tree_id",
|
||||
{"tree_id": tree_id.hex()},
|
||||
"SELECT MAX(generation) FROM root WHERE tree_id == :tree_id AND status == :status",
|
||||
{"tree_id": tree_id.hex(), "status": Status.COMMITTED.value},
|
||||
)
|
||||
row = await cursor.fetchone()
|
||||
|
||||
@ -420,8 +468,8 @@ class DataStore:
|
||||
if generation is None:
|
||||
generation = await self.get_tree_generation(tree_id=tree_id, lock=False)
|
||||
cursor = await self.db.execute(
|
||||
"SELECT * FROM root WHERE tree_id == :tree_id AND generation == :generation",
|
||||
{"tree_id": tree_id.hex(), "generation": generation},
|
||||
"SELECT * FROM root WHERE tree_id == :tree_id AND generation == :generation AND status == :status",
|
||||
{"tree_id": tree_id.hex(), "generation": generation, "status": Status.COMMITTED.value},
|
||||
)
|
||||
row = await cursor.fetchone()
|
||||
|
||||
@ -437,8 +485,8 @@ class DataStore:
|
||||
async def tree_id_exists(self, tree_id: bytes32, *, lock: bool = True) -> bool:
|
||||
async with self.db_wrapper.locked_transaction(lock=lock):
|
||||
cursor = await self.db.execute(
|
||||
"SELECT 1 FROM root WHERE tree_id == :tree_id",
|
||||
{"tree_id": tree_id.hex()},
|
||||
"SELECT 1 FROM root WHERE tree_id == :tree_id AND status == :status",
|
||||
{"tree_id": tree_id.hex(), "status": Status.COMMITTED.value},
|
||||
)
|
||||
row = await cursor.fetchone()
|
||||
|
||||
@ -662,6 +710,7 @@ class DataStore:
|
||||
tree_id: bytes32,
|
||||
hint_keys_values: Optional[Dict[bytes, bytes]] = None,
|
||||
use_optimized: bool = True,
|
||||
status: Status = Status.PENDING,
|
||||
*,
|
||||
lock: bool = True,
|
||||
) -> bytes32:
|
||||
@ -671,7 +720,7 @@ class DataStore:
|
||||
reference_node_hash = None
|
||||
side = None
|
||||
else:
|
||||
seed = Program.to((key, value)).get_tree_hash()
|
||||
seed = leaf_hash(key=key, value=value)
|
||||
reference_node_hash = await self.get_terminal_node_for_seed(tree_id, seed, lock=False)
|
||||
side = self.get_side_for_seed(seed)
|
||||
|
||||
@ -684,6 +733,7 @@ class DataStore:
|
||||
hint_keys_values=hint_keys_values,
|
||||
lock=False,
|
||||
use_optimized=use_optimized,
|
||||
status=status,
|
||||
)
|
||||
|
||||
async def get_keys_values_dict(self, tree_id: bytes32, *, lock: bool = True) -> Dict[bytes, bytes]:
|
||||
@ -700,9 +750,9 @@ class DataStore:
|
||||
side: Optional[Side],
|
||||
hint_keys_values: Optional[Dict[bytes, bytes]] = None,
|
||||
use_optimized: bool = True,
|
||||
status: Status = Status.PENDING,
|
||||
*,
|
||||
lock: bool = True,
|
||||
status: Status = Status.PENDING,
|
||||
) -> bytes32:
|
||||
async with self.db_wrapper.locked_transaction(lock=lock):
|
||||
was_empty = await self.table_is_empty(tree_id=tree_id, lock=False)
|
||||
@ -733,7 +783,11 @@ class DataStore:
|
||||
if side is not None:
|
||||
raise Exception("Tree was empty so side must be unspecified, got: {side!r}")
|
||||
|
||||
await self._insert_root(tree_id=tree_id, node_hash=new_terminal_node_hash, status=status)
|
||||
await self._insert_root(
|
||||
tree_id=tree_id,
|
||||
node_hash=new_terminal_node_hash,
|
||||
status=status,
|
||||
)
|
||||
else:
|
||||
if side is None:
|
||||
raise Exception("Tree was not empty, side must be specified.")
|
||||
@ -791,9 +845,14 @@ class DataStore:
|
||||
new_hash = await self._insert_internal_node(left_hash=left, right_hash=right)
|
||||
insert_ancestors_cache.append((left, right, tree_id))
|
||||
|
||||
await self._insert_root(tree_id=tree_id, node_hash=new_hash, status=status)
|
||||
for left_hash, right_hash, tree_id in insert_ancestors_cache:
|
||||
await self._insert_ancestor_table(left_hash, right_hash, tree_id, new_generation)
|
||||
await self._insert_root(
|
||||
tree_id=tree_id,
|
||||
node_hash=new_hash,
|
||||
status=status,
|
||||
)
|
||||
if status == Status.COMMITTED:
|
||||
for left_hash, right_hash, tree_id in insert_ancestors_cache:
|
||||
await self._insert_ancestor_table(left_hash, right_hash, tree_id, new_generation)
|
||||
|
||||
if hint_keys_values is not None:
|
||||
hint_keys_values[bytes(key)] = value
|
||||
@ -805,18 +864,19 @@ class DataStore:
|
||||
tree_id: bytes32,
|
||||
hint_keys_values: Optional[Dict[bytes, bytes]] = None,
|
||||
use_optimized: bool = True,
|
||||
status: Status = Status.PENDING,
|
||||
*,
|
||||
lock: bool = True,
|
||||
status: Status = Status.PENDING,
|
||||
) -> None:
|
||||
async with self.db_wrapper.locked_transaction(lock=lock):
|
||||
if hint_keys_values is None:
|
||||
node = await self.get_node_by_key(key=key, tree_id=tree_id, lock=False)
|
||||
else:
|
||||
if bytes(key) not in hint_keys_values:
|
||||
raise Exception(f"Key not found: {key.hex()}")
|
||||
log.debug(f"Request to delete an unknown key ignored: {key.hex()}")
|
||||
return
|
||||
value = hint_keys_values[bytes(key)]
|
||||
node_hash = Program.to((key, value)).get_tree_hash()
|
||||
node_hash = leaf_hash(key=key, value=value)
|
||||
node = TerminalNode(node_hash, key, value)
|
||||
del hint_keys_values[bytes(key)]
|
||||
if use_optimized:
|
||||
@ -835,7 +895,11 @@ class DataStore:
|
||||
raise RuntimeError("Tree exceeded max height of 62.")
|
||||
if len(ancestors) == 0:
|
||||
# the only node is being deleted
|
||||
await self._insert_root(tree_id=tree_id, node_hash=None, status=status)
|
||||
await self._insert_root(
|
||||
tree_id=tree_id,
|
||||
node_hash=None,
|
||||
status=status,
|
||||
)
|
||||
|
||||
return
|
||||
|
||||
@ -844,7 +908,11 @@ class DataStore:
|
||||
|
||||
if len(ancestors) == 1:
|
||||
# the parent is the root so the other side will become the new root
|
||||
await self._insert_root(tree_id=tree_id, node_hash=other_hash, status=status)
|
||||
await self._insert_root(
|
||||
tree_id=tree_id,
|
||||
node_hash=other_hash,
|
||||
status=status,
|
||||
)
|
||||
|
||||
return
|
||||
|
||||
@ -868,9 +936,14 @@ class DataStore:
|
||||
insert_ancestors_cache.append((left_hash, right_hash, tree_id))
|
||||
old_child_hash = ancestor.hash
|
||||
|
||||
await self._insert_root(tree_id=tree_id, node_hash=new_child_hash, status=status)
|
||||
for left_hash, right_hash, tree_id in insert_ancestors_cache:
|
||||
await self._insert_ancestor_table(left_hash, right_hash, tree_id, new_generation)
|
||||
await self._insert_root(
|
||||
tree_id=tree_id,
|
||||
node_hash=new_child_hash,
|
||||
status=status,
|
||||
)
|
||||
if status == Status.COMMITTED:
|
||||
for left_hash, right_hash, tree_id in insert_ancestors_cache:
|
||||
await self._insert_ancestor_table(left_hash, right_hash, tree_id, new_generation)
|
||||
|
||||
return
|
||||
|
||||
@ -881,7 +954,7 @@ class DataStore:
|
||||
status: Status = Status.PENDING,
|
||||
*,
|
||||
lock: bool = True,
|
||||
) -> None:
|
||||
) -> Optional[bytes32]:
|
||||
async with self.db_wrapper.locked_transaction(lock=lock):
|
||||
hint_keys_values = await self.get_keys_values_dict(tree_id, lock=False)
|
||||
old_root = await self.get_tree_root(tree_id, lock=False)
|
||||
@ -892,22 +965,42 @@ class DataStore:
|
||||
reference_node_hash = change.get("reference_node_hash", None)
|
||||
side = change.get("side", None)
|
||||
if reference_node_hash is None and side is None:
|
||||
await self.autoinsert(key, value, tree_id, hint_keys_values, lock=False)
|
||||
await self.autoinsert(key, value, tree_id, hint_keys_values, True, Status.COMMITTED, lock=False)
|
||||
else:
|
||||
if reference_node_hash is None or side is None:
|
||||
raise Exception("Provide both reference_node_hash and side or neither.")
|
||||
await self.insert(key, value, tree_id, reference_node_hash, side, hint_keys_values, lock=False)
|
||||
await self.insert(
|
||||
key,
|
||||
value,
|
||||
tree_id,
|
||||
reference_node_hash,
|
||||
side,
|
||||
hint_keys_values,
|
||||
True,
|
||||
Status.COMMITTED,
|
||||
lock=False,
|
||||
)
|
||||
elif change["action"] == "delete":
|
||||
key = change["key"]
|
||||
await self.delete(key, tree_id, hint_keys_values, lock=False)
|
||||
await self.delete(key, tree_id, hint_keys_values, True, Status.COMMITTED, lock=False)
|
||||
else:
|
||||
raise Exception(f"Operation in batch is not insert or delete: {change}")
|
||||
|
||||
root = await self.get_tree_root(tree_id, lock=False)
|
||||
root = await self.get_tree_root(tree_id=tree_id, lock=False)
|
||||
# We delete all "temporary" records stored in root and ancestor tables and store only the final result.
|
||||
await self.rollback_to_generation(tree_id, old_root.generation, lock=False)
|
||||
await self.insert_root_with_ancestor_table(tree_id, root.node_hash, lock=False)
|
||||
new_root = await self.get_tree_root(tree_id, lock=False)
|
||||
if root.node_hash == old_root.node_hash:
|
||||
raise ValueError("Changelist resulted in no change to tree data")
|
||||
await self.insert_root_with_ancestor_table(
|
||||
tree_id=tree_id, node_hash=root.node_hash, status=status, lock=False
|
||||
)
|
||||
if status == Status.PENDING:
|
||||
new_root = await self.get_pending_root(tree_id=tree_id, lock=False)
|
||||
assert new_root is not None
|
||||
elif status == Status.COMMITTED:
|
||||
new_root = await self.get_tree_root(tree_id=tree_id, lock=False)
|
||||
else:
|
||||
raise Exception(f"No known status: {status}")
|
||||
if new_root.node_hash != root.node_hash:
|
||||
raise RuntimeError(
|
||||
f"Tree root mismatches after batch update: Expected: {root.node_hash}. Got: {new_root.node_hash}"
|
||||
@ -917,6 +1010,7 @@ class DataStore:
|
||||
"Didn't get the expected generation after batch update: "
|
||||
f"Expected: {old_root.generation + 1}. Got: {new_root.generation}"
|
||||
)
|
||||
return root.node_hash
|
||||
|
||||
async def _get_one_ancestor(
|
||||
self,
|
||||
@ -944,11 +1038,8 @@ class DataStore:
|
||||
return None
|
||||
return InternalNode.from_row(row=row)
|
||||
|
||||
async def insert_root_with_ancestor_table(
|
||||
self, tree_id: bytes32, node_hash: Optional[bytes32], status: Status = Status.PENDING, *, lock: bool = True
|
||||
) -> None:
|
||||
async def build_ancestor_table_for_latest_root(self, tree_id: bytes32, *, lock: bool = True) -> None:
|
||||
async with self.db_wrapper.locked_transaction(lock=lock):
|
||||
await self._insert_root(tree_id=tree_id, node_hash=node_hash, status=status)
|
||||
root = await self.get_tree_root(tree_id=tree_id, lock=False)
|
||||
if root.node_hash is None:
|
||||
return
|
||||
@ -978,6 +1069,15 @@ class DataStore:
|
||||
if node.hash not in known_hashes:
|
||||
await self._insert_ancestor_table(node.left_hash, node.right_hash, tree_id, root.generation)
|
||||
|
||||
async def insert_root_with_ancestor_table(
|
||||
self, tree_id: bytes32, node_hash: Optional[bytes32], status: Status = Status.PENDING, *, lock: bool = True
|
||||
) -> None:
|
||||
async with self.db_wrapper.locked_transaction(lock=lock):
|
||||
await self._insert_root(tree_id=tree_id, node_hash=node_hash, status=status)
|
||||
# Don't update the ancestor table for non-committed status.
|
||||
if status == Status.COMMITTED:
|
||||
await self.build_ancestor_table_for_latest_root(tree_id=tree_id, lock=False)
|
||||
|
||||
async def get_node_by_key(self, key: bytes, tree_id: bytes32, *, lock: bool = True) -> TerminalNode:
|
||||
async with self.db_wrapper.locked_transaction(lock=lock):
|
||||
nodes = await self.get_keys_values(tree_id=tree_id, lock=False)
|
||||
@ -1047,11 +1147,6 @@ class DataStore:
|
||||
async with self.db_wrapper.locked_transaction(lock=lock):
|
||||
ancestors = await self.get_ancestors(node_hash=node_hash, tree_id=tree_id, lock=False)
|
||||
|
||||
if len(ancestors) > 0:
|
||||
root_hash = ancestors[-1].hash
|
||||
else:
|
||||
root_hash = node_hash
|
||||
|
||||
layers: List[ProofOfInclusionLayer] = []
|
||||
child_hash = node_hash
|
||||
for parent in ancestors:
|
||||
@ -1059,7 +1154,20 @@ class DataStore:
|
||||
layers.append(layer)
|
||||
child_hash = parent.hash
|
||||
|
||||
return ProofOfInclusion(node_hash=node_hash, root_hash=root_hash, layers=layers)
|
||||
proof_of_inclusion = ProofOfInclusion(node_hash=node_hash, layers=layers)
|
||||
|
||||
if len(ancestors) > 0:
|
||||
expected_root = ancestors[-1].hash
|
||||
else:
|
||||
expected_root = node_hash
|
||||
|
||||
if expected_root != proof_of_inclusion.root_hash:
|
||||
raise Exception(
|
||||
f"Incorrect root, expected: {expected_root.hex()}"
|
||||
f"\n has: {proof_of_inclusion.root_hash.hex()}"
|
||||
)
|
||||
|
||||
return proof_of_inclusion
|
||||
|
||||
async def get_proof_of_inclusion_by_key(
|
||||
self,
|
||||
|
@ -14,9 +14,7 @@ from chia.wallet.lineage_proof import LineageProof
|
||||
_T_DataLayerStore = TypeVar("_T_DataLayerStore", bound="DataLayerStore")
|
||||
|
||||
|
||||
# It is unclear how to properly satisfy the generic Row normally, let alone for
|
||||
# dict-like rows. https://github.com/python/typeshed/issues/8027
|
||||
def _row_to_singleton_record(row: Row) -> SingletonRecord: # type: ignore[type-arg]
|
||||
def _row_to_singleton_record(row: Row) -> SingletonRecord:
|
||||
return SingletonRecord(
|
||||
bytes32(row[0]),
|
||||
bytes32(row[1]),
|
||||
@ -236,7 +234,7 @@ class DataLayerStore:
|
||||
"""
|
||||
Add a new launcher coin's information to the DB
|
||||
"""
|
||||
launcher_bytes: bytes = launcher.parent_coin_info + launcher.puzzle_hash + bytes(launcher.amount)
|
||||
launcher_bytes: bytes = launcher.parent_coin_info + launcher.puzzle_hash + bytes(uint64(launcher.amount))
|
||||
if not in_transaction:
|
||||
await self.db_wrapper.lock.acquire()
|
||||
try:
|
||||
|
@ -7,7 +7,7 @@ from typing import List, Optional
|
||||
from typing_extensions import Literal
|
||||
from chia.data_layer.data_store import DataStore
|
||||
from chia.types.blockchain_format.sized_bytes import bytes32
|
||||
from chia.data_layer.data_layer_types import NodeType, Status, SerializedNode, Root
|
||||
from chia.data_layer.data_layer_util import NodeType, Status, SerializedNode, Root
|
||||
|
||||
|
||||
def get_full_tree_filename(tree_id: bytes32, node_hash: bytes32, generation: int) -> str:
|
||||
|
@ -9,8 +9,7 @@ from pathlib import Path
|
||||
from chia.util.db_wrapper import DBWrapper
|
||||
from chia.data_layer.data_store import DataStore
|
||||
from chia.types.blockchain_format.sized_bytes import bytes32
|
||||
from chia.data_layer.data_layer_types import Side, TerminalNode
|
||||
from chia.types.blockchain_format.program import Program
|
||||
from chia.data_layer.data_layer_util import Side, TerminalNode, leaf_hash
|
||||
|
||||
|
||||
async def generate_datastore(num_nodes: int, slow_mode: bool) -> None:
|
||||
@ -40,7 +39,7 @@ async def generate_datastore(num_nodes: int, slow_mode: bool) -> None:
|
||||
for i in range(num_nodes):
|
||||
key = i.to_bytes(4, byteorder="big")
|
||||
value = (2 * i).to_bytes(4, byteorder="big")
|
||||
seed = Program.to((key, value)).get_tree_hash()
|
||||
seed = leaf_hash(key=key, value=value)
|
||||
reference_node_hash: Optional[bytes32] = await data_store.get_terminal_node_for_seed(tree_id, seed)
|
||||
side: Optional[Side] = data_store.get_side_for_seed(seed)
|
||||
|
||||
|
@ -130,9 +130,8 @@ class BlockHeightMap:
|
||||
def update_height(self, height: uint32, header_hash: bytes32, ses: Optional[SubEpochSummary]):
|
||||
# we're only updating the last hash. If we've reorged, we already rolled
|
||||
# back, making this the new peak
|
||||
idx = height * 32
|
||||
assert idx <= len(self.__height_to_hash)
|
||||
self.__height_to_hash[idx : idx + 32] = header_hash
|
||||
assert height * 32 <= len(self.__height_to_hash)
|
||||
self.__set_hash(height, header_hash)
|
||||
if ses is not None:
|
||||
self.__sub_epoch_summaries[height] = bytes(ses)
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user