Merge branch 'main' into jack-cat-coinselection

This commit is contained in:
Jack Nelson 2022-03-30 20:48:31 -04:00
commit 2286fe4265
No known key found for this signature in database
GPG key ID: A6D9E5FBE85383AE
204 changed files with 8701 additions and 2607 deletions

17
.coveragerc Normal file
View file

@ -0,0 +1,17 @@
[run]
branch=True
relative_files=True
source=
chia
tests
concurrency=multiprocessing
parallel=True
[report]
precision = 1
exclude_lines =
pragma: no cover
abc\.abstractmethod
typing\.overload
^\s*\.\.\.\s*$
if typing.TYPE_CHECKING:

View file

@ -28,7 +28,7 @@ jobs:
steps:
- name: Checkout Code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
@ -43,7 +43,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}

View file

@ -31,7 +31,7 @@ jobs:
- uses: Chia-Network/actions/clean-workspace@main
- name: Checkout Code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
@ -62,13 +62,13 @@ jobs:
SECRET: "${{ secrets.INSTALLER_UPLOAD_SECRET }}"
# Get the most recent release from chia-plotter-madmax
- uses: actions/github-script@v4
- uses: actions/github-script@v6
id: 'latest-madmax'
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
result-encoding: string
script: |
const releases = await github.repos.listReleases({
const releases = await github.rest.repos.listReleases({
owner: 'Chia-Network',
repo: 'chia-plotter-madmax',
});
@ -83,13 +83,13 @@ jobs:
chmod +x "$GITHUB_WORKSPACE/madmax/chia_plot_k34"
# Get the most recent release from bladebit
- uses: actions/github-script@v4
- uses: actions/github-script@v6
id: 'latest-bladebit'
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
result-encoding: string
script: |
const releases = await github.repos.listReleases({
const releases = await github.rest.repos.listReleases({
owner: 'Chia-Network',
repo: 'bladebit',
});

View file

@ -30,7 +30,7 @@ jobs:
steps:
- name: Checkout Code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
@ -49,7 +49,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Cache npm
uses: actions/cache@v2.1.6
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
@ -67,7 +67,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
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 }}
@ -96,13 +96,13 @@ jobs:
SECRET: "${{ secrets.INSTALLER_UPLOAD_SECRET }}"
# Get the most recent release from chia-plotter-madmax
- uses: actions/github-script@v4
- uses: actions/github-script@v6
id: 'latest-madmax'
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
result-encoding: string
script: |
const releases = await github.repos.listReleases({
const releases = await github.rest.repos.listReleases({
owner: 'Chia-Network',
repo: 'chia-plotter-madmax',
});
@ -117,13 +117,13 @@ jobs:
chmod +x "$GITHUB_WORKSPACE/madmax/chia_plot_k34"
# Get the most recent release from bladebit
- uses: actions/github-script@v4
- uses: actions/github-script@v6
id: 'latest-bladebit'
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
result-encoding: string
script: |
const releases = await github.repos.listReleases({
const releases = await github.rest.repos.listReleases({
owner: 'Chia-Network',
repo: 'bladebit',
});
@ -144,7 +144,7 @@ jobs:
sh install.sh
- name: Setup Node 16.x
uses: actions/setup-node@v2.4.1
uses: actions/setup-node@v3
with:
node-version: '16.x'

View file

@ -31,7 +31,7 @@ jobs:
steps:
- name: Checkout Code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
@ -65,13 +65,13 @@ jobs:
SECRET: "${{ secrets.INSTALLER_UPLOAD_SECRET }}"
# Get the most recent release from chia-plotter-madmax
- uses: actions/github-script@v4
- uses: actions/github-script@v6
id: 'latest-madmax'
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
result-encoding: string
script: |
const releases = await github.repos.listReleases({
const releases = await github.rest.repos.listReleases({
owner: 'Chia-Network',
repo: 'chia-plotter-madmax',
});
@ -86,13 +86,13 @@ jobs:
chmod +x "$GITHUB_WORKSPACE/madmax/chia_plot_k34"
# Get the most recent release from bladebit
- uses: actions/github-script@v4
- uses: actions/github-script@v6
id: 'latest-bladebit'
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
result-encoding: string
script: |
const releases = await github.repos.listReleases({
const releases = await github.rest.repos.listReleases({
owner: 'Chia-Network',
repo: 'bladebit',
});

View file

@ -29,7 +29,7 @@ jobs:
steps:
- name: Checkout Code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
@ -70,7 +70,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Cache npm
uses: actions/cache@v2.1.6
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
@ -88,7 +88,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
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 }}
@ -104,13 +104,13 @@ jobs:
p12-password: ${{ secrets.APPLE_DEV_ID_APP_PASS }}
# Get the most recent release from chia-plotter-madmax
- uses: actions/github-script@v4
- uses: actions/github-script@v6
id: 'latest-madmax'
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
result-encoding: string
script: |
const releases = await github.repos.listReleases({
const releases = await github.rest.repos.listReleases({
owner: 'Chia-Network',
repo: 'chia-plotter-madmax',
});
@ -132,7 +132,7 @@ jobs:
sh install.sh
- name: Setup Node 16.x
uses: actions/setup-node@v2.4.1
uses: actions/setup-node@v3
with:
node-version: '16.x'

View file

@ -29,7 +29,7 @@ jobs:
- uses: Chia-Network/actions/clean-workspace@main
- name: Checkout Code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
@ -78,13 +78,13 @@ jobs:
p12-password: ${{ secrets.APPLE_DEV_ID_APP_PASS }}
# Get the most recent release from chia-plotter-madmax
- uses: actions/github-script@v4
- uses: actions/github-script@v6
id: 'latest-madmax'
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
result-encoding: string
script: |
const releases = await github.repos.listReleases({
const releases = await github.rest.repos.listReleases({
owner: 'Chia-Network',
repo: 'chia-plotter-madmax',
});

View file

@ -29,10 +29,13 @@ jobs:
matrix:
python-version: [3.8, 3.9]
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@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
@ -54,7 +57,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
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 }}
@ -63,20 +66,13 @@ jobs:
${{ runner.os }}-pip-
- name: Checkout test blocks and plots
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: 'Chia-Network/test-cache'
path: '.chia'
ref: '0.28.0'
fetch-depth: 1
- name: Link home directory
run: |
cd $HOME
ln -s $GITHUB_WORKSPACE/.chia
echo "$HOME/.chia"
ls -al $HOME/.chia
- name: Run install script
env:
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
@ -89,7 +85,23 @@ jobs:
- name: Test blockchain code with pytest
run: |
. ./activate
./venv/bin/py.test tests/blockchain/test_*.py -s -v --durations 0 -n 4 -m "not benchmark"
venv/bin/coverage run --rcfile=.coveragerc ./venv/bin/py.test tests/blockchain/test_*.py -s -v --durations 0 -n 4 -m "not benchmark"
- 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@v2
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
#

View file

@ -29,10 +29,13 @@ jobs:
matrix:
python-version: [3.8, 3.9]
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@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
@ -54,7 +57,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
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 }}
@ -76,7 +79,23 @@ jobs:
- name: Test clvm code with pytest
run: |
. ./activate
./venv/bin/py.test tests/clvm/test_*.py -s -v --durations 0 -n 4 -m "not benchmark"
venv/bin/coverage run --rcfile=.coveragerc ./venv/bin/py.test tests/clvm/test_*.py -s -v --durations 0 -n 4 -m "not benchmark"
- 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@v2
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
#

View file

@ -29,10 +29,13 @@ jobs:
matrix:
python-version: [3.8, 3.9]
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@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
@ -54,7 +57,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
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 }}
@ -63,20 +66,13 @@ jobs:
${{ runner.os }}-pip-
- name: Checkout test blocks and plots
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: 'Chia-Network/test-cache'
path: '.chia'
ref: '0.28.0'
fetch-depth: 1
- name: Link home directory
run: |
cd $HOME
ln -s $GITHUB_WORKSPACE/.chia
echo "$HOME/.chia"
ls -al $HOME/.chia
- name: Run install script
env:
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
@ -89,7 +85,23 @@ jobs:
- name: Test core-cmds code with pytest
run: |
. ./activate
./venv/bin/py.test tests/core/cmds/test_*.py -s -v --durations 0 -n 4 -m "not benchmark"
venv/bin/coverage run --rcfile=.coveragerc ./venv/bin/py.test tests/core/cmds/test_*.py -s -v --durations 0 -n 4 -m "not benchmark"
- 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@v2
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
#

View file

@ -29,10 +29,13 @@ jobs:
matrix:
python-version: [3.8, 3.9]
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@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
@ -54,7 +57,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
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 }}
@ -63,20 +66,13 @@ jobs:
${{ runner.os }}-pip-
- name: Checkout test blocks and plots
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: 'Chia-Network/test-cache'
path: '.chia'
ref: '0.28.0'
fetch-depth: 1
- name: Link home directory
run: |
cd $HOME
ln -s $GITHUB_WORKSPACE/.chia
echo "$HOME/.chia"
ls -al $HOME/.chia
- name: Run install script
env:
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
@ -89,7 +85,23 @@ jobs:
- name: Test core-consensus code with pytest
run: |
. ./activate
./venv/bin/py.test tests/core/consensus/test_*.py -s -v --durations 0 -n 4 -m "not benchmark"
venv/bin/coverage run --rcfile=.coveragerc ./venv/bin/py.test tests/core/consensus/test_*.py -s -v --durations 0 -n 4 -m "not benchmark"
- 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@v2
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
#

View file

@ -29,10 +29,13 @@ jobs:
matrix:
python-version: [3.8, 3.9]
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@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
@ -54,7 +57,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
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 }}
@ -63,20 +66,13 @@ jobs:
${{ runner.os }}-pip-
- name: Checkout test blocks and plots
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: 'Chia-Network/test-cache'
path: '.chia'
ref: '0.28.0'
fetch-depth: 1
- name: Link home directory
run: |
cd $HOME
ln -s $GITHUB_WORKSPACE/.chia
echo "$HOME/.chia"
ls -al $HOME/.chia
- name: Run install script
env:
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
@ -89,7 +85,23 @@ jobs:
- name: Test core-custom_types code with pytest
run: |
. ./activate
./venv/bin/py.test tests/core/custom_types/test_*.py -s -v --durations 0 -n 4 -m "not benchmark"
venv/bin/coverage run --rcfile=.coveragerc ./venv/bin/py.test tests/core/custom_types/test_*.py -s -v --durations 0 -n 4 -m "not benchmark"
- 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@v2
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
#

View file

@ -29,10 +29,13 @@ jobs:
matrix:
python-version: [3.8, 3.9]
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@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
@ -54,7 +57,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
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 }}
@ -63,20 +66,13 @@ jobs:
${{ runner.os }}-pip-
- name: Checkout test blocks and plots
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: 'Chia-Network/test-cache'
path: '.chia'
ref: '0.28.0'
fetch-depth: 1
- name: Link home directory
run: |
cd $HOME
ln -s $GITHUB_WORKSPACE/.chia
echo "$HOME/.chia"
ls -al $HOME/.chia
- name: Run install script
env:
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
@ -101,7 +97,23 @@ jobs:
- name: Test core-daemon code with pytest
run: |
. ./activate
./venv/bin/py.test tests/core/daemon/test_*.py -s -v --durations 0 -n 0 -m "not benchmark"
venv/bin/coverage run --rcfile=.coveragerc ./venv/bin/py.test tests/core/daemon/test_*.py -s -v --durations 0 -n 0 -m "not benchmark"
- 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@v2
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
#

View file

@ -29,10 +29,13 @@ jobs:
matrix:
python-version: [3.8, 3.9]
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@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
@ -54,7 +57,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
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 }}
@ -63,20 +66,13 @@ jobs:
${{ runner.os }}-pip-
- name: Checkout test blocks and plots
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: 'Chia-Network/test-cache'
path: '.chia'
ref: '0.28.0'
fetch-depth: 1
- name: Link home directory
run: |
cd $HOME
ln -s $GITHUB_WORKSPACE/.chia
echo "$HOME/.chia"
ls -al $HOME/.chia
- name: Run install script
env:
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
@ -89,7 +85,23 @@ jobs:
- name: Test core-full_node-full_sync code with pytest
run: |
. ./activate
./venv/bin/py.test tests/core/full_node/full_sync/test_*.py -s -v --durations 0 -n 0 -m "not benchmark"
venv/bin/coverage run --rcfile=.coveragerc ./venv/bin/py.test tests/core/full_node/full_sync/test_*.py -s -v --durations 0 -n 0 -m "not benchmark"
- 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@v2
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
#

View file

@ -29,10 +29,13 @@ jobs:
matrix:
python-version: [3.8, 3.9]
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@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
@ -54,7 +57,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
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 }}
@ -63,20 +66,13 @@ jobs:
${{ runner.os }}-pip-
- name: Checkout test blocks and plots
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: 'Chia-Network/test-cache'
path: '.chia'
ref: '0.28.0'
fetch-depth: 1
- name: Link home directory
run: |
cd $HOME
ln -s $GITHUB_WORKSPACE/.chia
echo "$HOME/.chia"
ls -al $HOME/.chia
- name: Run install script
env:
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
@ -89,7 +85,23 @@ jobs:
- name: Test core-full_node-stores code with pytest
run: |
. ./activate
./venv/bin/py.test tests/core/full_node/stores/test_*.py -s -v --durations 0 -n 4 -m "not benchmark"
venv/bin/coverage run --rcfile=.coveragerc ./venv/bin/py.test tests/core/full_node/stores/test_*.py -s -v --durations 0 -n 4 -m "not benchmark"
- 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@v2
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
#

View file

@ -29,10 +29,13 @@ jobs:
matrix:
python-version: [3.8, 3.9]
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@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
@ -54,7 +57,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
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 }}
@ -63,20 +66,13 @@ jobs:
${{ runner.os }}-pip-
- name: Checkout test blocks and plots
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: 'Chia-Network/test-cache'
path: '.chia'
ref: '0.28.0'
fetch-depth: 1
- name: Link home directory
run: |
cd $HOME
ln -s $GITHUB_WORKSPACE/.chia
echo "$HOME/.chia"
ls -al $HOME/.chia
- name: Run install script
env:
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
@ -89,7 +85,23 @@ jobs:
- name: Test core-full_node code with pytest
run: |
. ./activate
./venv/bin/py.test tests/core/full_node/test_*.py -s -v --durations 0 -n 4 -m "not benchmark"
venv/bin/coverage run --rcfile=.coveragerc ./venv/bin/py.test tests/core/full_node/test_*.py -s -v --durations 0 -n 4 -m "not benchmark"
- 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@v2
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
#

View file

@ -29,10 +29,13 @@ jobs:
matrix:
python-version: [3.8, 3.9]
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@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
@ -54,7 +57,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
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 }}
@ -63,20 +66,13 @@ jobs:
${{ runner.os }}-pip-
- name: Checkout test blocks and plots
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: 'Chia-Network/test-cache'
path: '.chia'
ref: '0.28.0'
fetch-depth: 1
- name: Link home directory
run: |
cd $HOME
ln -s $GITHUB_WORKSPACE/.chia
echo "$HOME/.chia"
ls -al $HOME/.chia
- name: Run install script
env:
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
@ -89,7 +85,23 @@ jobs:
- name: Test core-server code with pytest
run: |
. ./activate
./venv/bin/py.test tests/core/server/test_*.py -s -v --durations 0 -n 0 -m "not benchmark"
venv/bin/coverage run --rcfile=.coveragerc ./venv/bin/py.test tests/core/server/test_*.py -s -v --durations 0 -n 0 -m "not benchmark"
- 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@v2
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
#

View file

@ -29,10 +29,13 @@ jobs:
matrix:
python-version: [3.8, 3.9]
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@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
@ -54,7 +57,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
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 }}
@ -63,20 +66,13 @@ jobs:
${{ runner.os }}-pip-
- name: Checkout test blocks and plots
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: 'Chia-Network/test-cache'
path: '.chia'
ref: '0.28.0'
fetch-depth: 1
- name: Link home directory
run: |
cd $HOME
ln -s $GITHUB_WORKSPACE/.chia
echo "$HOME/.chia"
ls -al $HOME/.chia
- name: Run install script
env:
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
@ -89,7 +85,23 @@ jobs:
- name: Test core-ssl code with pytest
run: |
. ./activate
./venv/bin/py.test tests/core/ssl/test_*.py -s -v --durations 0 -n 0 -m "not benchmark"
venv/bin/coverage run --rcfile=.coveragerc ./venv/bin/py.test tests/core/ssl/test_*.py -s -v --durations 0 -n 0 -m "not benchmark"
- 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@v2
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
#

View file

@ -29,10 +29,13 @@ jobs:
matrix:
python-version: [3.8, 3.9]
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@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
@ -54,7 +57,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
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 }}
@ -63,20 +66,13 @@ jobs:
${{ runner.os }}-pip-
- name: Checkout test blocks and plots
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: 'Chia-Network/test-cache'
path: '.chia'
ref: '0.28.0'
fetch-depth: 1
- name: Link home directory
run: |
cd $HOME
ln -s $GITHUB_WORKSPACE/.chia
echo "$HOME/.chia"
ls -al $HOME/.chia
- name: Run install script
env:
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
@ -89,7 +85,23 @@ jobs:
- name: Test core-util code with pytest
run: |
. ./activate
./venv/bin/py.test tests/core/util/test_*.py -s -v --durations 0 -n 0 -m "not benchmark"
venv/bin/coverage run --rcfile=.coveragerc ./venv/bin/py.test tests/core/util/test_*.py -s -v --durations 0 -n 0 -m "not benchmark"
- 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@v2
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
#

View file

@ -29,10 +29,13 @@ jobs:
matrix:
python-version: [3.8, 3.9]
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@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
@ -54,7 +57,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
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 }}
@ -63,20 +66,13 @@ jobs:
${{ runner.os }}-pip-
- name: Checkout test blocks and plots
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: 'Chia-Network/test-cache'
path: '.chia'
ref: '0.28.0'
fetch-depth: 1
- name: Link home directory
run: |
cd $HOME
ln -s $GITHUB_WORKSPACE/.chia
echo "$HOME/.chia"
ls -al $HOME/.chia
- name: Run install script
env:
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
@ -89,7 +85,23 @@ jobs:
- name: Test core code with pytest
run: |
. ./activate
./venv/bin/py.test tests/core/test_*.py -s -v --durations 0 -n 0 -m "not benchmark"
venv/bin/coverage run --rcfile=.coveragerc ./venv/bin/py.test tests/core/test_*.py -s -v --durations 0 -n 0 -m "not benchmark"
- 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@v2
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
#

View file

@ -29,10 +29,13 @@ jobs:
matrix:
python-version: [3.8, 3.9]
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@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
@ -54,7 +57,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
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 }}
@ -63,20 +66,13 @@ jobs:
${{ runner.os }}-pip-
- name: Checkout test blocks and plots
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: 'Chia-Network/test-cache'
path: '.chia'
ref: '0.28.0'
fetch-depth: 1
- name: Link home directory
run: |
cd $HOME
ln -s $GITHUB_WORKSPACE/.chia
echo "$HOME/.chia"
ls -al $HOME/.chia
- name: Run install script
env:
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
@ -89,7 +85,23 @@ jobs:
- name: Test farmer_harvester code with pytest
run: |
. ./activate
./venv/bin/py.test tests/farmer_harvester/test_*.py -s -v --durations 0 -n 0 -m "not benchmark"
venv/bin/coverage run --rcfile=.coveragerc ./venv/bin/py.test tests/farmer_harvester/test_*.py -s -v --durations 0 -n 0 -m "not benchmark"
- 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@v2
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
#

View file

@ -29,10 +29,13 @@ jobs:
matrix:
python-version: [3.8, 3.9]
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@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
@ -54,7 +57,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
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 }}
@ -63,20 +66,13 @@ jobs:
${{ runner.os }}-pip-
- name: Checkout test blocks and plots
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: 'Chia-Network/test-cache'
path: '.chia'
ref: '0.28.0'
fetch-depth: 1
- name: Link home directory
run: |
cd $HOME
ln -s $GITHUB_WORKSPACE/.chia
echo "$HOME/.chia"
ls -al $HOME/.chia
- name: Run install script
env:
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
@ -89,7 +85,23 @@ jobs:
- name: Test generator code with pytest
run: |
. ./activate
./venv/bin/py.test tests/generator/test_*.py -s -v --durations 0 -n 4 -m "not benchmark"
venv/bin/coverage run --rcfile=.coveragerc ./venv/bin/py.test tests/generator/test_*.py -s -v --durations 0 -n 4 -m "not benchmark"
- 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@v2
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
#

View file

@ -29,10 +29,13 @@ jobs:
matrix:
python-version: [3.8, 3.9]
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@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
@ -54,7 +57,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
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 }}
@ -63,20 +66,13 @@ jobs:
${{ runner.os }}-pip-
- name: Checkout test blocks and plots
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: 'Chia-Network/test-cache'
path: '.chia'
ref: '0.28.0'
fetch-depth: 1
- name: Link home directory
run: |
cd $HOME
ln -s $GITHUB_WORKSPACE/.chia
echo "$HOME/.chia"
ls -al $HOME/.chia
- name: Run install script
env:
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
@ -89,7 +85,23 @@ jobs:
- name: Test plotting code with pytest
run: |
. ./activate
./venv/bin/py.test tests/plotting/test_*.py -s -v --durations 0 -n 4 -m "not benchmark"
venv/bin/coverage run --rcfile=.coveragerc ./venv/bin/py.test tests/plotting/test_*.py -s -v --durations 0 -n 4 -m "not benchmark"
- 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@v2
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
#

View file

@ -29,10 +29,13 @@ jobs:
matrix:
python-version: [3.8, 3.9]
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@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
@ -54,7 +57,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
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 }}
@ -63,20 +66,13 @@ jobs:
${{ runner.os }}-pip-
- name: Checkout test blocks and plots
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: 'Chia-Network/test-cache'
path: '.chia'
ref: '0.28.0'
fetch-depth: 1
- name: Link home directory
run: |
cd $HOME
ln -s $GITHUB_WORKSPACE/.chia
echo "$HOME/.chia"
ls -al $HOME/.chia
- name: Run install script
env:
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
@ -89,7 +85,23 @@ jobs:
- name: Test pools code with pytest
run: |
. ./activate
./venv/bin/py.test tests/pools/test_*.py -s -v --durations 0 -n 0 -m "not benchmark"
venv/bin/coverage run --rcfile=.coveragerc ./venv/bin/py.test tests/pools/test_*.py -s -v --durations 0 -n 0 -m "not benchmark"
- 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@v2
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
#

View file

@ -29,10 +29,13 @@ jobs:
matrix:
python-version: [3.8, 3.9]
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@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
@ -54,7 +57,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
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 }}
@ -63,20 +66,13 @@ jobs:
${{ runner.os }}-pip-
- name: Checkout test blocks and plots
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: 'Chia-Network/test-cache'
path: '.chia'
ref: '0.28.0'
fetch-depth: 1
- name: Link home directory
run: |
cd $HOME
ln -s $GITHUB_WORKSPACE/.chia
echo "$HOME/.chia"
ls -al $HOME/.chia
- name: Run install script
env:
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
@ -101,7 +97,23 @@ jobs:
- name: Test simulation code with pytest
run: |
. ./activate
./venv/bin/py.test tests/simulation/test_*.py -s -v --durations 0 -n 0 -m "not benchmark"
venv/bin/coverage run --rcfile=.coveragerc ./venv/bin/py.test tests/simulation/test_*.py -s -v --durations 0 -n 0 -m "not benchmark"
- 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@v2
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
#

View file

@ -29,10 +29,13 @@ jobs:
matrix:
python-version: [3.8, 3.9]
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@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
@ -54,7 +57,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
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 }}
@ -63,20 +66,13 @@ jobs:
${{ runner.os }}-pip-
- name: Checkout test blocks and plots
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: 'Chia-Network/test-cache'
path: '.chia'
ref: '0.28.0'
fetch-depth: 1
- name: Link home directory
run: |
cd $HOME
ln -s $GITHUB_WORKSPACE/.chia
echo "$HOME/.chia"
ls -al $HOME/.chia
- name: Run install script
env:
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
@ -89,7 +85,23 @@ jobs:
- name: Test tools code with pytest
run: |
. ./activate
./venv/bin/py.test tests/tools/test_*.py -s -v --durations 0 -n 4 -m "not benchmark"
venv/bin/coverage run --rcfile=.coveragerc ./venv/bin/py.test tests/tools/test_*.py -s -v --durations 0 -n 4 -m "not benchmark"
- 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@v2
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
#

View file

@ -29,10 +29,13 @@ jobs:
matrix:
python-version: [3.8, 3.9]
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@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
@ -54,7 +57,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
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 }}
@ -63,20 +66,13 @@ jobs:
${{ runner.os }}-pip-
- name: Checkout test blocks and plots
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: 'Chia-Network/test-cache'
path: '.chia'
ref: '0.28.0'
fetch-depth: 1
- name: Link home directory
run: |
cd $HOME
ln -s $GITHUB_WORKSPACE/.chia
echo "$HOME/.chia"
ls -al $HOME/.chia
- name: Run install script
env:
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
@ -89,7 +85,23 @@ jobs:
- name: Test util code with pytest
run: |
. ./activate
./venv/bin/py.test tests/util/test_*.py -s -v --durations 0 -n 4 -m "not benchmark"
venv/bin/coverage run --rcfile=.coveragerc ./venv/bin/py.test tests/util/test_*.py -s -v --durations 0 -n 4 -m "not benchmark"
- 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@v2
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
#

View file

@ -29,10 +29,13 @@ jobs:
matrix:
python-version: [3.8, 3.9]
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@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
@ -54,7 +57,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
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 }}
@ -63,20 +66,13 @@ jobs:
${{ runner.os }}-pip-
- name: Checkout test blocks and plots
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: 'Chia-Network/test-cache'
path: '.chia'
ref: '0.28.0'
fetch-depth: 1
- name: Link home directory
run: |
cd $HOME
ln -s $GITHUB_WORKSPACE/.chia
echo "$HOME/.chia"
ls -al $HOME/.chia
- name: Run install script
env:
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
@ -89,7 +85,23 @@ jobs:
- name: Test wallet-cat_wallet code with pytest
run: |
. ./activate
./venv/bin/py.test tests/wallet/cat_wallet/test_*.py -s -v --durations 0 -n 0 -m "not benchmark"
venv/bin/coverage run --rcfile=.coveragerc ./venv/bin/py.test tests/wallet/cat_wallet/test_*.py -s -v --durations 0 -n 0 -m "not benchmark"
- 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@v2
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
#

View file

@ -29,10 +29,13 @@ jobs:
matrix:
python-version: [3.8, 3.9]
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@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
@ -54,7 +57,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
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 }}
@ -63,20 +66,13 @@ jobs:
${{ runner.os }}-pip-
- name: Checkout test blocks and plots
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: 'Chia-Network/test-cache'
path: '.chia'
ref: '0.28.0'
fetch-depth: 1
- name: Link home directory
run: |
cd $HOME
ln -s $GITHUB_WORKSPACE/.chia
echo "$HOME/.chia"
ls -al $HOME/.chia
- name: Run install script
env:
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
@ -89,7 +85,23 @@ jobs:
- name: Test wallet-did_wallet code with pytest
run: |
. ./activate
./venv/bin/py.test tests/wallet/did_wallet/test_*.py -s -v --durations 0 -n 0 -m "not benchmark"
venv/bin/coverage run --rcfile=.coveragerc ./venv/bin/py.test tests/wallet/did_wallet/test_*.py -s -v --durations 0 -n 0 -m "not benchmark"
- 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@v2
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
#

View file

@ -29,10 +29,13 @@ jobs:
matrix:
python-version: [3.8, 3.9]
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@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
@ -54,7 +57,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
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 }}
@ -63,20 +66,13 @@ jobs:
${{ runner.os }}-pip-
- name: Checkout test blocks and plots
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: 'Chia-Network/test-cache'
path: '.chia'
ref: '0.28.0'
fetch-depth: 1
- name: Link home directory
run: |
cd $HOME
ln -s $GITHUB_WORKSPACE/.chia
echo "$HOME/.chia"
ls -al $HOME/.chia
- name: Run install script
env:
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
@ -89,7 +85,23 @@ jobs:
- name: Test wallet-rl_wallet code with pytest
run: |
. ./activate
./venv/bin/py.test tests/wallet/rl_wallet/test_*.py -s -v --durations 0 -n 0 -m "not benchmark"
venv/bin/coverage run --rcfile=.coveragerc ./venv/bin/py.test tests/wallet/rl_wallet/test_*.py -s -v --durations 0 -n 0 -m "not benchmark"
- 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@v2
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
#

View file

@ -29,10 +29,13 @@ jobs:
matrix:
python-version: [3.8, 3.9]
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@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
@ -54,7 +57,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
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 }}
@ -63,20 +66,13 @@ jobs:
${{ runner.os }}-pip-
- name: Checkout test blocks and plots
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: 'Chia-Network/test-cache'
path: '.chia'
ref: '0.28.0'
fetch-depth: 1
- name: Link home directory
run: |
cd $HOME
ln -s $GITHUB_WORKSPACE/.chia
echo "$HOME/.chia"
ls -al $HOME/.chia
- name: Run install script
env:
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
@ -89,7 +85,23 @@ jobs:
- name: Test wallet-rpc code with pytest
run: |
. ./activate
./venv/bin/py.test tests/wallet/rpc/test_*.py -s -v --durations 0 -n 0 -m "not benchmark"
venv/bin/coverage run --rcfile=.coveragerc ./venv/bin/py.test tests/wallet/rpc/test_*.py -s -v --durations 0 -n 0 -m "not benchmark"
- 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@v2
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
#

View file

@ -29,10 +29,13 @@ jobs:
matrix:
python-version: [3.8, 3.9]
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@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
@ -54,7 +57,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
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 }}
@ -63,20 +66,13 @@ jobs:
${{ runner.os }}-pip-
- name: Checkout test blocks and plots
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: 'Chia-Network/test-cache'
path: '.chia'
ref: '0.28.0'
fetch-depth: 1
- name: Link home directory
run: |
cd $HOME
ln -s $GITHUB_WORKSPACE/.chia
echo "$HOME/.chia"
ls -al $HOME/.chia
- name: Run install script
env:
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
@ -89,7 +85,23 @@ jobs:
- name: Test wallet-simple_sync code with pytest
run: |
. ./activate
./venv/bin/py.test tests/wallet/simple_sync/test_*.py -s -v --durations 0 -n 0 -m "not benchmark"
venv/bin/coverage run --rcfile=.coveragerc ./venv/bin/py.test tests/wallet/simple_sync/test_*.py -s -v --durations 0 -n 0 -m "not benchmark"
- 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@v2
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
#

View file

@ -29,10 +29,13 @@ jobs:
matrix:
python-version: [3.8, 3.9]
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@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
@ -54,7 +57,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
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 }}
@ -63,20 +66,13 @@ jobs:
${{ runner.os }}-pip-
- name: Checkout test blocks and plots
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: 'Chia-Network/test-cache'
path: '.chia'
ref: '0.28.0'
fetch-depth: 1
- name: Link home directory
run: |
cd $HOME
ln -s $GITHUB_WORKSPACE/.chia
echo "$HOME/.chia"
ls -al $HOME/.chia
- name: Run install script
env:
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
@ -89,7 +85,23 @@ jobs:
- name: Test wallet-sync code with pytest
run: |
. ./activate
./venv/bin/py.test tests/wallet/sync/test_*.py -s -v --durations 0 -n 0 -m "not benchmark"
venv/bin/coverage run --rcfile=.coveragerc ./venv/bin/py.test tests/wallet/sync/test_*.py -s -v --durations 0 -n 0 -m "not benchmark"
- 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@v2
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
#

View file

@ -22,17 +22,20 @@ jobs:
build:
name: MacOS wallet Tests
runs-on: ${{ matrix.os }}
timeout-minutes: 30
timeout-minutes: 40
strategy:
fail-fast: false
max-parallel: 4
matrix:
python-version: [3.8, 3.9]
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@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
@ -54,7 +57,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
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 }}
@ -63,20 +66,13 @@ jobs:
${{ runner.os }}-pip-
- name: Checkout test blocks and plots
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: 'Chia-Network/test-cache'
path: '.chia'
ref: '0.28.0'
fetch-depth: 1
- name: Link home directory
run: |
cd $HOME
ln -s $GITHUB_WORKSPACE/.chia
echo "$HOME/.chia"
ls -al $HOME/.chia
- name: Run install script
env:
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
@ -89,7 +85,23 @@ jobs:
- name: Test wallet code with pytest
run: |
. ./activate
./venv/bin/py.test tests/wallet/test_*.py -s -v --durations 0 -n 4 -m "not benchmark"
venv/bin/coverage run --rcfile=.coveragerc ./venv/bin/py.test tests/wallet/test_*.py -s -v --durations 0 -n 4 -m "not benchmark"
- 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@v2
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
#

View file

@ -29,10 +29,13 @@ jobs:
matrix:
python-version: [3.8, 3.9]
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@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
@ -54,7 +57,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
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 }}
@ -63,20 +66,13 @@ jobs:
${{ runner.os }}-pip-
- name: Checkout test blocks and plots
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: 'Chia-Network/test-cache'
path: '.chia'
ref: '0.28.0'
fetch-depth: 1
- name: Link home directory
run: |
cd $HOME
ln -s $GITHUB_WORKSPACE/.chia
echo "$HOME/.chia"
ls -al $HOME/.chia
- name: Run install script
env:
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
@ -89,7 +85,23 @@ jobs:
- name: Test weight_proof code with pytest
run: |
. ./activate
./venv/bin/py.test tests/weight_proof/test_*.py -s -v --durations 0 -n 4 -m "not benchmark"
venv/bin/coverage run --rcfile=.coveragerc ./venv/bin/py.test tests/weight_proof/test_*.py -s -v --durations 0 -n 4 -m "not benchmark"
- 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@v2
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
#

View file

@ -29,10 +29,13 @@ jobs:
matrix:
python-version: [3.7, 3.8, 3.9]
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@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
@ -42,7 +45,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Cache npm
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
@ -55,7 +58,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
@ -63,20 +66,13 @@ jobs:
${{ runner.os }}-pip-
- name: Checkout test blocks and plots
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: 'Chia-Network/test-cache'
path: '.chia'
ref: '0.28.0'
fetch-depth: 1
- name: Link home directory
run: |
cd $HOME
ln -s $GITHUB_WORKSPACE/.chia
echo "$HOME/.chia"
ls -al $HOME/.chia
- name: Run install script
env:
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
@ -88,8 +84,25 @@ jobs:
- name: Test blockchain code with pytest
run: |
. ./activate
./venv/bin/py.test tests/blockchain/test_*.py -s -v --durations 0 -n 4 -m "not benchmark"
venv/bin/coverage run --rcfile=.coveragerc ./venv/bin/py.test tests/blockchain/test_*.py -s -v --durations 0 -n 4 -m "not benchmark" -p no:monitor
- 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@v2
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

View file

@ -29,10 +29,13 @@ jobs:
matrix:
python-version: [3.7, 3.8, 3.9]
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@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
@ -42,7 +45,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Cache npm
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
@ -55,7 +58,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
@ -75,8 +78,25 @@ jobs:
- name: Test clvm code with pytest
run: |
. ./activate
./venv/bin/py.test tests/clvm/test_*.py -s -v --durations 0 -n 4 -m "not benchmark"
venv/bin/coverage run --rcfile=.coveragerc ./venv/bin/py.test tests/clvm/test_*.py -s -v --durations 0 -n 4 -m "not benchmark" -p no:monitor
- 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@v2
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

View file

@ -29,10 +29,13 @@ jobs:
matrix:
python-version: [3.7, 3.8, 3.9]
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@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
@ -42,7 +45,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Cache npm
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
@ -55,7 +58,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
@ -63,20 +66,13 @@ jobs:
${{ runner.os }}-pip-
- name: Checkout test blocks and plots
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: 'Chia-Network/test-cache'
path: '.chia'
ref: '0.28.0'
fetch-depth: 1
- name: Link home directory
run: |
cd $HOME
ln -s $GITHUB_WORKSPACE/.chia
echo "$HOME/.chia"
ls -al $HOME/.chia
- name: Run install script
env:
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
@ -88,8 +84,25 @@ jobs:
- name: Test core-cmds code with pytest
run: |
. ./activate
./venv/bin/py.test tests/core/cmds/test_*.py -s -v --durations 0 -n 4 -m "not benchmark"
venv/bin/coverage run --rcfile=.coveragerc ./venv/bin/py.test tests/core/cmds/test_*.py -s -v --durations 0 -n 4 -m "not benchmark" -p no:monitor
- 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@v2
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

View file

@ -29,10 +29,13 @@ jobs:
matrix:
python-version: [3.7, 3.8, 3.9]
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@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
@ -42,7 +45,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Cache npm
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
@ -55,7 +58,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
@ -63,20 +66,13 @@ jobs:
${{ runner.os }}-pip-
- name: Checkout test blocks and plots
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: 'Chia-Network/test-cache'
path: '.chia'
ref: '0.28.0'
fetch-depth: 1
- name: Link home directory
run: |
cd $HOME
ln -s $GITHUB_WORKSPACE/.chia
echo "$HOME/.chia"
ls -al $HOME/.chia
- name: Run install script
env:
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
@ -88,8 +84,25 @@ jobs:
- name: Test core-consensus code with pytest
run: |
. ./activate
./venv/bin/py.test tests/core/consensus/test_*.py -s -v --durations 0 -n 4 -m "not benchmark"
venv/bin/coverage run --rcfile=.coveragerc ./venv/bin/py.test tests/core/consensus/test_*.py -s -v --durations 0 -n 4 -m "not benchmark" -p no:monitor
- 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@v2
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

View file

@ -29,10 +29,13 @@ jobs:
matrix:
python-version: [3.7, 3.8, 3.9]
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@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
@ -42,7 +45,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Cache npm
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
@ -55,7 +58,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
@ -63,20 +66,13 @@ jobs:
${{ runner.os }}-pip-
- name: Checkout test blocks and plots
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: 'Chia-Network/test-cache'
path: '.chia'
ref: '0.28.0'
fetch-depth: 1
- name: Link home directory
run: |
cd $HOME
ln -s $GITHUB_WORKSPACE/.chia
echo "$HOME/.chia"
ls -al $HOME/.chia
- name: Run install script
env:
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
@ -88,8 +84,25 @@ jobs:
- name: Test core-custom_types code with pytest
run: |
. ./activate
./venv/bin/py.test tests/core/custom_types/test_*.py -s -v --durations 0 -n 4 -m "not benchmark"
venv/bin/coverage run --rcfile=.coveragerc ./venv/bin/py.test tests/core/custom_types/test_*.py -s -v --durations 0 -n 4 -m "not benchmark" -p no:monitor
- 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@v2
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

View file

@ -29,10 +29,13 @@ jobs:
matrix:
python-version: [3.7, 3.8, 3.9]
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@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
@ -42,7 +45,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Cache npm
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
@ -55,7 +58,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
@ -63,20 +66,13 @@ jobs:
${{ runner.os }}-pip-
- name: Checkout test blocks and plots
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: 'Chia-Network/test-cache'
path: '.chia'
ref: '0.28.0'
fetch-depth: 1
- name: Link home directory
run: |
cd $HOME
ln -s $GITHUB_WORKSPACE/.chia
echo "$HOME/.chia"
ls -al $HOME/.chia
- name: Run install script
env:
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
@ -100,8 +96,25 @@ jobs:
- name: Test core-daemon code with pytest
run: |
. ./activate
./venv/bin/py.test tests/core/daemon/test_*.py -s -v --durations 0 -n 0 -m "not benchmark"
venv/bin/coverage run --rcfile=.coveragerc ./venv/bin/py.test tests/core/daemon/test_*.py -s -v --durations 0 -n 0 -m "not benchmark" -p no:monitor
- 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@v2
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

View file

@ -29,10 +29,13 @@ jobs:
matrix:
python-version: [3.7, 3.8, 3.9]
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@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
@ -42,7 +45,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Cache npm
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
@ -55,7 +58,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
@ -63,20 +66,13 @@ jobs:
${{ runner.os }}-pip-
- name: Checkout test blocks and plots
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: 'Chia-Network/test-cache'
path: '.chia'
ref: '0.28.0'
fetch-depth: 1
- name: Link home directory
run: |
cd $HOME
ln -s $GITHUB_WORKSPACE/.chia
echo "$HOME/.chia"
ls -al $HOME/.chia
- name: Run install script
env:
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
@ -88,8 +84,25 @@ jobs:
- name: Test core-full_node-full_sync code with pytest
run: |
. ./activate
./venv/bin/py.test tests/core/full_node/full_sync/test_*.py -s -v --durations 0 -n 0 -m "not benchmark"
venv/bin/coverage run --rcfile=.coveragerc ./venv/bin/py.test tests/core/full_node/full_sync/test_*.py -s -v --durations 0 -n 0 -m "not benchmark" -p no:monitor
- 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@v2
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

View file

@ -29,10 +29,13 @@ jobs:
matrix:
python-version: [3.7, 3.8, 3.9]
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@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
@ -42,7 +45,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Cache npm
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
@ -55,7 +58,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
@ -63,20 +66,13 @@ jobs:
${{ runner.os }}-pip-
- name: Checkout test blocks and plots
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: 'Chia-Network/test-cache'
path: '.chia'
ref: '0.28.0'
fetch-depth: 1
- name: Link home directory
run: |
cd $HOME
ln -s $GITHUB_WORKSPACE/.chia
echo "$HOME/.chia"
ls -al $HOME/.chia
- name: Run install script
env:
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
@ -88,8 +84,23 @@ jobs:
- name: Test core-full_node-stores code with pytest
run: |
. ./activate
./venv/bin/py.test tests/core/full_node/stores/test_*.py -s -v --durations 0 -n 4 -m "not benchmark"
venv/bin/coverage run --rcfile=.coveragerc ./venv/bin/py.test tests/core/full_node/stores/test_*.py -s -v --durations 0 -n 4 -m "not benchmark"
- 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@v2
with:
name: coverage
path: coverage_reports/*
if-no-files-found: error
- name: Check resource usage
run: |

View file

@ -29,10 +29,13 @@ jobs:
matrix:
python-version: [3.7, 3.8, 3.9]
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@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
@ -42,7 +45,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Cache npm
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
@ -55,7 +58,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
@ -63,20 +66,13 @@ jobs:
${{ runner.os }}-pip-
- name: Checkout test blocks and plots
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: 'Chia-Network/test-cache'
path: '.chia'
ref: '0.28.0'
fetch-depth: 1
- name: Link home directory
run: |
cd $HOME
ln -s $GITHUB_WORKSPACE/.chia
echo "$HOME/.chia"
ls -al $HOME/.chia
- name: Run install script
env:
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
@ -88,8 +84,23 @@ jobs:
- name: Test core-full_node code with pytest
run: |
. ./activate
./venv/bin/py.test tests/core/full_node/test_*.py -s -v --durations 0 -n 4 -m "not benchmark"
venv/bin/coverage run --rcfile=.coveragerc ./venv/bin/py.test tests/core/full_node/test_*.py -s -v --durations 0 -n 4 -m "not benchmark"
- 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@v2
with:
name: coverage
path: coverage_reports/*
if-no-files-found: error
- name: Check resource usage
run: |

View file

@ -29,10 +29,13 @@ jobs:
matrix:
python-version: [3.7, 3.8, 3.9]
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@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
@ -42,7 +45,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Cache npm
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
@ -55,7 +58,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
@ -63,20 +66,13 @@ jobs:
${{ runner.os }}-pip-
- name: Checkout test blocks and plots
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: 'Chia-Network/test-cache'
path: '.chia'
ref: '0.28.0'
fetch-depth: 1
- name: Link home directory
run: |
cd $HOME
ln -s $GITHUB_WORKSPACE/.chia
echo "$HOME/.chia"
ls -al $HOME/.chia
- name: Run install script
env:
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
@ -88,8 +84,25 @@ jobs:
- name: Test core-server code with pytest
run: |
. ./activate
./venv/bin/py.test tests/core/server/test_*.py -s -v --durations 0 -n 0 -m "not benchmark"
venv/bin/coverage run --rcfile=.coveragerc ./venv/bin/py.test tests/core/server/test_*.py -s -v --durations 0 -n 0 -m "not benchmark" -p no:monitor
- 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@v2
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

View file

@ -29,10 +29,13 @@ jobs:
matrix:
python-version: [3.7, 3.8, 3.9]
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@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
@ -42,7 +45,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Cache npm
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
@ -55,7 +58,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
@ -63,20 +66,13 @@ jobs:
${{ runner.os }}-pip-
- name: Checkout test blocks and plots
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: 'Chia-Network/test-cache'
path: '.chia'
ref: '0.28.0'
fetch-depth: 1
- name: Link home directory
run: |
cd $HOME
ln -s $GITHUB_WORKSPACE/.chia
echo "$HOME/.chia"
ls -al $HOME/.chia
- name: Run install script
env:
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
@ -88,8 +84,25 @@ jobs:
- name: Test core-ssl code with pytest
run: |
. ./activate
./venv/bin/py.test tests/core/ssl/test_*.py -s -v --durations 0 -n 0 -m "not benchmark"
venv/bin/coverage run --rcfile=.coveragerc ./venv/bin/py.test tests/core/ssl/test_*.py -s -v --durations 0 -n 0 -m "not benchmark" -p no:monitor
- 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@v2
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

View file

@ -29,10 +29,13 @@ jobs:
matrix:
python-version: [3.7, 3.8, 3.9]
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@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
@ -42,7 +45,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Cache npm
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
@ -55,7 +58,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
@ -63,20 +66,13 @@ jobs:
${{ runner.os }}-pip-
- name: Checkout test blocks and plots
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: 'Chia-Network/test-cache'
path: '.chia'
ref: '0.28.0'
fetch-depth: 1
- name: Link home directory
run: |
cd $HOME
ln -s $GITHUB_WORKSPACE/.chia
echo "$HOME/.chia"
ls -al $HOME/.chia
- name: Run install script
env:
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
@ -88,8 +84,25 @@ jobs:
- name: Test core-util code with pytest
run: |
. ./activate
./venv/bin/py.test tests/core/util/test_*.py -s -v --durations 0 -n 0 -m "not benchmark"
venv/bin/coverage run --rcfile=.coveragerc ./venv/bin/py.test tests/core/util/test_*.py -s -v --durations 0 -n 0 -m "not benchmark" -p no:monitor
- 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@v2
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

View file

@ -29,10 +29,13 @@ jobs:
matrix:
python-version: [3.7, 3.8, 3.9]
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@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
@ -42,7 +45,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Cache npm
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
@ -55,7 +58,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
@ -63,20 +66,13 @@ jobs:
${{ runner.os }}-pip-
- name: Checkout test blocks and plots
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: 'Chia-Network/test-cache'
path: '.chia'
ref: '0.28.0'
fetch-depth: 1
- name: Link home directory
run: |
cd $HOME
ln -s $GITHUB_WORKSPACE/.chia
echo "$HOME/.chia"
ls -al $HOME/.chia
- name: Run install script
env:
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
@ -88,8 +84,25 @@ jobs:
- name: Test core code with pytest
run: |
. ./activate
./venv/bin/py.test tests/core/test_*.py -s -v --durations 0 -n 0 -m "not benchmark"
venv/bin/coverage run --rcfile=.coveragerc ./venv/bin/py.test tests/core/test_*.py -s -v --durations 0 -n 0 -m "not benchmark" -p no:monitor
- 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@v2
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

View file

@ -29,10 +29,13 @@ jobs:
matrix:
python-version: [3.7, 3.8, 3.9]
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@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
@ -42,7 +45,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Cache npm
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
@ -55,7 +58,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
@ -63,20 +66,13 @@ jobs:
${{ runner.os }}-pip-
- name: Checkout test blocks and plots
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: 'Chia-Network/test-cache'
path: '.chia'
ref: '0.28.0'
fetch-depth: 1
- name: Link home directory
run: |
cd $HOME
ln -s $GITHUB_WORKSPACE/.chia
echo "$HOME/.chia"
ls -al $HOME/.chia
- name: Run install script
env:
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
@ -88,8 +84,25 @@ jobs:
- name: Test farmer_harvester code with pytest
run: |
. ./activate
./venv/bin/py.test tests/farmer_harvester/test_*.py -s -v --durations 0 -n 0 -m "not benchmark"
venv/bin/coverage run --rcfile=.coveragerc ./venv/bin/py.test tests/farmer_harvester/test_*.py -s -v --durations 0 -n 0 -m "not benchmark" -p no:monitor
- 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@v2
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

View file

@ -29,10 +29,13 @@ jobs:
matrix:
python-version: [3.7, 3.8, 3.9]
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@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
@ -42,7 +45,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Cache npm
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
@ -55,7 +58,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
@ -63,20 +66,13 @@ jobs:
${{ runner.os }}-pip-
- name: Checkout test blocks and plots
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: 'Chia-Network/test-cache'
path: '.chia'
ref: '0.28.0'
fetch-depth: 1
- name: Link home directory
run: |
cd $HOME
ln -s $GITHUB_WORKSPACE/.chia
echo "$HOME/.chia"
ls -al $HOME/.chia
- name: Run install script
env:
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
@ -88,8 +84,25 @@ jobs:
- name: Test generator code with pytest
run: |
. ./activate
./venv/bin/py.test tests/generator/test_*.py -s -v --durations 0 -n 4 -m "not benchmark"
venv/bin/coverage run --rcfile=.coveragerc ./venv/bin/py.test tests/generator/test_*.py -s -v --durations 0 -n 4 -m "not benchmark" -p no:monitor
- 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@v2
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

View file

@ -29,10 +29,13 @@ jobs:
matrix:
python-version: [3.7, 3.8, 3.9]
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@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
@ -42,7 +45,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Cache npm
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
@ -55,7 +58,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
@ -63,20 +66,13 @@ jobs:
${{ runner.os }}-pip-
- name: Checkout test blocks and plots
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: 'Chia-Network/test-cache'
path: '.chia'
ref: '0.28.0'
fetch-depth: 1
- name: Link home directory
run: |
cd $HOME
ln -s $GITHUB_WORKSPACE/.chia
echo "$HOME/.chia"
ls -al $HOME/.chia
- name: Run install script
env:
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
@ -88,8 +84,25 @@ jobs:
- name: Test plotting code with pytest
run: |
. ./activate
./venv/bin/py.test tests/plotting/test_*.py -s -v --durations 0 -n 4 -m "not benchmark"
venv/bin/coverage run --rcfile=.coveragerc ./venv/bin/py.test tests/plotting/test_*.py -s -v --durations 0 -n 4 -m "not benchmark" -p no:monitor
- 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@v2
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

View file

@ -29,10 +29,13 @@ jobs:
matrix:
python-version: [3.7, 3.8, 3.9]
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@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
@ -42,7 +45,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Cache npm
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
@ -55,7 +58,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
@ -63,20 +66,13 @@ jobs:
${{ runner.os }}-pip-
- name: Checkout test blocks and plots
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: 'Chia-Network/test-cache'
path: '.chia'
ref: '0.28.0'
fetch-depth: 1
- name: Link home directory
run: |
cd $HOME
ln -s $GITHUB_WORKSPACE/.chia
echo "$HOME/.chia"
ls -al $HOME/.chia
- name: Run install script
env:
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
@ -88,8 +84,25 @@ jobs:
- name: Test pools code with pytest
run: |
. ./activate
./venv/bin/py.test tests/pools/test_*.py -s -v --durations 0 -n 0 -m "not benchmark"
venv/bin/coverage run --rcfile=.coveragerc ./venv/bin/py.test tests/pools/test_*.py -s -v --durations 0 -n 0 -m "not benchmark" -p no:monitor
- 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@v2
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

View file

@ -29,10 +29,13 @@ jobs:
matrix:
python-version: [3.7, 3.8, 3.9]
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@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
@ -42,7 +45,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Cache npm
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
@ -55,7 +58,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
@ -63,20 +66,13 @@ jobs:
${{ runner.os }}-pip-
- name: Checkout test blocks and plots
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: 'Chia-Network/test-cache'
path: '.chia'
ref: '0.28.0'
fetch-depth: 1
- name: Link home directory
run: |
cd $HOME
ln -s $GITHUB_WORKSPACE/.chia
echo "$HOME/.chia"
ls -al $HOME/.chia
- name: Run install script
env:
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
@ -100,8 +96,25 @@ jobs:
- name: Test simulation code with pytest
run: |
. ./activate
./venv/bin/py.test tests/simulation/test_*.py -s -v --durations 0 -n 0 -m "not benchmark"
venv/bin/coverage run --rcfile=.coveragerc ./venv/bin/py.test tests/simulation/test_*.py -s -v --durations 0 -n 0 -m "not benchmark" -p no:monitor
- 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@v2
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

View file

@ -29,10 +29,13 @@ jobs:
matrix:
python-version: [3.7, 3.8, 3.9]
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@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
@ -42,7 +45,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Cache npm
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
@ -55,7 +58,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
@ -63,20 +66,13 @@ jobs:
${{ runner.os }}-pip-
- name: Checkout test blocks and plots
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: 'Chia-Network/test-cache'
path: '.chia'
ref: '0.28.0'
fetch-depth: 1
- name: Link home directory
run: |
cd $HOME
ln -s $GITHUB_WORKSPACE/.chia
echo "$HOME/.chia"
ls -al $HOME/.chia
- name: Run install script
env:
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
@ -88,8 +84,25 @@ jobs:
- name: Test tools code with pytest
run: |
. ./activate
./venv/bin/py.test tests/tools/test_*.py -s -v --durations 0 -n 4 -m "not benchmark"
venv/bin/coverage run --rcfile=.coveragerc ./venv/bin/py.test tests/tools/test_*.py -s -v --durations 0 -n 4 -m "not benchmark" -p no:monitor
- 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@v2
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

View file

@ -29,10 +29,13 @@ jobs:
matrix:
python-version: [3.7, 3.8, 3.9]
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@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
@ -42,7 +45,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Cache npm
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
@ -55,7 +58,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
@ -63,20 +66,13 @@ jobs:
${{ runner.os }}-pip-
- name: Checkout test blocks and plots
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: 'Chia-Network/test-cache'
path: '.chia'
ref: '0.28.0'
fetch-depth: 1
- name: Link home directory
run: |
cd $HOME
ln -s $GITHUB_WORKSPACE/.chia
echo "$HOME/.chia"
ls -al $HOME/.chia
- name: Run install script
env:
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
@ -88,8 +84,25 @@ jobs:
- name: Test util code with pytest
run: |
. ./activate
./venv/bin/py.test tests/util/test_*.py -s -v --durations 0 -n 4 -m "not benchmark"
venv/bin/coverage run --rcfile=.coveragerc ./venv/bin/py.test tests/util/test_*.py -s -v --durations 0 -n 4 -m "not benchmark" -p no:monitor
- 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@v2
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

View file

@ -29,10 +29,13 @@ jobs:
matrix:
python-version: [3.7, 3.8, 3.9]
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@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
@ -42,7 +45,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Cache npm
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
@ -55,7 +58,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
@ -63,20 +66,13 @@ jobs:
${{ runner.os }}-pip-
- name: Checkout test blocks and plots
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: 'Chia-Network/test-cache'
path: '.chia'
ref: '0.28.0'
fetch-depth: 1
- name: Link home directory
run: |
cd $HOME
ln -s $GITHUB_WORKSPACE/.chia
echo "$HOME/.chia"
ls -al $HOME/.chia
- name: Run install script
env:
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
@ -88,8 +84,25 @@ jobs:
- name: Test wallet-cat_wallet code with pytest
run: |
. ./activate
./venv/bin/py.test tests/wallet/cat_wallet/test_*.py -s -v --durations 0 -n 0 -m "not benchmark"
venv/bin/coverage run --rcfile=.coveragerc ./venv/bin/py.test tests/wallet/cat_wallet/test_*.py -s -v --durations 0 -n 0 -m "not benchmark" -p no:monitor
- 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@v2
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

View file

@ -29,10 +29,13 @@ jobs:
matrix:
python-version: [3.7, 3.8, 3.9]
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@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
@ -42,7 +45,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Cache npm
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
@ -55,7 +58,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
@ -63,20 +66,13 @@ jobs:
${{ runner.os }}-pip-
- name: Checkout test blocks and plots
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: 'Chia-Network/test-cache'
path: '.chia'
ref: '0.28.0'
fetch-depth: 1
- name: Link home directory
run: |
cd $HOME
ln -s $GITHUB_WORKSPACE/.chia
echo "$HOME/.chia"
ls -al $HOME/.chia
- name: Run install script
env:
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
@ -88,8 +84,25 @@ jobs:
- name: Test wallet-did_wallet code with pytest
run: |
. ./activate
./venv/bin/py.test tests/wallet/did_wallet/test_*.py -s -v --durations 0 -n 0 -m "not benchmark"
venv/bin/coverage run --rcfile=.coveragerc ./venv/bin/py.test tests/wallet/did_wallet/test_*.py -s -v --durations 0 -n 0 -m "not benchmark" -p no:monitor
- 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@v2
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

View file

@ -29,10 +29,13 @@ jobs:
matrix:
python-version: [3.7, 3.8, 3.9]
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@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
@ -42,7 +45,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Cache npm
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
@ -55,7 +58,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
@ -63,20 +66,13 @@ jobs:
${{ runner.os }}-pip-
- name: Checkout test blocks and plots
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: 'Chia-Network/test-cache'
path: '.chia'
ref: '0.28.0'
fetch-depth: 1
- name: Link home directory
run: |
cd $HOME
ln -s $GITHUB_WORKSPACE/.chia
echo "$HOME/.chia"
ls -al $HOME/.chia
- name: Run install script
env:
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
@ -88,8 +84,25 @@ jobs:
- name: Test wallet-rl_wallet code with pytest
run: |
. ./activate
./venv/bin/py.test tests/wallet/rl_wallet/test_*.py -s -v --durations 0 -n 0 -m "not benchmark"
venv/bin/coverage run --rcfile=.coveragerc ./venv/bin/py.test tests/wallet/rl_wallet/test_*.py -s -v --durations 0 -n 0 -m "not benchmark" -p no:monitor
- 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@v2
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

View file

@ -29,10 +29,13 @@ jobs:
matrix:
python-version: [3.7, 3.8, 3.9]
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@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
@ -42,7 +45,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Cache npm
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
@ -55,7 +58,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
@ -63,20 +66,13 @@ jobs:
${{ runner.os }}-pip-
- name: Checkout test blocks and plots
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: 'Chia-Network/test-cache'
path: '.chia'
ref: '0.28.0'
fetch-depth: 1
- name: Link home directory
run: |
cd $HOME
ln -s $GITHUB_WORKSPACE/.chia
echo "$HOME/.chia"
ls -al $HOME/.chia
- name: Run install script
env:
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
@ -88,8 +84,25 @@ jobs:
- name: Test wallet-rpc code with pytest
run: |
. ./activate
./venv/bin/py.test tests/wallet/rpc/test_*.py -s -v --durations 0 -n 0 -m "not benchmark"
venv/bin/coverage run --rcfile=.coveragerc ./venv/bin/py.test tests/wallet/rpc/test_*.py -s -v --durations 0 -n 0 -m "not benchmark" -p no:monitor
- 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@v2
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

View file

@ -29,10 +29,13 @@ jobs:
matrix:
python-version: [3.7, 3.8, 3.9]
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@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
@ -42,7 +45,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Cache npm
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
@ -55,7 +58,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
@ -63,20 +66,13 @@ jobs:
${{ runner.os }}-pip-
- name: Checkout test blocks and plots
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: 'Chia-Network/test-cache'
path: '.chia'
ref: '0.28.0'
fetch-depth: 1
- name: Link home directory
run: |
cd $HOME
ln -s $GITHUB_WORKSPACE/.chia
echo "$HOME/.chia"
ls -al $HOME/.chia
- name: Run install script
env:
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
@ -88,8 +84,25 @@ jobs:
- name: Test wallet-simple_sync code with pytest
run: |
. ./activate
./venv/bin/py.test tests/wallet/simple_sync/test_*.py -s -v --durations 0 -n 0 -m "not benchmark"
venv/bin/coverage run --rcfile=.coveragerc ./venv/bin/py.test tests/wallet/simple_sync/test_*.py -s -v --durations 0 -n 0 -m "not benchmark" -p no:monitor
- 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@v2
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

View file

@ -29,10 +29,13 @@ jobs:
matrix:
python-version: [3.7, 3.8, 3.9]
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@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
@ -42,7 +45,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Cache npm
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
@ -55,7 +58,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
@ -63,20 +66,13 @@ jobs:
${{ runner.os }}-pip-
- name: Checkout test blocks and plots
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: 'Chia-Network/test-cache'
path: '.chia'
ref: '0.28.0'
fetch-depth: 1
- name: Link home directory
run: |
cd $HOME
ln -s $GITHUB_WORKSPACE/.chia
echo "$HOME/.chia"
ls -al $HOME/.chia
- name: Run install script
env:
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
@ -88,8 +84,25 @@ jobs:
- name: Test wallet-sync code with pytest
run: |
. ./activate
./venv/bin/py.test tests/wallet/sync/test_*.py -s -v --durations 0 -n 0 -m "not benchmark"
venv/bin/coverage run --rcfile=.coveragerc ./venv/bin/py.test tests/wallet/sync/test_*.py -s -v --durations 0 -n 0 -m "not benchmark" -p no:monitor
- 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@v2
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

View file

@ -22,17 +22,20 @@ jobs:
build:
name: Ubuntu wallet Test
runs-on: ${{ matrix.os }}
timeout-minutes: 30
timeout-minutes: 40
strategy:
fail-fast: false
max-parallel: 4
matrix:
python-version: [3.7, 3.8, 3.9]
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@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
@ -42,7 +45,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Cache npm
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
@ -55,7 +58,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
@ -63,20 +66,13 @@ jobs:
${{ runner.os }}-pip-
- name: Checkout test blocks and plots
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: 'Chia-Network/test-cache'
path: '.chia'
ref: '0.28.0'
fetch-depth: 1
- name: Link home directory
run: |
cd $HOME
ln -s $GITHUB_WORKSPACE/.chia
echo "$HOME/.chia"
ls -al $HOME/.chia
- name: Run install script
env:
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
@ -88,8 +84,25 @@ jobs:
- name: Test wallet code with pytest
run: |
. ./activate
./venv/bin/py.test tests/wallet/test_*.py -s -v --durations 0 -n 4 -m "not benchmark"
venv/bin/coverage run --rcfile=.coveragerc ./venv/bin/py.test tests/wallet/test_*.py -s -v --durations 0 -n 4 -m "not benchmark" -p no:monitor
- 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@v2
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

View file

@ -29,10 +29,13 @@ jobs:
matrix:
python-version: [3.7, 3.8, 3.9]
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@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
@ -42,7 +45,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Cache npm
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
@ -55,7 +58,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
@ -63,20 +66,13 @@ jobs:
${{ runner.os }}-pip-
- name: Checkout test blocks and plots
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: 'Chia-Network/test-cache'
path: '.chia'
ref: '0.28.0'
fetch-depth: 1
- name: Link home directory
run: |
cd $HOME
ln -s $GITHUB_WORKSPACE/.chia
echo "$HOME/.chia"
ls -al $HOME/.chia
- name: Run install script
env:
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
@ -88,8 +84,25 @@ jobs:
- name: Test weight_proof code with pytest
run: |
. ./activate
./venv/bin/py.test tests/weight_proof/test_*.py -s -v --durations 0 -n 4 -m "not benchmark"
venv/bin/coverage run --rcfile=.coveragerc ./venv/bin/py.test tests/weight_proof/test_*.py -s -v --durations 0 -n 4 -m "not benchmark" -p no:monitor
- 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@v2
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

View file

@ -23,7 +23,7 @@ jobs:
steps:
- name: Checkout Code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
@ -38,7 +38,7 @@ jobs:
echo "::set-output name=dir::$(npm config get cache)"
- name: Cache npm
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
@ -51,7 +51,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
@ -65,7 +65,7 @@ jobs:
python-version: "3.9"
- name: Setup Node 16.x
uses: actions/setup-node@v2.4.1
uses: actions/setup-node@v3
with:
node-version: '16.x'
@ -105,13 +105,13 @@ jobs:
deactivate
# Get the most recent release from chia-plotter-madmax
- uses: actions/github-script@v4
- uses: actions/github-script@v6
id: 'latest-madmax'
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
result-encoding: string
script: |
const releases = await github.repos.listReleases({
const releases = await github.rest.repos.listReleases({
owner: 'Chia-Network',
repo: 'chia-plotter-madmax',
});
@ -124,13 +124,13 @@ jobs:
Invoke-WebRequest https://github.com/Chia-Network/chia-plotter-madmax/releases/download/${{ steps.latest-madmax.outputs.result }}/chia_plot_k34-${{ steps.latest-madmax.outputs.result }}.exe -OutFile "$env:GITHUB_WORKSPACE\madmax\chia_plot_k34.exe"
# Get the most recent release from bladebit
- uses: actions/github-script@v4
- uses: actions/github-script@v6
id: 'latest-bladebit'
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
result-encoding: string
script: |
const releases = await github.repos.listReleases({
const releases = await github.rest.repos.listReleases({
owner: 'Chia-Network',
repo: 'bladebit',
});

View file

@ -40,7 +40,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL

View file

@ -8,7 +8,7 @@ jobs:
update_ca_module:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: "${{ github.event.inputs.chia_ref }}"

View file

@ -14,6 +14,6 @@ jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions/setup-python@v2
- uses: pre-commit/action@v2.0.3

View file

@ -49,13 +49,13 @@ jobs:
# Checkout the code base #
##########################
- name: Checkout Code
uses: actions/checkout@v2
uses: actions/checkout@v3
################################
# Run Linter against code base #
################################
- name: Lint Code Base
uses: github/super-linter@v4.8.1
uses: github/super-linter@v4.9.1
# uses: docker://github/super-linter:v3.10.2
env:
VALIDATE_ALL_CODEBASE: true

View file

@ -28,7 +28,7 @@ jobs:
steps:
- name: Checkout Code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
@ -181,7 +181,7 @@ jobs:
# after installing git so we use that copy
- name: Checkout Code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

View file

@ -23,7 +23,7 @@ jobs:
steps:
- name: Checkout Code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive

View file

@ -6,6 +6,11 @@ repos:
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
language: python
pass_filenames: false
- repo: local
hooks:
- id: init_py_files
@ -49,12 +54,13 @@ repos:
rev: 21.12b0
hooks:
- id: black
additional_dependencies: ['click<8.1']
- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.2
hooks:
- id: flake8
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.941
rev: v0.942
hooks:
- id: mypy
additional_dependencies: [filelock, pytest, pytest-asyncio, types-aiofiles, types-click, types-setuptools, types-PyYAML]

View file

@ -17,7 +17,7 @@ from chia.full_node.hint_store import HintStore
from chia.types.blockchain_format.program import SerializedProgram
from chia.types.blockchain_format.sized_bytes import bytes32
from chia.util.db_version import lookup_db_version
from chia.util.db_wrapper import DBWrapper
from chia.util.db_wrapper import DBWrapper2
from chia.util.ints import uint32
# the first transaction block. Each byte in transaction_height_delta is the
@ -57,7 +57,9 @@ async def main(db_path: Path):
await connection.execute("pragma query_only=ON")
db_version: int = await lookup_db_version(connection)
db_wrapper = DBWrapper(connection, db_version=db_version)
db_wrapper = DBWrapper2(connection, db_version=db_version)
await db_wrapper.add_connection(await aiosqlite.connect(db_path))
block_store = await BlockStore.create(db_wrapper)
hint_store = await HintStore.create(db_wrapper)
coin_store = await CoinStore.create(db_wrapper)

View file

@ -7,7 +7,7 @@ import os
import sys
from benchmarks.utils import clvm_generator
from chia.util.db_wrapper import DBWrapper
from chia.util.db_wrapper import DBWrapper2
from chia.util.ints import uint128, uint64, uint32, uint8
from utils import (
rewards,
@ -40,7 +40,7 @@ random.seed(123456789)
async def run_add_block_benchmark(version: int):
verbose: bool = "--verbose" in sys.argv
db_wrapper: DBWrapper = await setup_db("block-store-benchmark.db", version)
db_wrapper: DBWrapper2 = await setup_db("block-store-benchmark.db", version)
# keep track of benchmark total time
all_test_time = 0.0
@ -218,7 +218,6 @@ async def run_add_block_benchmark(version: int):
await block_store.set_in_chain([(header_hash,)])
header_hashes.append(header_hash)
await block_store.set_peak(header_hash)
await db_wrapper.db.commit()
stop = monotonic()
total_time += stop - start
@ -288,10 +287,10 @@ async def run_add_block_benchmark(version: int):
print("profiling get_full_blocks_at")
start = monotonic()
for h in range(1, block_height):
blocks = await block_store.get_full_blocks_at([h])
for hi in range(1, block_height):
blocks = await block_store.get_full_blocks_at([hi])
assert len(blocks) == 1
assert blocks[0].height == h
assert blocks[0].height == hi
stop = monotonic()
total_time += stop - start
@ -352,8 +351,8 @@ async def run_add_block_benchmark(version: int):
start = monotonic()
for i in range(100):
h = random.randint(1, block_height - 100)
blocks = await block_store.get_block_records_in_range(h, h + 99)
hi = random.randint(1, block_height - 100)
blocks = await block_store.get_block_records_in_range(hi, hi + 99)
assert len(blocks) == 100
stop = monotonic()
@ -411,7 +410,7 @@ async def run_add_block_benchmark(version: int):
print(f"database size: {db_size/1000000:.3f} MB")
finally:
await db_wrapper.db.close()
await db_wrapper.close()
if __name__ == "__main__":

View file

@ -7,7 +7,7 @@ from typing import List, Tuple
import os
import sys
from chia.util.db_wrapper import DBWrapper
from chia.util.db_wrapper import DBWrapper2
from chia.types.blockchain_format.sized_bytes import bytes32
from chia.types.blockchain_format.coin import Coin
from chia.util.ints import uint64, uint32
@ -37,7 +37,7 @@ def make_coins(num: int) -> Tuple[List[Coin], List[bytes32]]:
async def run_new_block_benchmark(version: int):
verbose: bool = "--verbose" in sys.argv
db_wrapper: DBWrapper = await setup_db("coin-store-benchmark.db", version)
db_wrapper: DBWrapper2 = await setup_db("coin-store-benchmark.db", version)
# keep track of benchmark total time
all_test_time = 0.0
@ -75,7 +75,6 @@ async def run_new_block_benchmark(version: int):
additions,
removals,
)
await db_wrapper.db.commit()
# 19 seconds per block
timestamp += 19
@ -117,7 +116,6 @@ async def run_new_block_benchmark(version: int):
additions,
removals,
)
await db_wrapper.db.commit()
stop = monotonic()
# 19 seconds per block
@ -168,7 +166,6 @@ async def run_new_block_benchmark(version: int):
additions,
removals,
)
await db_wrapper.db.commit()
stop = monotonic()
@ -218,7 +215,6 @@ async def run_new_block_benchmark(version: int):
additions,
removals,
)
await db_wrapper.db.commit()
stop = monotonic()
# 19 seconds per block
@ -305,7 +301,7 @@ async def run_new_block_benchmark(version: int):
print(f"all tests completed in {all_test_time:0.4f}s")
finally:
await db_wrapper.db.close()
await db_wrapper.close()
db_size = os.path.getsize(Path("coin-store-benchmark.db"))
print(f"database size: {db_size/1000000:.3f} MB")

View file

@ -12,7 +12,7 @@ from chia.types.blockchain_format.proof_of_space import ProofOfSpace
from chia.types.blockchain_format.reward_chain_block import RewardChainBlock
from chia.types.full_block import FullBlock
from chia.util.ints import uint128
from chia.util.db_wrapper import DBWrapper
from chia.util.db_wrapper import DBWrapper2
from typing import Tuple
from pathlib import Path
from datetime import datetime
@ -176,7 +176,7 @@ def rand_full_block() -> FullBlock:
return full_block
async def setup_db(name: str, db_version: int) -> DBWrapper:
async def setup_db(name: str, db_version: int) -> DBWrapper2:
db_filename = Path(name)
try:
os.unlink(db_filename)
@ -197,7 +197,9 @@ async def setup_db(name: str, db_version: int) -> DBWrapper:
await connection.execute("pragma journal_mode=wal")
await connection.execute("pragma synchronous=full")
return DBWrapper(connection, db_version)
ret = DBWrapper2(connection, db_version)
await ret.add_connection(await aiosqlite.connect(db_filename))
return ret
def get_commit_hash() -> str:

View file

@ -9,6 +9,7 @@
"version": "1.0.0",
"license": "ISC",
"dependencies": {
"appdmg": "^0.6.4",
"electron-installer-dmg": "^3.0.0",
"electron-osx-sign": "^0.5.0",
"electron-packager": "^15.4.0",
@ -2429,10 +2430,9 @@
}
},
"node_modules/appdmg": {
"version": "0.6.2",
"resolved": "https://registry.npmjs.org/appdmg/-/appdmg-0.6.2.tgz",
"integrity": "sha512-mbJyAxn2/JmDpckNpXDU4AQ/XF7fltOyrLcETZxGfYwESt0NdCjQB8L2vIxxAyZKT0R/c0aSzb9yE+P2yDh9TQ==",
"optional": true,
"version": "0.6.4",
"resolved": "https://registry.npmjs.org/appdmg/-/appdmg-0.6.4.tgz",
"integrity": "sha512-YTilgNF0DF2DSRzGzzGDxaTMLXlhe3b3HB8RAaoJJ/VJXZbOlzIAcZ7gdPniHUVUuHjGwnS7fUMd4FvO2Rp94A==",
"os": [
"darwin"
],
@ -2570,8 +2570,7 @@
"node_modules/async": {
"version": "1.5.2",
"resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz",
"integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=",
"optional": true
"integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo="
},
"node_modules/asynckit": {
"version": "0.4.0",
@ -2616,7 +2615,6 @@
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/base32-encode/-/base32-encode-1.2.0.tgz",
"integrity": "sha512-cHFU8XeRyx0GgmoWi5qHMCVRiqU6J3MHWxVgun7jggCBUpVzm1Ir7M9dYr2whjSNc3tFeXfQ/oZjQu/4u55h9A==",
"optional": true,
"dependencies": {
"to-data-view": "^1.1.0"
}
@ -2668,7 +2666,6 @@
"version": "0.0.8",
"resolved": "https://registry.npmjs.org/bplist-creator/-/bplist-creator-0.0.8.tgz",
"integrity": "sha512-Za9JKzD6fjLC16oX2wsXfc+qBEhJBJB1YPInoAQpMLhDuj5aVOv1baGeIQSq1Fr3OCqzvsoQcSBSwGId/Ja2PA==",
"optional": true,
"dependencies": {
"stream-buffers": "~2.2.0"
}
@ -3597,7 +3594,6 @@
"version": "0.1.6",
"resolved": "https://registry.npmjs.org/ds-store/-/ds-store-0.1.6.tgz",
"integrity": "sha1-0QJO90btDBPw9/7IXH6FjoxLfKc=",
"optional": true,
"dependencies": {
"bplist-creator": "~0.0.3",
"macos-alias": "~0.2.5",
@ -3795,8 +3791,7 @@
"node_modules/encode-utf8": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/encode-utf8/-/encode-utf8-1.0.3.tgz",
"integrity": "sha512-ucAnuBEhUK4boH2HjVYG5Q2mQyPorvv0u/ocS+zhdw0S8AlHYY+GOFhP1Gio5z4icpP2ivFSvhtFjQi8+T9ppw==",
"optional": true
"integrity": "sha512-ucAnuBEhUK4boH2HjVYG5Q2mQyPorvv0u/ocS+zhdw0S8AlHYY+GOFhP1Gio5z4icpP2ivFSvhtFjQi8+T9ppw=="
},
"node_modules/encodeurl": {
"version": "1.0.2",
@ -3948,7 +3943,6 @@
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz",
"integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==",
"optional": true,
"dependencies": {
"cross-spawn": "^6.0.0",
"get-stream": "^4.0.0",
@ -3966,7 +3960,6 @@
"version": "6.0.5",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz",
"integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==",
"optional": true,
"dependencies": {
"nice-try": "^1.0.4",
"path-key": "^2.0.1",
@ -3982,7 +3975,6 @@
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz",
"integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=",
"optional": true,
"engines": {
"node": ">=4"
}
@ -3991,7 +3983,6 @@
"version": "5.7.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
"integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
"optional": true,
"bin": {
"semver": "bin/semver"
}
@ -4000,7 +3991,6 @@
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz",
"integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=",
"optional": true,
"dependencies": {
"shebang-regex": "^1.0.0"
},
@ -4012,7 +4002,6 @@
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz",
"integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=",
"optional": true,
"engines": {
"node": ">=0.10.0"
}
@ -4021,7 +4010,6 @@
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
"integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
"optional": true,
"dependencies": {
"isexe": "^2.0.0"
},
@ -4227,7 +4215,6 @@
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/fmix/-/fmix-0.1.0.tgz",
"integrity": "sha1-x7vxJN7ELJ0ZHPuUfQqXeN2YbAw=",
"optional": true,
"dependencies": {
"imul": "^1.0.0"
}
@ -4281,7 +4268,6 @@
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/fs-temp/-/fs-temp-1.2.1.tgz",
"integrity": "sha512-okTwLB7/Qsq82G6iN5zZJFsOfZtx2/pqrA7Hk/9fvy+c+eJS9CvgGXT2uNxwnI14BDY9L/jQPkaBgSvlKfSW9w==",
"optional": true,
"dependencies": {
"random-path": "^0.1.0"
}
@ -4291,7 +4277,6 @@
"resolved": "https://registry.npmjs.org/fs-xattr/-/fs-xattr-0.3.1.tgz",
"integrity": "sha512-UVqkrEW0GfDabw4C3HOrFlxKfx0eeigfRne69FxSBdHIP8Qt5Sq6Pu3RM9KmMlkygtC4pPKkj5CiPO5USnj2GA==",
"hasInstallScript": true,
"optional": true,
"os": [
"!win32"
],
@ -4385,7 +4370,6 @@
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.3.1.tgz",
"integrity": "sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==",
"optional": true,
"dependencies": {
"is-property": "^1.0.2"
}
@ -4394,7 +4378,6 @@
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz",
"integrity": "sha1-nA4cQDCM6AT0eDYYuTf6iPmdUNA=",
"optional": true,
"dependencies": {
"is-property": "^1.0.0"
}
@ -4961,7 +4944,6 @@
"version": "0.7.5",
"resolved": "https://registry.npmjs.org/image-size/-/image-size-0.7.5.tgz",
"integrity": "sha512-Hiyv+mXHfFEP7LzUL/llg9RwFxxY+o9N3JVLIeG5E7iFIFAalxvRU9UZthBdYDEVnzHMgjnKJPPpay5BWf1g9g==",
"optional": true,
"bin": {
"image-size": "bin/image-size.js"
},
@ -5014,7 +4996,6 @@
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/imul/-/imul-1.0.1.tgz",
"integrity": "sha1-nVhnFh6LPelsLDjV3HyxAvNeKsk=",
"optional": true,
"engines": {
"node": ">=0.10.0"
}
@ -5277,14 +5258,12 @@
"node_modules/is-my-ip-valid": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-my-ip-valid/-/is-my-ip-valid-1.0.0.tgz",
"integrity": "sha512-gmh/eWXROncUzRnIa1Ubrt5b8ep/MGSnfAUI3aRp+sqTCs1tv1Isl8d8F6JmkN3dXKc3ehZMrtiPN9eL03NuaQ==",
"optional": true
"integrity": "sha512-gmh/eWXROncUzRnIa1Ubrt5b8ep/MGSnfAUI3aRp+sqTCs1tv1Isl8d8F6JmkN3dXKc3ehZMrtiPN9eL03NuaQ=="
},
"node_modules/is-my-json-valid": {
"version": "2.20.6",
"resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.20.6.tgz",
"integrity": "sha512-1JQwulVNjx8UqkPE/bqDaxtH4PXCe/2VRh/y3p99heOV87HG4Id5/VfDswd+YiAfHcRTfDlWgISycnHuhZq1aw==",
"optional": true,
"dependencies": {
"generate-function": "^2.0.0",
"generate-object-property": "^1.1.0",
@ -5353,8 +5332,7 @@
"node_modules/is-property": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz",
"integrity": "sha1-V/4cTkhHTt1lsJkR8msc1Ald2oQ=",
"optional": true
"integrity": "sha1-V/4cTkhHTt1lsJkR8msc1Ald2oQ="
},
"node_modules/is-regex": {
"version": "1.1.4",
@ -5391,7 +5369,6 @@
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz",
"integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=",
"optional": true,
"engines": {
"node": ">=0.10.0"
}
@ -5556,7 +5533,6 @@
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-5.0.0.tgz",
"integrity": "sha512-PNYZIdMjVIvVgDSYKTT63Y+KZ6IZvGRNNWcxwD+GNnUz1MKPfv30J8ueCjdwcN0nDx2SlshgyB7Oy0epAzVRRg==",
"optional": true,
"engines": {
"node": ">=0.10.0"
}
@ -5883,7 +5859,6 @@
"resolved": "https://registry.npmjs.org/macos-alias/-/macos-alias-0.2.11.tgz",
"integrity": "sha1-/u6mwTuhGYFKQ/xDxHCzHlnvcYo=",
"hasInstallScript": true,
"optional": true,
"os": [
"darwin"
],
@ -6334,7 +6309,6 @@
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/murmur-32/-/murmur-32-0.2.0.tgz",
"integrity": "sha512-ZkcWZudylwF+ir3Ld1n7gL6bI2mQAzXvSobPwVtu8aYi2sbXeipeSkdcanRLzIofLcM5F53lGaKm2dk7orBi7Q==",
"optional": true,
"dependencies": {
"encode-utf8": "^1.0.3",
"fmix": "^0.1.0",
@ -6349,8 +6323,7 @@
"node_modules/nan": {
"version": "2.15.0",
"resolved": "https://registry.npmjs.org/nan/-/nan-2.15.0.tgz",
"integrity": "sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ==",
"optional": true
"integrity": "sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ=="
},
"node_modules/negotiator": {
"version": "0.6.2",
@ -6368,8 +6341,7 @@
"node_modules/nice-try": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz",
"integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==",
"optional": true
"integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ=="
},
"node_modules/node-fetch": {
"version": "2.6.6",
@ -6778,7 +6750,6 @@
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz",
"integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=",
"optional": true,
"dependencies": {
"path-key": "^2.0.0"
},
@ -6790,7 +6761,6 @@
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz",
"integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=",
"optional": true,
"engines": {
"node": ">=4"
}
@ -7169,7 +7139,6 @@
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/parse-color/-/parse-color-1.0.0.tgz",
"integrity": "sha1-e3SLlag/A/FqlPU15S1/PZRlhhk=",
"optional": true,
"dependencies": {
"color-convert": "~0.5.0"
}
@ -7177,8 +7146,7 @@
"node_modules/parse-color/node_modules/color-convert": {
"version": "0.5.3",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-0.5.3.tgz",
"integrity": "sha1-vbbGnOZg+t/+CwAHzER+G59ygr0=",
"optional": true
"integrity": "sha1-vbbGnOZg+t/+CwAHzER+G59ygr0="
},
"node_modules/parse-json": {
"version": "5.2.0",
@ -7471,7 +7439,6 @@
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/random-path/-/random-path-0.1.2.tgz",
"integrity": "sha512-4jY0yoEaQ5v9StCl5kZbNIQlg1QheIDBrdkDn53EynpPb9FgO6//p3X/tgMnrC45XN6QZCzU1Xz/+pSSsJBpRw==",
"optional": true,
"dependencies": {
"base32-encode": "^0.1.0 || ^1.0.0",
"murmur-32": "^0.1.0 || ^0.2.0"
@ -7867,7 +7834,6 @@
"version": "1.6.1",
"resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz",
"integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=",
"optional": true,
"engines": {
"node": ">=0.10"
}
@ -8373,7 +8339,6 @@
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/stream-buffers/-/stream-buffers-2.2.0.tgz",
"integrity": "sha1-kdX1Ew0c75bc+n9yaUUYh0HQnuQ=",
"optional": true,
"engines": {
"node": ">= 0.10.0"
}
@ -8473,7 +8438,6 @@
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz",
"integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=",
"optional": true,
"engines": {
"node": ">=0.10.0"
}
@ -8643,7 +8607,6 @@
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/tn1150/-/tn1150-0.1.0.tgz",
"integrity": "sha1-ZzUD0k1WuH3ouMd/7j/AhT1ZoY0=",
"optional": true,
"dependencies": {
"unorm": "^1.4.1"
},
@ -8654,8 +8617,7 @@
"node_modules/to-data-view": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/to-data-view/-/to-data-view-1.1.0.tgz",
"integrity": "sha512-1eAdufMg6mwgmlojAx3QeMnzB/BTVp7Tbndi3U7ftcT2zCZadjxkkmLmd97zmaxWi+sgGcgWrokmpEoy0Dn0vQ==",
"optional": true
"integrity": "sha512-1eAdufMg6mwgmlojAx3QeMnzB/BTVp7Tbndi3U7ftcT2zCZadjxkkmLmd97zmaxWi+sgGcgWrokmpEoy0Dn0vQ=="
},
"node_modules/to-readable-stream": {
"version": "1.0.0",
@ -8844,7 +8806,6 @@
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/unorm/-/unorm-1.6.0.tgz",
"integrity": "sha512-b2/KCUlYZUeA7JFUuRJZPUtr4gZvBh7tavtv4fvk4+KV9pfGiR6CQAQAWl49ZpR3ts2dk4FYkP7EIgDJoiOLDA==",
"optional": true,
"engines": {
"node": ">= 0.4.0"
}
@ -11175,10 +11136,9 @@
}
},
"appdmg": {
"version": "0.6.2",
"resolved": "https://registry.npmjs.org/appdmg/-/appdmg-0.6.2.tgz",
"integrity": "sha512-mbJyAxn2/JmDpckNpXDU4AQ/XF7fltOyrLcETZxGfYwESt0NdCjQB8L2vIxxAyZKT0R/c0aSzb9yE+P2yDh9TQ==",
"optional": true,
"version": "0.6.4",
"resolved": "https://registry.npmjs.org/appdmg/-/appdmg-0.6.4.tgz",
"integrity": "sha512-YTilgNF0DF2DSRzGzzGDxaTMLXlhe3b3HB8RAaoJJ/VJXZbOlzIAcZ7gdPniHUVUuHjGwnS7fUMd4FvO2Rp94A==",
"requires": {
"async": "^1.4.2",
"ds-store": "^0.1.5",
@ -11289,8 +11249,7 @@
"async": {
"version": "1.5.2",
"resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz",
"integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=",
"optional": true
"integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo="
},
"asynckit": {
"version": "0.4.0",
@ -11326,7 +11285,6 @@
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/base32-encode/-/base32-encode-1.2.0.tgz",
"integrity": "sha512-cHFU8XeRyx0GgmoWi5qHMCVRiqU6J3MHWxVgun7jggCBUpVzm1Ir7M9dYr2whjSNc3tFeXfQ/oZjQu/4u55h9A==",
"optional": true,
"requires": {
"to-data-view": "^1.1.0"
}
@ -11364,7 +11322,6 @@
"version": "0.0.8",
"resolved": "https://registry.npmjs.org/bplist-creator/-/bplist-creator-0.0.8.tgz",
"integrity": "sha512-Za9JKzD6fjLC16oX2wsXfc+qBEhJBJB1YPInoAQpMLhDuj5aVOv1baGeIQSq1Fr3OCqzvsoQcSBSwGId/Ja2PA==",
"optional": true,
"requires": {
"stream-buffers": "~2.2.0"
}
@ -12072,7 +12029,6 @@
"version": "0.1.6",
"resolved": "https://registry.npmjs.org/ds-store/-/ds-store-0.1.6.tgz",
"integrity": "sha1-0QJO90btDBPw9/7IXH6FjoxLfKc=",
"optional": true,
"requires": {
"bplist-creator": "~0.0.3",
"macos-alias": "~0.2.5",
@ -12233,8 +12189,7 @@
"encode-utf8": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/encode-utf8/-/encode-utf8-1.0.3.tgz",
"integrity": "sha512-ucAnuBEhUK4boH2HjVYG5Q2mQyPorvv0u/ocS+zhdw0S8AlHYY+GOFhP1Gio5z4icpP2ivFSvhtFjQi8+T9ppw==",
"optional": true
"integrity": "sha512-ucAnuBEhUK4boH2HjVYG5Q2mQyPorvv0u/ocS+zhdw0S8AlHYY+GOFhP1Gio5z4icpP2ivFSvhtFjQi8+T9ppw=="
},
"encodeurl": {
"version": "1.0.2",
@ -12355,7 +12310,6 @@
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz",
"integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==",
"optional": true,
"requires": {
"cross-spawn": "^6.0.0",
"get-stream": "^4.0.0",
@ -12370,7 +12324,6 @@
"version": "6.0.5",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz",
"integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==",
"optional": true,
"requires": {
"nice-try": "^1.0.4",
"path-key": "^2.0.1",
@ -12382,20 +12335,17 @@
"path-key": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz",
"integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=",
"optional": true
"integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A="
},
"semver": {
"version": "5.7.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
"integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
"optional": true
"integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ=="
},
"shebang-command": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz",
"integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=",
"optional": true,
"requires": {
"shebang-regex": "^1.0.0"
}
@ -12403,14 +12353,12 @@
"shebang-regex": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz",
"integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=",
"optional": true
"integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM="
},
"which": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
"integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
"optional": true,
"requires": {
"isexe": "^2.0.0"
}
@ -12566,7 +12514,6 @@
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/fmix/-/fmix-0.1.0.tgz",
"integrity": "sha1-x7vxJN7ELJ0ZHPuUfQqXeN2YbAw=",
"optional": true,
"requires": {
"imul": "^1.0.0"
}
@ -12608,7 +12555,6 @@
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/fs-temp/-/fs-temp-1.2.1.tgz",
"integrity": "sha512-okTwLB7/Qsq82G6iN5zZJFsOfZtx2/pqrA7Hk/9fvy+c+eJS9CvgGXT2uNxwnI14BDY9L/jQPkaBgSvlKfSW9w==",
"optional": true,
"requires": {
"random-path": "^0.1.0"
}
@ -12616,8 +12562,7 @@
"fs-xattr": {
"version": "0.3.1",
"resolved": "https://registry.npmjs.org/fs-xattr/-/fs-xattr-0.3.1.tgz",
"integrity": "sha512-UVqkrEW0GfDabw4C3HOrFlxKfx0eeigfRne69FxSBdHIP8Qt5Sq6Pu3RM9KmMlkygtC4pPKkj5CiPO5USnj2GA==",
"optional": true
"integrity": "sha512-UVqkrEW0GfDabw4C3HOrFlxKfx0eeigfRne69FxSBdHIP8Qt5Sq6Pu3RM9KmMlkygtC4pPKkj5CiPO5USnj2GA=="
},
"fs.realpath": {
"version": "1.0.0",
@ -12703,7 +12648,6 @@
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.3.1.tgz",
"integrity": "sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==",
"optional": true,
"requires": {
"is-property": "^1.0.2"
}
@ -12712,7 +12656,6 @@
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz",
"integrity": "sha1-nA4cQDCM6AT0eDYYuTf6iPmdUNA=",
"optional": true,
"requires": {
"is-property": "^1.0.0"
}
@ -13144,8 +13087,7 @@
"image-size": {
"version": "0.7.5",
"resolved": "https://registry.npmjs.org/image-size/-/image-size-0.7.5.tgz",
"integrity": "sha512-Hiyv+mXHfFEP7LzUL/llg9RwFxxY+o9N3JVLIeG5E7iFIFAalxvRU9UZthBdYDEVnzHMgjnKJPPpay5BWf1g9g==",
"optional": true
"integrity": "sha512-Hiyv+mXHfFEP7LzUL/llg9RwFxxY+o9N3JVLIeG5E7iFIFAalxvRU9UZthBdYDEVnzHMgjnKJPPpay5BWf1g9g=="
},
"import-fresh": {
"version": "3.3.0",
@ -13175,8 +13117,7 @@
"imul": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/imul/-/imul-1.0.1.tgz",
"integrity": "sha1-nVhnFh6LPelsLDjV3HyxAvNeKsk=",
"optional": true
"integrity": "sha1-nVhnFh6LPelsLDjV3HyxAvNeKsk="
},
"imurmurhash": {
"version": "0.1.4",
@ -13371,14 +13312,12 @@
"is-my-ip-valid": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-my-ip-valid/-/is-my-ip-valid-1.0.0.tgz",
"integrity": "sha512-gmh/eWXROncUzRnIa1Ubrt5b8ep/MGSnfAUI3aRp+sqTCs1tv1Isl8d8F6JmkN3dXKc3ehZMrtiPN9eL03NuaQ==",
"optional": true
"integrity": "sha512-gmh/eWXROncUzRnIa1Ubrt5b8ep/MGSnfAUI3aRp+sqTCs1tv1Isl8d8F6JmkN3dXKc3ehZMrtiPN9eL03NuaQ=="
},
"is-my-json-valid": {
"version": "2.20.6",
"resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.20.6.tgz",
"integrity": "sha512-1JQwulVNjx8UqkPE/bqDaxtH4PXCe/2VRh/y3p99heOV87HG4Id5/VfDswd+YiAfHcRTfDlWgISycnHuhZq1aw==",
"optional": true,
"requires": {
"generate-function": "^2.0.0",
"generate-object-property": "^1.1.0",
@ -13423,8 +13362,7 @@
"is-property": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz",
"integrity": "sha1-V/4cTkhHTt1lsJkR8msc1Ald2oQ=",
"optional": true
"integrity": "sha1-V/4cTkhHTt1lsJkR8msc1Ald2oQ="
},
"is-regex": {
"version": "1.1.4",
@ -13451,8 +13389,7 @@
"is-stream": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz",
"integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=",
"optional": true
"integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ="
},
"is-string": {
"version": "1.0.7",
@ -13583,8 +13520,7 @@
"jsonpointer": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-5.0.0.tgz",
"integrity": "sha512-PNYZIdMjVIvVgDSYKTT63Y+KZ6IZvGRNNWcxwD+GNnUz1MKPfv30J8ueCjdwcN0nDx2SlshgyB7Oy0epAzVRRg==",
"optional": true
"integrity": "sha512-PNYZIdMjVIvVgDSYKTT63Y+KZ6IZvGRNNWcxwD+GNnUz1MKPfv30J8ueCjdwcN0nDx2SlshgyB7Oy0epAzVRRg=="
},
"JSONStream": {
"version": "1.3.5",
@ -13853,7 +13789,6 @@
"version": "0.2.11",
"resolved": "https://registry.npmjs.org/macos-alias/-/macos-alias-0.2.11.tgz",
"integrity": "sha1-/u6mwTuhGYFKQ/xDxHCzHlnvcYo=",
"optional": true,
"requires": {
"nan": "^2.4.0"
}
@ -14185,7 +14120,6 @@
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/murmur-32/-/murmur-32-0.2.0.tgz",
"integrity": "sha512-ZkcWZudylwF+ir3Ld1n7gL6bI2mQAzXvSobPwVtu8aYi2sbXeipeSkdcanRLzIofLcM5F53lGaKm2dk7orBi7Q==",
"optional": true,
"requires": {
"encode-utf8": "^1.0.3",
"fmix": "^0.1.0",
@ -14200,8 +14134,7 @@
"nan": {
"version": "2.15.0",
"resolved": "https://registry.npmjs.org/nan/-/nan-2.15.0.tgz",
"integrity": "sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ==",
"optional": true
"integrity": "sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ=="
},
"negotiator": {
"version": "0.6.2",
@ -14216,8 +14149,7 @@
"nice-try": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz",
"integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==",
"optional": true
"integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ=="
},
"node-fetch": {
"version": "2.6.6",
@ -14546,7 +14478,6 @@
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz",
"integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=",
"optional": true,
"requires": {
"path-key": "^2.0.0"
},
@ -14554,8 +14485,7 @@
"path-key": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz",
"integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=",
"optional": true
"integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A="
}
}
},
@ -14824,7 +14754,6 @@
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/parse-color/-/parse-color-1.0.0.tgz",
"integrity": "sha1-e3SLlag/A/FqlPU15S1/PZRlhhk=",
"optional": true,
"requires": {
"color-convert": "~0.5.0"
},
@ -14832,8 +14761,7 @@
"color-convert": {
"version": "0.5.3",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-0.5.3.tgz",
"integrity": "sha1-vbbGnOZg+t/+CwAHzER+G59ygr0=",
"optional": true
"integrity": "sha1-vbbGnOZg+t/+CwAHzER+G59ygr0="
}
}
},
@ -15043,7 +14971,6 @@
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/random-path/-/random-path-0.1.2.tgz",
"integrity": "sha512-4jY0yoEaQ5v9StCl5kZbNIQlg1QheIDBrdkDn53EynpPb9FgO6//p3X/tgMnrC45XN6QZCzU1Xz/+pSSsJBpRw==",
"optional": true,
"requires": {
"base32-encode": "^0.1.0 || ^1.0.0",
"murmur-32": "^0.1.0 || ^0.2.0"
@ -15360,8 +15287,7 @@
"repeat-string": {
"version": "1.6.1",
"resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz",
"integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=",
"optional": true
"integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc="
},
"request": {
"version": "2.88.2",
@ -15720,8 +15646,7 @@
"stream-buffers": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/stream-buffers/-/stream-buffers-2.2.0.tgz",
"integrity": "sha1-kdX1Ew0c75bc+n9yaUUYh0HQnuQ=",
"optional": true
"integrity": "sha1-kdX1Ew0c75bc+n9yaUUYh0HQnuQ="
},
"strict-uri-encode": {
"version": "2.0.0",
@ -15795,8 +15720,7 @@
"strip-eof": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz",
"integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=",
"optional": true
"integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8="
},
"strip-final-newline": {
"version": "2.0.0",
@ -15917,7 +15841,6 @@
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/tn1150/-/tn1150-0.1.0.tgz",
"integrity": "sha1-ZzUD0k1WuH3ouMd/7j/AhT1ZoY0=",
"optional": true,
"requires": {
"unorm": "^1.4.1"
}
@ -15925,8 +15848,7 @@
"to-data-view": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/to-data-view/-/to-data-view-1.1.0.tgz",
"integrity": "sha512-1eAdufMg6mwgmlojAx3QeMnzB/BTVp7Tbndi3U7ftcT2zCZadjxkkmLmd97zmaxWi+sgGcgWrokmpEoy0Dn0vQ==",
"optional": true
"integrity": "sha512-1eAdufMg6mwgmlojAx3QeMnzB/BTVp7Tbndi3U7ftcT2zCZadjxkkmLmd97zmaxWi+sgGcgWrokmpEoy0Dn0vQ=="
},
"to-readable-stream": {
"version": "1.0.0",
@ -16069,8 +15991,7 @@
"unorm": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/unorm/-/unorm-1.6.0.tgz",
"integrity": "sha512-b2/KCUlYZUeA7JFUuRJZPUtr4gZvBh7tavtv4fvk4+KV9pfGiR6CQAQAWl49ZpR3ts2dk4FYkP7EIgDJoiOLDA==",
"optional": true
"integrity": "sha512-b2/KCUlYZUeA7JFUuRJZPUtr4gZvBh7tavtv4fvk4+KV9pfGiR6CQAQAWl49ZpR3ts2dk4FYkP7EIgDJoiOLDA=="
},
"upath": {
"version": "2.0.1",

View file

@ -10,6 +10,7 @@
"author": "",
"license": "ISC",
"dependencies": {
"appdmg": "^0.6.4",
"electron-installer-dmg": "^3.0.0",
"electron-osx-sign": "^0.5.0",
"electron-packager": "^15.4.0",

@ -1 +1 @@
Subproject commit 80e8bcb83c8dac3c2e37e40a7f701ad9842bb120
Subproject commit 054d7b342e7c8284c9b58a775f87d393a1008bfe

View file

@ -1,4 +1,5 @@
import aiosqlite
import random
from dataclasses import dataclass
from typing import Optional, List, Dict, Tuple, Any
@ -9,7 +10,7 @@ from chia.types.blockchain_format.program import Program, SerializedProgram
from chia.util.ints import uint64, uint32
from chia.util.hash import std_hash
from chia.util.errors import Err, ValidationError
from chia.util.db_wrapper import DBWrapper
from chia.util.db_wrapper import DBWrapper2
from chia.util.streamable import Streamable, streamable
from chia.types.coin_record import CoinRecord
from chia.types.spend_bundle import SpendBundle
@ -79,7 +80,7 @@ class SimStore(Streamable):
class SpendSim:
connection: aiosqlite.Connection
db_wrapper: DBWrapper2
mempool_manager: MempoolManager
block_records: List[SimBlockRecord]
blocks: List[SimFullBlock]
@ -90,39 +91,43 @@ class SpendSim:
@classmethod
async def create(cls, db_path=":memory:", defaults=DEFAULT_CONSTANTS):
self = cls()
self.connection = DBWrapper(await aiosqlite.connect(db_path))
coin_store = await CoinStore.create(self.connection)
uri = f"file:db_{random.randint(0, 99999999)}?mode=memory&cache=shared"
connection = await aiosqlite.connect(uri, uri=True)
self.db_wrapper = DBWrapper2(connection)
await self.db_wrapper.add_connection(await aiosqlite.connect(uri, uri=True))
coin_store = await CoinStore.create(self.db_wrapper)
self.mempool_manager = MempoolManager(coin_store, defaults)
self.defaults = defaults
# Load the next data if there is any
await self.connection.db.execute("CREATE TABLE IF NOT EXISTS block_data(data blob PRIMARY_KEY)")
cursor = await self.connection.db.execute("SELECT * from block_data")
row = await cursor.fetchone()
await cursor.close()
if row is not None:
store_data = SimStore.from_bytes(row[0])
self.timestamp = store_data.timestamp
self.block_height = store_data.block_height
self.block_records = store_data.block_records
self.blocks = store_data.blocks
else:
self.timestamp = 1
self.block_height = 0
self.block_records = []
self.blocks = []
return self
async with self.db_wrapper.write_db() as conn:
await conn.execute("CREATE TABLE IF NOT EXISTS block_data(data blob PRIMARY_KEY)")
cursor = await conn.execute("SELECT * from block_data")
row = await cursor.fetchone()
await cursor.close()
if row is not None:
store_data = SimStore.from_bytes(row[0])
self.timestamp = store_data.timestamp
self.block_height = store_data.block_height
self.block_records = store_data.block_records
self.blocks = store_data.blocks
else:
self.timestamp = 1
self.block_height = 0
self.block_records = []
self.blocks = []
return self
async def close(self):
c = await self.connection.db.execute("DELETE FROM block_data")
await c.close()
c = await self.connection.db.execute(
"INSERT INTO block_data VALUES(?)",
(bytes(SimStore(self.timestamp, self.block_height, self.block_records, self.blocks)),),
)
await c.close()
await self.connection.db.commit()
await self.connection.db.close()
async with self.db_wrapper.write_db() as conn:
c = await conn.execute("DELETE FROM block_data")
await c.close()
c = await conn.execute(
"INSERT INTO block_data VALUES(?)",
(bytes(SimStore(self.timestamp, self.block_height, self.block_records, self.blocks)),),
)
await c.close()
await self.db_wrapper.close()
async def new_peak(self):
await self.mempool_manager.new_peak(self.block_records[-1], [])
@ -138,12 +143,13 @@ class SpendSim:
async def all_non_reward_coins(self) -> List[Coin]:
coins = set()
cursor = await self.mempool_manager.coin_store.coin_record_db.execute(
"SELECT * from coin_record WHERE coinbase=0 AND spent=0 ",
)
rows = await cursor.fetchall()
async with self.mempool_manager.coin_store.db_wrapper.read_db() as conn:
cursor = await conn.execute(
"SELECT * from coin_record WHERE coinbase=0 AND spent=0 ",
)
rows = await cursor.fetchall()
await cursor.close()
await cursor.close()
for row in rows:
coin = Coin(bytes32(bytes.fromhex(row[6])), bytes32(bytes.fromhex(row[5])), uint64.from_bytes(row[7]))
coins.add(coin)

View file

@ -123,7 +123,7 @@ def run_daemon_cmd(ctx: click.Context, wait_for_unlock: bool) -> None:
wait_for_unlock = wait_for_unlock and Keychain.is_keyring_locked()
asyncio.get_event_loop().run_until_complete(async_run_daemon(ctx.obj["root_path"], wait_for_unlock=wait_for_unlock))
asyncio.run(async_run_daemon(ctx.obj["root_path"], wait_for_unlock=wait_for_unlock))
cli.add_command(keys_cmd)

View file

@ -1,9 +1,9 @@
from pathlib import Path
from typing import Dict, Optional
from typing import Optional
import click
from chia.util.config import get_config_lock, load_config, save_config, str2bool
from chia.util.config import lock_and_load_config, save_config, str2bool
def configure(
@ -23,8 +23,7 @@ def configure(
seeder_domain_name: str,
seeder_nameserver: str,
):
with get_config_lock(root_path, "config.yaml"):
config: Dict = load_config(root_path, "config.yaml", acquire_lock=False)
with lock_and_load_config(root_path, "config.yaml") as config:
change_made = False
if set_node_introducer:
try:

View file

@ -7,7 +7,7 @@ from time import time
import textwrap
import os
from chia.util.config import load_config, save_config, get_config_lock
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.ints import uint32
from chia.types.blockchain_format.sized_bytes import bytes32
@ -70,8 +70,7 @@ def db_upgrade_func(
if update_config:
print("updating config.yaml")
with get_config_lock(root_path, "config.yaml"):
config = load_config(root_path, "config.yaml", acquire_lock=False)
with lock_and_load_config(root_path, "config.yaml") as config:
new_db_path = db_pattern.replace("_v1_", "_v2_")
config["full_node"]["database_path"] = new_db_path
print(f"database_path: {new_db_path}")

View file

@ -20,9 +20,9 @@ from chia.util.config import (
create_default_chia_config,
initial_config_file,
load_config,
lock_and_load_config,
save_config,
unflatten_properties,
get_config_lock,
)
from chia.util.db_version import set_db_version
from chia.util.keychain import Keychain
@ -44,8 +44,8 @@ from chia.wallet.derive_keys import (
)
from chia.cmds.configure import configure
private_node_names = {"full_node", "wallet", "farmer", "harvester", "timelord", "crawler", "daemon"}
public_node_names = {"full_node", "wallet", "farmer", "introducer", "timelord"}
private_node_names: List[str] = ["full_node", "wallet", "farmer", "harvester", "timelord", "crawler", "daemon"]
public_node_names: List[str] = ["full_node", "wallet", "farmer", "introducer", "timelord"]
def dict_add_new_default(updated: Dict, default: Dict, do_not_migrate_keys: Dict[str, Any]):
@ -77,8 +77,7 @@ def check_keys(new_root: Path, keychain: Optional[Keychain] = None) -> None:
print("No keys are present in the keychain. Generate them with 'chia keys generate'")
return None
with get_config_lock(new_root, "config.yaml"):
config: Dict = load_config(new_root, "config.yaml", acquire_lock=False)
with lock_and_load_config(new_root, "config.yaml") as config:
pool_child_pubkeys = [master_sk_to_pool_sk(sk).get_g1() for sk, _ in all_sks]
all_targets = []
stop_searching_for_farmer = "xch_target_address" not in config["farmer"]
@ -199,8 +198,7 @@ def migrate_from(
# update config yaml with new keys
with get_config_lock(new_root, "config.yaml"):
config: Dict = load_config(new_root, "config.yaml", acquire_lock=False)
with lock_and_load_config(new_root, "config.yaml") as config:
config_str: str = initial_config_file("config.yaml")
default_config: Dict = yaml.safe_load(config_str)
flattened_keys = unflatten_properties({k: "" for k in do_not_migrate_settings})
@ -213,7 +211,12 @@ def migrate_from(
return 1
def create_all_ssl(root_path: Path):
def create_all_ssl(
root_path: Path,
*,
private_ca_crt_and_key: Optional[Tuple[bytes, bytes]] = None,
node_certs_and_keys: Optional[Dict[str, Dict]] = None,
):
# remove old key and crt
config_dir = root_path / "config"
old_key_path = config_dir / "trusted.key"
@ -236,6 +239,11 @@ def create_all_ssl(root_path: Path):
chia_ca_key_path = ca_dir / "chia_ca.key"
write_ssl_cert_and_key(chia_ca_crt_path, chia_ca_crt, chia_ca_key_path, chia_ca_key)
# If Private CA crt/key are passed-in, write them out
if private_ca_crt_and_key is not None:
private_ca_crt, private_ca_key = private_ca_crt_and_key
write_ssl_cert_and_key(private_ca_crt_path, private_ca_crt, private_ca_key_path, private_ca_key)
if not private_ca_key_path.exists() or not private_ca_crt_path.exists():
# Create private CA
print(f"Can't find private CA, creating a new one in {root_path} to generate TLS certificates")
@ -243,33 +251,53 @@ def create_all_ssl(root_path: Path):
# Create private certs for each node
ca_key = private_ca_key_path.read_bytes()
ca_crt = private_ca_crt_path.read_bytes()
generate_ssl_for_nodes(ssl_dir, ca_crt, ca_key, True)
generate_ssl_for_nodes(
ssl_dir, ca_crt, ca_key, prefix="private", nodes=private_node_names, node_certs_and_keys=node_certs_and_keys
)
else:
# This is entered when user copied over private CA
print(f"Found private CA in {root_path}, using it to generate TLS certificates")
ca_key = private_ca_key_path.read_bytes()
ca_crt = private_ca_crt_path.read_bytes()
generate_ssl_for_nodes(ssl_dir, ca_crt, ca_key, True)
generate_ssl_for_nodes(
ssl_dir, ca_crt, ca_key, prefix="private", nodes=private_node_names, node_certs_and_keys=node_certs_and_keys
)
chia_ca_crt, chia_ca_key = get_chia_ca_crt_key()
generate_ssl_for_nodes(ssl_dir, chia_ca_crt, chia_ca_key, False, overwrite=False)
generate_ssl_for_nodes(
ssl_dir,
chia_ca_crt,
chia_ca_key,
prefix="public",
nodes=public_node_names,
overwrite=False,
node_certs_and_keys=node_certs_and_keys,
)
def generate_ssl_for_nodes(ssl_dir: Path, ca_crt: bytes, ca_key: bytes, private: bool, overwrite=True):
if private:
names = private_node_names
else:
names = public_node_names
for node_name in names:
def generate_ssl_for_nodes(
ssl_dir: Path,
ca_crt: bytes,
ca_key: bytes,
*,
prefix: str,
nodes: List[str],
overwrite: bool = True,
node_certs_and_keys: Optional[Dict[str, Dict]] = None,
):
for node_name in nodes:
node_dir = ssl_dir / node_name
ensure_ssl_dirs([node_dir])
if private:
prefix = "private"
else:
prefix = "public"
key_path = node_dir / f"{prefix}_{node_name}.key"
crt_path = node_dir / f"{prefix}_{node_name}.crt"
if node_certs_and_keys is not None:
certs_and_keys = node_certs_and_keys.get(node_name, {}).get(prefix, {})
crt = certs_and_keys.get("crt", None)
key = certs_and_keys.get("key", None)
if crt is not None and key is not None:
write_ssl_cert_and_key(crt_path, crt, key_path, key)
continue
if key_path.exists() and crt_path.exists() and overwrite is False:
continue
generate_ca_signed_cert(ca_crt, ca_key, crt_path, key_path)
@ -465,10 +493,9 @@ def chia_init(
config: Dict
with get_config_lock(root_path, "config.yaml"):
db_path_replaced: str
if v1_db:
config = load_config(root_path, "config.yaml", acquire_lock=False)
db_path_replaced: str
if v1_db:
with lock_and_load_config(root_path, "config.yaml") as config:
db_pattern = config["full_node"]["database_path"]
new_db_path = db_pattern.replace("_v2_", "_v1_")
config["full_node"]["database_path"] = new_db_path
@ -480,14 +507,14 @@ def chia_init(
save_config(root_path, "config.yaml", config)
else:
config = load_config(root_path, "config.yaml", acquire_lock=False)["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)
else:
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)
with sqlite3.connect(db_path) as connection:
set_db_version(connection, 2)
with sqlite3.connect(db_path) as connection:
set_db_version(connection, 2)
print("")
print("To see your keys, run 'chia keys show --show-mnemonic-seed'")

View file

@ -65,11 +65,7 @@ def set_cmd(
if success:
# Attempt to update the daemon's passphrase cache
sys.exit(
asyncio.get_event_loop().run_until_complete(
async_update_daemon_passphrase_cache_if_running(ctx.obj["root_path"])
)
)
sys.exit(asyncio.run(async_update_daemon_passphrase_cache_if_running(ctx.obj["root_path"])))
@passphrase_cmd.command(
@ -95,11 +91,7 @@ def remove_cmd(ctx: click.Context, current_passphrase_file: Optional[TextIOWrapp
if remove_passphrase(current_passphrase):
# Attempt to update the daemon's passphrase cache
sys.exit(
asyncio.get_event_loop().run_until_complete(
async_update_daemon_passphrase_cache_if_running(ctx.obj["root_path"])
)
)
sys.exit(asyncio.run(async_update_daemon_passphrase_cache_if_running(ctx.obj["root_path"])))
@passphrase_cmd.group("hint", short_help="Manage the optional keyring passphrase hint")

View file

@ -138,7 +138,7 @@ def create_cmd(
print("Error: The minimum k size allowed from the cli is k=25.")
sys.exit(1)
plot_keys = asyncio.get_event_loop().run_until_complete(
plot_keys = asyncio.run(
resolve_plot_keys(
farmer_public_key,
alt_fingerprint,
@ -150,7 +150,7 @@ def create_cmd(
)
)
asyncio.get_event_loop().run_until_complete(create_plots(Params(), plot_keys, ctx.obj["root_path"]))
asyncio.run(create_plots(Params(), plot_keys, ctx.obj["root_path"]))
@plots_cmd.command("check", short_help="Checks plots")

View file

@ -11,4 +11,4 @@ def start_cmd(ctx: click.Context, restart: bool, group: str) -> None:
import asyncio
from .start_funcs import async_start
asyncio.get_event_loop().run_until_complete(async_start(ctx.obj["root_path"], group, restart))
asyncio.run(async_start(ctx.obj["root_path"], group, restart))

View file

@ -43,4 +43,4 @@ async def async_stop(root_path: Path, group: str, stop_daemon: bool) -> int:
def stop_cmd(ctx: click.Context, daemon: bool, group: str) -> None:
import asyncio
sys.exit(asyncio.get_event_loop().run_until_complete(async_stop(ctx.obj["root_path"], group, daemon)))
sys.exit(asyncio.run(async_stop(ctx.obj["root_path"], group, daemon)))

View file

@ -167,8 +167,18 @@ def show_cmd(wallet_rpc_port: Optional[int], fingerprint: int, wallet_type: Opti
)
@click.option("-i", "--id", help="Id of the wallet to use", type=int, default=1, show_default=True, required=True)
@click.option("-f", "--fingerprint", help="Set the fingerprint to specify which wallet to use", type=int)
def get_address_cmd(wallet_rpc_port: Optional[int], id, fingerprint: int) -> None:
extra_params = {"id": id}
@click.option(
"-n/-l",
"--new-address/--latest-address",
help=(
"Create a new wallet receive address, or show the most recently created wallet receive address"
" [default: show most recent address]"
),
is_flag=True,
default=False,
)
def get_address_cmd(wallet_rpc_port: Optional[int], id, fingerprint: int, new_address: bool) -> None:
extra_params = {"id": id, "new_address": new_address}
import asyncio
from .wallet_funcs import execute_with_wallet, get_address

View file

@ -216,7 +216,8 @@ async def send(args: dict, wallet_client: WalletRpcClient, fingerprint: int) ->
async def get_address(args: dict, wallet_client: WalletRpcClient, fingerprint: int) -> None:
wallet_id = args["id"]
res = await wallet_client.get_next_address(wallet_id, False)
new_address: bool = args.get("new_address", False)
res = await wallet_client.get_next_address(wallet_id, new_address)
print(res)
@ -482,17 +483,28 @@ async def print_balances(args: dict, wallet_client: WalletRpcClient, fingerprint
else:
print(f"Balances, fingerprint: {fingerprint}")
for summary in summaries_response:
indent: str = " "
# asset_id currently contains both the asset ID and TAIL program bytes concatenated together.
# A future RPC update may split them apart, but for now we'll show the first 32 bytes (64 chars)
asset_id = summary["data"][:64]
wallet_id = summary["id"]
balances = await wallet_client.get_wallet_balance(wallet_id)
typ = WalletType(int(summary["type"]))
address_prefix, scale = wallet_coin_unit(typ, address_prefix)
print(f"Wallet ID {wallet_id} type {typ.name} {summary['name']}")
print(f" -Total Balance: {print_balance(balances['confirmed_wallet_balance'], scale, address_prefix)}")
print(
f" -Pending Total Balance: "
f"{print_balance(balances['unconfirmed_wallet_balance'], scale, address_prefix)}"
total_balance: str = print_balance(balances["confirmed_wallet_balance"], scale, address_prefix)
unconfirmed_wallet_balance: str = print_balance(
balances["unconfirmed_wallet_balance"], scale, address_prefix
)
print(f" -Spendable: {print_balance(balances['spendable_balance'], scale, address_prefix)}")
spendable_balance: str = print_balance(balances["spendable_balance"], scale, address_prefix)
print()
print(f"{summary['name']}:")
print(f"{indent}{'-Total Balance:'.ljust(23)} {total_balance}")
print(f"{indent}{'-Pending Total Balance:'.ljust(23)} " f"{unconfirmed_wallet_balance}")
print(f"{indent}{'-Spendable:'.ljust(23)} {spendable_balance}")
print(f"{indent}{'-Type:'.ljust(23)} {typ.name}")
if len(asset_id) > 0:
print(f"{indent}{'-Asset ID:'.ljust(23)} {asset_id}")
print(f"{indent}{'-Wallet ID:'.ljust(23)} {wallet_id}")
print(" ")
trusted_peers: Dict = config["wallet"].get("trusted_peers", {})
@ -512,9 +524,24 @@ async def get_wallet(wallet_client: WalletRpcClient, fingerprint: int = None) ->
if fingerprint is not None:
log_in_response = await wallet_client.log_in(fingerprint)
else:
logged_in_fingerprint: Optional[int] = await wallet_client.get_logged_in_fingerprint()
spacing: str = " " if logged_in_fingerprint is not None else ""
current_sync_status: str = ""
if logged_in_fingerprint is not None:
if await wallet_client.get_synced():
current_sync_status = "Synced"
elif await wallet_client.get_sync_status():
current_sync_status = "Syncing"
else:
current_sync_status = "Not Synced"
print("Choose wallet key:")
for i, fp in enumerate(fingerprints):
print(f"{i+1}) {fp}")
row: str = f"{i+1}) "
row += "* " if fp == logged_in_fingerprint else spacing
row += f"{fp}"
if fp == logged_in_fingerprint and len(current_sync_status) > 0:
row += f" ({current_sync_status})"
print(row)
val = None
while val is None:
val = input("Enter a number to pick or q to quit: ")

View file

@ -1,6 +1,6 @@
import collections
import logging
from typing import Callable, Dict, List, Optional, Set, Tuple, Union
from typing import Awaitable, Callable, Dict, List, Optional, Set, Tuple, Union
from chiabip158 import PyBIP158
from clvm.casts import int_from_bytes
@ -16,6 +16,7 @@ from chia.consensus.find_fork_point import find_fork_point_in_chain
from chia.full_node.block_store import BlockStore
from chia.full_node.coin_store import CoinStore
from chia.full_node.mempool_check_conditions import get_name_puzzle_conditions, mempool_check_conditions_dict
from chia.types.block_protocol import BlockInfo
from chia.types.blockchain_format.coin import Coin
from chia.types.blockchain_format.sized_bytes import bytes32
from chia.types.coin_record import CoinRecord
@ -45,7 +46,7 @@ async def validate_block_body(
height: uint32,
npc_result: Optional[NPCResult],
fork_point_with_peak: Optional[uint32],
get_block_generator: Callable,
get_block_generator: Callable[[BlockInfo], Awaitable[Optional[BlockGenerator]]],
*,
validate_signature=True,
) -> Tuple[Optional[Err], Optional[NPCResult]]:
@ -345,7 +346,7 @@ async def validate_block_body(
)
if curr.height == 0:
break
curr = reorg_blocks[curr.height - 1]
curr = reorg_blocks[uint32(curr.height - 1)]
assert curr is not None
removal_coin_records: Dict[bytes32, CoinRecord] = {}

View file

@ -3,6 +3,7 @@ import dataclasses
import logging
import multiprocessing
import traceback
from concurrent.futures import Executor
from concurrent.futures.process import ProcessPoolExecutor
from enum import Enum
from multiprocessing.context import BaseContext
@ -47,6 +48,7 @@ from chia.types.unfinished_header_block import UnfinishedHeaderBlock
from chia.types.weight_proof import SubEpochChallengeSegment
from chia.util.errors import ConsensusError, Err
from chia.util.generator_tools import get_block_header, tx_removals_and_additions
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
@ -86,7 +88,7 @@ class Blockchain(BlockchainInterface):
# Store
block_store: BlockStore
# Used to verify blocks in parallel
pool: ProcessPoolExecutor
pool: Executor
# Set holding seen compact proofs, in order to avoid duplicates.
_seen_compact_proofs: Set[Tuple[VDFInfo, uint32]]
@ -107,6 +109,8 @@ class Blockchain(BlockchainInterface):
blockchain_dir: Path,
reserved_cores: int,
multiprocessing_context: Optional[BaseContext] = None,
*,
single_threaded: bool = False,
):
"""
Initializes a blockchain with the BlockRecords from disk, assuming they have all been
@ -116,17 +120,20 @@ class Blockchain(BlockchainInterface):
self = Blockchain()
self.lock = asyncio.Lock() # External lock handled by full node
self.compact_proof_lock = asyncio.Lock()
cpu_count = multiprocessing.cpu_count()
if cpu_count > 61:
cpu_count = 61 # Windows Server 2016 has an issue https://bugs.python.org/issue26903
num_workers = max(cpu_count - reserved_cores, 1)
self.pool = ProcessPoolExecutor(
max_workers=num_workers,
mp_context=multiprocessing_context,
initializer=setproctitle,
initargs=(f"{getproctitle()}_worker",),
)
log.info(f"Started {num_workers} processes for block validation")
if single_threaded:
self.pool = InlineExecutor()
else:
cpu_count = multiprocessing.cpu_count()
if cpu_count > 61:
cpu_count = 61 # Windows Server 2016 has an issue https://bugs.python.org/issue26903
num_workers = max(cpu_count - reserved_cores, 1)
self.pool = ProcessPoolExecutor(
max_workers=num_workers,
mp_context=multiprocessing_context,
initializer=setproctitle,
initargs=(f"{getproctitle()}_worker",),
)
log.info(f"Started {num_workers} processes for block validation")
self.constants = consensus_constants
self.coin_store = coin_store
@ -257,16 +264,14 @@ class Blockchain(BlockchainInterface):
None,
)
# Always add the block to the database
async with self.block_store.db_wrapper.lock:
async with self.block_store.db_wrapper.write_db():
try:
header_hash: bytes32 = block.header_hash
# Perform the DB operations to update the state, and rollback if something goes wrong
await self.block_store.db_wrapper.begin_transaction()
await self.block_store.add_full_block(header_hash, block, block_record)
fork_height, peak_height, records, (coin_record_change, hint_changes) = await self._reconsider_peak(
block_record, genesis, fork_point_with_peak, npc_result
)
await self.block_store.db_wrapper.commit_transaction()
# Then update the memory cache. It is important that this task is not cancelled and does not throw
self.add_block_record(block_record)
@ -281,7 +286,6 @@ class Blockchain(BlockchainInterface):
await self.__height_map.maybe_flush()
except BaseException as e:
self.block_store.rollback_cache_block(header_hash)
await self.block_store.db_wrapper.rollback_transaction()
log.error(
f"Error while adding block {block.header_hash} height {block.height},"
f" rolling back: {traceback.format_exc()} {e}"
@ -359,121 +363,122 @@ class Blockchain(BlockchainInterface):
return None, None, [], ([], {})
assert peak is not None
if block_record.weight > peak.weight:
# Find the fork. if the block is just being appended, it will return the peak
# If no blocks in common, returns -1, and reverts all blocks
if block_record.prev_hash == peak.header_hash:
fork_height: int = peak.height
elif fork_point_with_peak is not None:
fork_height = fork_point_with_peak
if block_record.weight <= peak.weight:
# This is not a heavier block than the heaviest we have seen, so we don't change the coin set
return None, None, [], ([], {})
# Find the fork. if the block is just being appended, it will return the peak
# If no blocks in common, returns -1, and reverts all blocks
if block_record.prev_hash == peak.header_hash:
fork_height: int = peak.height
elif fork_point_with_peak is not None:
fork_height = fork_point_with_peak
else:
fork_height = find_fork_point_in_chain(self, block_record, peak)
if block_record.prev_hash != peak.header_hash:
roll_changes: List[CoinRecord] = await self.coin_store.rollback_to_block(fork_height)
for coin_record in roll_changes:
latest_coin_state[coin_record.name] = coin_record
# Rollback sub_epoch_summaries
self.__height_map.rollback(fork_height)
await self.block_store.rollback(fork_height)
# Collect all blocks from fork point to new peak
blocks_to_add: List[Tuple[FullBlock, BlockRecord]] = []
curr = block_record.header_hash
while fork_height < 0 or curr != self.height_to_hash(uint32(fork_height)):
fetched_full_block: Optional[FullBlock] = await self.block_store.get_full_block(curr)
fetched_block_record: Optional[BlockRecord] = await self.block_store.get_block_record(curr)
assert fetched_full_block is not None
assert fetched_block_record is not None
blocks_to_add.append((fetched_full_block, fetched_block_record))
if fetched_full_block.height == 0:
# Doing a full reorg, starting at height 0
break
curr = fetched_block_record.prev_hash
records_to_add = []
for fetched_full_block, fetched_block_record in reversed(blocks_to_add):
records_to_add.append(fetched_block_record)
if not fetched_full_block.is_transaction_block():
continue
if fetched_block_record.header_hash == block_record.header_hash:
tx_removals, tx_additions, npc_res = await self.get_tx_removals_and_additions(
fetched_full_block, npc_result
)
else:
fork_height = find_fork_point_in_chain(self, block_record, peak)
tx_removals, tx_additions, npc_res = await self.get_tx_removals_and_additions(fetched_full_block, None)
if block_record.prev_hash != peak.header_hash:
roll_changes: List[CoinRecord] = await self.coin_store.rollback_to_block(fork_height)
for coin_record in roll_changes:
latest_coin_state[coin_record.name] = coin_record
# Rollback sub_epoch_summaries
self.__height_map.rollback(fork_height)
await self.block_store.rollback(fork_height)
# Collect all blocks from fork point to new peak
blocks_to_add: List[Tuple[FullBlock, BlockRecord]] = []
curr = block_record.header_hash
while fork_height < 0 or curr != self.height_to_hash(uint32(fork_height)):
fetched_full_block: Optional[FullBlock] = await self.block_store.get_full_block(curr)
fetched_block_record: Optional[BlockRecord] = await self.block_store.get_block_record(curr)
assert fetched_full_block is not None
assert fetched_block_record is not None
blocks_to_add.append((fetched_full_block, fetched_block_record))
if fetched_full_block.height == 0:
# Doing a full reorg, starting at height 0
break
curr = fetched_block_record.prev_hash
records_to_add = []
for fetched_full_block, fetched_block_record in reversed(blocks_to_add):
records_to_add.append(fetched_block_record)
if fetched_full_block.is_transaction_block():
if fetched_block_record.header_hash == block_record.header_hash:
tx_removals, tx_additions, npc_res = await self.get_tx_removals_and_additions(
fetched_full_block, npc_result
)
else:
tx_removals, tx_additions, npc_res = await self.get_tx_removals_and_additions(
fetched_full_block, None
)
assert fetched_full_block.foliage_transaction_block is not None
added_rec = await self.coin_store.new_block(
fetched_full_block.height,
fetched_full_block.foliage_transaction_block.timestamp,
fetched_full_block.get_included_reward_coins(),
tx_additions,
tx_removals,
)
removed_rec: List[Optional[CoinRecord]] = [
await self.coin_store.get_coin_record(name) for name in tx_removals
]
# Set additions first, then removals in order to handle ephemeral coin state
# Add in height order is also required
record: Optional[CoinRecord]
for record in added_rec:
assert record
latest_coin_state[record.name] = record
for record in removed_rec:
assert record
latest_coin_state[record.name] = record
if npc_res is not None:
hint_list: List[Tuple[bytes32, bytes]] = self.get_hint_list(npc_res)
await self.hint_store.add_hints(hint_list)
# There can be multiple coins for the same hint
for coin_id, hint in hint_list:
key = hint
if key not in hint_coin_state:
hint_coin_state[key] = {}
hint_coin_state[key][coin_id] = latest_coin_state[coin_id]
await self.block_store.set_in_chain([(br.header_hash,) for br in records_to_add])
# Changes the peak to be the new peak
await self.block_store.set_peak(block_record.header_hash)
return (
uint32(max(fork_height, 0)),
block_record.height,
records_to_add,
(list(latest_coin_state.values()), hint_coin_state),
assert fetched_full_block.foliage_transaction_block is not None
added_rec = await self.coin_store.new_block(
fetched_full_block.height,
fetched_full_block.foliage_transaction_block.timestamp,
fetched_full_block.get_included_reward_coins(),
tx_additions,
tx_removals,
)
removed_rec: List[Optional[CoinRecord]] = [
await self.coin_store.get_coin_record(name) for name in tx_removals
]
# This is not a heavier block than the heaviest we have seen, so we don't change the coin set
return None, None, [], ([], {})
# Set additions first, then removals in order to handle ephemeral coin state
# Add in height order is also required
record: Optional[CoinRecord]
for record in added_rec:
assert record
latest_coin_state[record.name] = record
for record in removed_rec:
assert record
latest_coin_state[record.name] = record
if npc_res is not None:
hint_list: List[Tuple[bytes32, bytes]] = self.get_hint_list(npc_res)
await self.hint_store.add_hints(hint_list)
# There can be multiple coins for the same hint
for coin_id, hint in hint_list:
key = hint
if key not in hint_coin_state:
hint_coin_state[key] = {}
hint_coin_state[key][coin_id] = latest_coin_state[coin_id]
await self.block_store.set_in_chain([(br.header_hash,) for br in records_to_add])
# Changes the peak to be the new peak
await self.block_store.set_peak(block_record.header_hash)
return (
uint32(max(fork_height, 0)),
block_record.height,
records_to_add,
(list(latest_coin_state.values()), hint_coin_state),
)
async def get_tx_removals_and_additions(
self, block: FullBlock, npc_result: Optional[NPCResult] = None
) -> Tuple[List[bytes32], List[Coin], Optional[NPCResult]]:
if block.is_transaction_block():
if block.transactions_generator is not None:
if npc_result is None:
block_generator: Optional[BlockGenerator] = await self.get_block_generator(block)
assert block_generator is not None
npc_result = get_name_puzzle_conditions(
block_generator,
self.constants.MAX_BLOCK_COST_CLVM,
cost_per_byte=self.constants.COST_PER_BYTE,
mempool_mode=False,
height=block.height,
)
tx_removals, tx_additions = tx_removals_and_additions(npc_result.npc_list)
return tx_removals, tx_additions, npc_result
else:
return [], [], None
else:
if not block.is_transaction_block():
return [], [], None
if block.transactions_generator is None:
return [], [], None
if npc_result is None:
block_generator: Optional[BlockGenerator] = await self.get_block_generator(block)
assert block_generator is not None
npc_result = get_name_puzzle_conditions(
block_generator,
self.constants.MAX_BLOCK_COST_CLVM,
cost_per_byte=self.constants.COST_PER_BYTE,
mempool_mode=False,
height=block.height,
)
tx_removals, tx_additions = tx_removals_and_additions(npc_result.npc_list)
return tx_removals, tx_additions, npc_result
def get_next_difficulty(self, header_hash: bytes32, new_slot: bool) -> uint64:
assert self.contains_block(header_hash)
curr = self.block_record(header_hash)

View file

@ -1,9 +1,9 @@
import asyncio
import logging
import traceback
from concurrent.futures.process import ProcessPoolExecutor
from concurrent.futures import Executor
from dataclasses import dataclass
from typing import Callable, Dict, List, Optional, Sequence, Tuple, Union
from typing import Awaitable, Callable, Dict, List, Optional, Sequence, Tuple
from blspy import AugSchemeMPL, G1Element
@ -17,6 +17,7 @@ from chia.consensus.full_block_to_block_record import block_to_block_record
from chia.consensus.get_block_challenge import get_block_challenge
from chia.consensus.pot_iterations import calculate_iterations_quality, is_overflow_block
from chia.full_node.mempool_check_conditions import get_name_puzzle_conditions
from chia.types.block_protocol import BlockInfo
from chia.types.blockchain_format.coin import Coin
from chia.types.blockchain_format.sized_bytes import bytes32
from chia.types.blockchain_format.sub_epoch_summary import SubEpochSummary
@ -169,11 +170,11 @@ async def pre_validate_blocks_multiprocessing(
constants: ConsensusConstants,
constants_json: Dict,
block_records: BlockchainInterface,
blocks: Sequence[Union[FullBlock, HeaderBlock]],
pool: ProcessPoolExecutor,
blocks: Sequence[FullBlock],
pool: Executor,
check_filter: bool,
npc_results: Dict[uint32, NPCResult],
get_block_generator: Optional[Callable],
get_block_generator: Callable[[BlockInfo, Optional[Dict[bytes32, FullBlock]]], Awaitable[Optional[BlockGenerator]]],
batch_size: int,
wp_summaries: Optional[List[SubEpochSummary]] = None,
*,
@ -288,7 +289,7 @@ async def pre_validate_blocks_multiprocessing(
prev_b = block_rec
diff_ssis.append((difficulty, sub_slot_iters))
block_dict: Dict[bytes32, Union[FullBlock, HeaderBlock]] = {}
block_dict: Dict[bytes32, FullBlock] = {}
for i, block in enumerate(blocks):
block_dict[block.header_hash] = block
if not block_record_was_present[i]:
@ -314,8 +315,8 @@ async def pre_validate_blocks_multiprocessing(
# We ONLY add blocks which are in the past, based on header hashes (which are validated later) to the
# prev blocks dict. This is important since these blocks are assumed to be valid and are used as previous
# generator references
prev_blocks_dict: Dict[uint32, Union[FullBlock, HeaderBlock]] = {}
curr_b: Union[FullBlock, HeaderBlock] = block
prev_blocks_dict: Dict[bytes32, FullBlock] = {}
curr_b: FullBlock = block
while curr_b.prev_header_hash in block_dict:
curr_b = block_dict[curr_b.prev_header_hash]

View file

@ -1015,7 +1015,8 @@ class WebSocketServer:
if parallel is True or can_start_serial_plotting:
log.info(f"Plotting will start in {config['delay']} seconds")
loop = asyncio.get_event_loop()
# TODO: loop gets passed down a lot, review for potential removal
loop = asyncio.get_running_loop()
loop.create_task(self._start_plotting(id, loop, queue))
else:
log.info("Plotting will start automatically when previous plotting finish")
@ -1058,7 +1059,8 @@ class WebSocketServer:
self.plots_queue.remove(config)
if run_next:
loop = asyncio.get_event_loop()
# TODO: review to see if we can remove this
loop = asyncio.get_running_loop()
self._run_next_serial_plotting(loop, queue)
return {"success": True}
@ -1156,9 +1158,7 @@ class WebSocketServer:
await asyncio.wait(jobs)
self.services.clear()
# TODO: fix this hack
asyncio.get_event_loop().call_later(5, lambda *args: sys.exit(0))
log.info("chia daemon exiting in 5 seconds")
log.info("chia daemon exiting")
response = {"success": True}
return response
@ -1488,7 +1488,7 @@ async def async_run_daemon(root_path: Path, wait_for_unlock: bool = False) -> in
def run_daemon(root_path: Path, wait_for_unlock: bool = False) -> int:
result = asyncio.get_event_loop().run_until_complete(async_run_daemon(root_path, wait_for_unlock))
result = asyncio.run(async_run_daemon(root_path, wait_for_unlock))
return result

View file

@ -40,7 +40,7 @@ from chia.types.blockchain_format.proof_of_space import ProofOfSpace
from chia.types.blockchain_format.sized_bytes import bytes32
from chia.util.bech32m import decode_puzzle_hash
from chia.util.byte_types import hexstr_to_bytes
from chia.util.config import load_config, save_config, config_path_for_filename, get_config_lock
from chia.util.config import load_config, lock_and_load_config, save_config, config_path_for_filename
from chia.util.hash import std_hash
from chia.util.ints import uint8, uint16, uint32, uint64
from chia.util.keychain import Keychain
@ -581,8 +581,7 @@ class Farmer:
}
def set_reward_targets(self, farmer_target_encoded: Optional[str], pool_target_encoded: Optional[str]):
with get_config_lock(self._root_path, "config.yaml"):
config = load_config(self._root_path, "config.yaml", acquire_lock=False)
with lock_and_load_config(self._root_path, "config.yaml") as config:
if farmer_target_encoded is not None:
self.farmer_target_encoded = farmer_target_encoded
self.farmer_target = decode_puzzle_hash(farmer_target_encoded)
@ -596,8 +595,7 @@ class Farmer:
async def set_payout_instructions(self, launcher_id: bytes32, payout_instructions: str):
for p2_singleton_puzzle_hash, pool_state_dict in self.pool_state.items():
if launcher_id == pool_state_dict["pool_config"].launcher_id:
with get_config_lock(self._root_path, "config.yaml"):
config = load_config(self._root_path, "config.yaml", acquire_lock=False)
with lock_and_load_config(self._root_path, "config.yaml") as config:
new_list = []
pool_list = config["pool"].get("pool_list", [])
if pool_list is not None:

View file

@ -8,7 +8,7 @@ import aiofiles
from dataclasses import dataclass
from chia.util.streamable import Streamable, streamable
from chia.util.files import write_file_async
from chia.util.db_wrapper import DBWrapper
from chia.util.db_wrapper import DBWrapper2
log = logging.getLogger(__name__)
@ -20,7 +20,7 @@ class SesCache(Streamable):
class BlockHeightMap:
db: DBWrapper
db: DBWrapper2
# the below dictionaries are loaded from the database, from the peak
# and back in time on startup.
@ -47,7 +47,7 @@ class BlockHeightMap:
__ses_filename: Path
@classmethod
async def create(cls, blockchain_dir: Path, db: DBWrapper) -> "BlockHeightMap":
async def create(cls, blockchain_dir: Path, db: DBWrapper2) -> "BlockHeightMap":
self = BlockHeightMap()
self.db = db
@ -57,26 +57,27 @@ class BlockHeightMap:
self.__height_to_hash_filename = blockchain_dir / "height-to-hash"
self.__ses_filename = blockchain_dir / "sub-epoch-summaries"
if db.db_version == 2:
async with self.db.db.execute("SELECT hash FROM current_peak WHERE key = 0") as cursor:
peak_row = await cursor.fetchone()
if peak_row is None:
return self
async with self.db.read_db() as conn:
if db.db_version == 2:
async with conn.execute("SELECT hash FROM current_peak WHERE key = 0") as cursor:
peak_row = await cursor.fetchone()
if peak_row is None:
return self
async with db.db.execute(
"SELECT header_hash,prev_hash,height,sub_epoch_summary FROM full_blocks WHERE header_hash=?",
(peak_row[0],),
) as cursor:
row = await cursor.fetchone()
if row is None:
return self
else:
async with await db.db.execute(
"SELECT header_hash,prev_hash,height,sub_epoch_summary from block_records WHERE is_peak=1"
) as cursor:
row = await cursor.fetchone()
if row is None:
return self
async with conn.execute(
"SELECT header_hash,prev_hash,height,sub_epoch_summary FROM full_blocks WHERE header_hash=?",
(peak_row[0],),
) as cursor:
row = await cursor.fetchone()
if row is None:
return self
else:
async with await conn.execute(
"SELECT header_hash,prev_hash,height,sub_epoch_summary from block_records WHERE is_peak=1"
) as cursor:
row = await cursor.fetchone()
if row is None:
return self
try:
async with aiofiles.open(self.__height_to_hash_filename, "rb") as f:
@ -169,17 +170,18 @@ class BlockHeightMap:
"INDEXED BY height WHERE height>=? AND height <?"
)
async with self.db.db.execute(query, (window_end, height)) as cursor:
async with self.db.read_db() as conn:
async with conn.execute(query, (window_end, height)) as cursor:
# maps block-hash -> (height, prev-hash, sub-epoch-summary)
ordered: Dict[bytes32, Tuple[uint32, bytes32, Optional[bytes]]] = {}
# maps block-hash -> (height, prev-hash, sub-epoch-summary)
ordered: Dict[bytes32, Tuple[uint32, bytes32, Optional[bytes]]] = {}
if self.db.db_version == 2:
for r in await cursor.fetchall():
ordered[r[0]] = (r[2], r[1], r[3])
else:
for r in await cursor.fetchall():
ordered[bytes32.fromhex(r[0])] = (r[2], bytes32.fromhex(r[1]), r[3])
if self.db.db_version == 2:
for r in await cursor.fetchall():
ordered[r[0]] = (r[2], r[1], r[3])
else:
for r in await cursor.fetchall():
ordered[bytes32.fromhex(r[0])] = (r[2], bytes32.fromhex(r[1]), r[3])
while height > window_end:
entry = ordered[prev_hash]

View file

@ -1,7 +1,6 @@
import logging
from typing import Dict, List, Optional, Tuple, Any
import aiosqlite
import zstd
from chia.consensus.block_record import BlockRecord
@ -10,7 +9,7 @@ from chia.types.full_block import FullBlock
from chia.types.blockchain_format.program import SerializedProgram
from chia.types.weight_proof import SubEpochChallengeSegment, SubEpochSegments
from chia.util.errors import Err
from chia.util.db_wrapper import DBWrapper
from chia.util.db_wrapper import DBWrapper2
from chia.util.ints import uint32
from chia.util.lru_cache import LRUCache
from chia.util.full_block_utils import generator_from_block
@ -19,94 +18,92 @@ log = logging.getLogger(__name__)
class BlockStore:
db: aiosqlite.Connection
block_cache: LRUCache
db_wrapper: DBWrapper
db_wrapper: DBWrapper2
ses_challenge_cache: LRUCache
@classmethod
async def create(cls, db_wrapper: DBWrapper):
async def create(cls, db_wrapper: DBWrapper2):
self = cls()
# All full blocks which have been added to the blockchain. Header_hash -> block
self.db_wrapper = db_wrapper
self.db = db_wrapper.db
if self.db_wrapper.db_version == 2:
async with self.db_wrapper.write_db() as conn:
# TODO: most data in block is duplicated in block_record. The only
# reason for this is that our parsing of a FullBlock is so slow,
# it's faster to store duplicate data to parse less when we just
# need the BlockRecord. Once we fix the parsing (and data structure)
# of FullBlock, this can use less space
await self.db.execute(
"CREATE TABLE IF NOT EXISTS full_blocks("
"header_hash blob PRIMARY KEY,"
"prev_hash blob,"
"height bigint,"
"sub_epoch_summary blob,"
"is_fully_compactified tinyint,"
"in_main_chain tinyint,"
"block blob,"
"block_record blob)"
)
if self.db_wrapper.db_version == 2:
# This is a single-row table containing the hash of the current
# peak. The "key" field is there to make update statements simple
await self.db.execute("CREATE TABLE IF NOT EXISTS current_peak(key int PRIMARY KEY, hash blob)")
# TODO: most data in block is duplicated in block_record. The only
# reason for this is that our parsing of a FullBlock is so slow,
# it's faster to store duplicate data to parse less when we just
# need the BlockRecord. Once we fix the parsing (and data structure)
# of FullBlock, this can use less space
await conn.execute(
"CREATE TABLE IF NOT EXISTS full_blocks("
"header_hash blob PRIMARY KEY,"
"prev_hash blob,"
"height bigint,"
"sub_epoch_summary blob,"
"is_fully_compactified tinyint,"
"in_main_chain tinyint,"
"block blob,"
"block_record blob)"
)
# If any of these indices are altered, they should also be altered
# in the chia/cmds/db_upgrade.py file
await self.db.execute("CREATE INDEX IF NOT EXISTS height on full_blocks(height)")
# This is a single-row table containing the hash of the current
# peak. The "key" field is there to make update statements simple
await conn.execute("CREATE TABLE IF NOT EXISTS current_peak(key int PRIMARY KEY, hash blob)")
# Sub epoch segments for weight proofs
await self.db.execute(
"CREATE TABLE IF NOT EXISTS sub_epoch_segments_v3("
"ses_block_hash blob PRIMARY KEY,"
"challenge_segments blob)"
)
# If any of these indices are altered, they should also be altered
# in the chia/cmds/db_upgrade.py file
await conn.execute("CREATE INDEX IF NOT EXISTS height on full_blocks(height)")
# If any of these indices are altered, they should also be altered
# in the chia/cmds/db_upgrade.py file
await self.db.execute(
"CREATE INDEX IF NOT EXISTS is_fully_compactified ON"
" full_blocks(is_fully_compactified, in_main_chain) WHERE in_main_chain=1"
)
await self.db.execute(
"CREATE INDEX IF NOT EXISTS main_chain ON full_blocks(height, in_main_chain) WHERE in_main_chain=1"
)
# Sub epoch segments for weight proofs
await conn.execute(
"CREATE TABLE IF NOT EXISTS sub_epoch_segments_v3("
"ses_block_hash blob PRIMARY KEY,"
"challenge_segments blob)"
)
else:
# If any of these indices are altered, they should also be altered
# in the chia/cmds/db_upgrade.py file
await conn.execute(
"CREATE INDEX IF NOT EXISTS is_fully_compactified ON"
" full_blocks(is_fully_compactified, in_main_chain) WHERE in_main_chain=1"
)
await conn.execute(
"CREATE INDEX IF NOT EXISTS main_chain ON full_blocks(height, in_main_chain) WHERE in_main_chain=1"
)
await self.db.execute(
"CREATE TABLE IF NOT EXISTS full_blocks(header_hash text PRIMARY KEY, height bigint,"
" is_block tinyint, is_fully_compactified tinyint, block blob)"
)
else:
# Block records
await self.db.execute(
"CREATE TABLE IF NOT EXISTS block_records(header_hash "
"text PRIMARY KEY, prev_hash text, height bigint,"
"block blob, sub_epoch_summary blob, is_peak tinyint, is_block tinyint)"
)
await conn.execute(
"CREATE TABLE IF NOT EXISTS full_blocks(header_hash text PRIMARY KEY, height bigint,"
" is_block tinyint, is_fully_compactified tinyint, block blob)"
)
# Sub epoch segments for weight proofs
await self.db.execute(
"CREATE TABLE IF NOT EXISTS sub_epoch_segments_v3(ses_block_hash text PRIMARY KEY,"
"challenge_segments blob)"
)
# Block records
await conn.execute(
"CREATE TABLE IF NOT EXISTS block_records(header_hash "
"text PRIMARY KEY, prev_hash text, height bigint,"
"block blob, sub_epoch_summary blob, is_peak tinyint, is_block tinyint)"
)
# Height index so we can look up in order of height for sync purposes
await self.db.execute("CREATE INDEX IF NOT EXISTS full_block_height on full_blocks(height)")
await self.db.execute(
"CREATE INDEX IF NOT EXISTS is_fully_compactified on full_blocks(is_fully_compactified)"
)
# Sub epoch segments for weight proofs
await conn.execute(
"CREATE TABLE IF NOT EXISTS sub_epoch_segments_v3(ses_block_hash text PRIMARY KEY,"
"challenge_segments blob)"
)
await self.db.execute("CREATE INDEX IF NOT EXISTS height on block_records(height)")
# Height index so we can look up in order of height for sync purposes
await conn.execute("CREATE INDEX IF NOT EXISTS full_block_height on full_blocks(height)")
await conn.execute(
"CREATE INDEX IF NOT EXISTS is_fully_compactified on full_blocks(is_fully_compactified)"
)
await self.db.execute("CREATE INDEX IF NOT EXISTS peak on block_records(is_peak)")
await conn.execute("CREATE INDEX IF NOT EXISTS height on block_records(height)")
await conn.execute("CREATE INDEX IF NOT EXISTS peak on block_records(is_peak)")
await self.db.commit()
self.block_cache = LRUCache(1000)
self.ses_challenge_cache = LRUCache(50)
return self
@ -134,15 +131,17 @@ class BlockStore:
async def rollback(self, height: int) -> None:
if self.db_wrapper.db_version == 2:
await self.db.execute(
"UPDATE OR FAIL full_blocks SET in_main_chain=0 WHERE height>? AND in_main_chain=1", (height,)
)
async with self.db_wrapper.write_db() as conn:
await conn.execute(
"UPDATE OR FAIL full_blocks SET in_main_chain=0 WHERE height>? AND in_main_chain=1", (height,)
)
async def set_in_chain(self, header_hashes: List[Tuple[bytes32]]) -> None:
if self.db_wrapper.db_version == 2:
await self.db.executemany(
"UPDATE OR FAIL full_blocks SET in_main_chain=1 WHERE header_hash=?", header_hashes
)
async with self.db_wrapper.write_db() as conn:
await conn.executemany(
"UPDATE OR FAIL full_blocks SET in_main_chain=1 WHERE header_hash=?", header_hashes
)
async def replace_proof(self, header_hash: bytes32, block: FullBlock) -> None:
@ -156,14 +155,15 @@ class BlockStore:
self.block_cache.put(header_hash, block)
await self.db.execute(
"UPDATE full_blocks SET block=?,is_fully_compactified=? WHERE header_hash=?",
(
block_bytes,
int(block.is_fully_compactified()),
self.maybe_to_hex(header_hash),
),
)
async with self.db_wrapper.write_db() as conn:
await conn.execute(
"UPDATE full_blocks SET block=?,is_fully_compactified=? WHERE header_hash=?",
(
block_bytes,
int(block.is_fully_compactified()),
self.maybe_to_hex(header_hash),
),
)
async def add_full_block(self, header_hash: bytes32, block: FullBlock, block_record: BlockRecord) -> None:
self.block_cache.put(header_hash, block)
@ -176,56 +176,57 @@ class BlockStore:
else bytes(block_record.sub_epoch_summary_included)
)
await self.db.execute(
"INSERT OR IGNORE INTO full_blocks VALUES(?, ?, ?, ?, ?, ?, ?, ?)",
(
header_hash,
block.prev_header_hash,
block.height,
ses,
int(block.is_fully_compactified()),
False, # in_main_chain
self.compress(block),
bytes(block_record),
),
)
async with self.db_wrapper.write_db() as conn:
await conn.execute(
"INSERT OR IGNORE INTO full_blocks VALUES(?, ?, ?, ?, ?, ?, ?, ?)",
(
header_hash,
block.prev_header_hash,
block.height,
ses,
int(block.is_fully_compactified()),
False, # in_main_chain
self.compress(block),
bytes(block_record),
),
)
else:
await self.db.execute(
"INSERT OR IGNORE INTO full_blocks VALUES(?, ?, ?, ?, ?)",
(
header_hash.hex(),
block.height,
int(block.is_transaction_block()),
int(block.is_fully_compactified()),
bytes(block),
),
)
async with self.db_wrapper.write_db() as conn:
await conn.execute(
"INSERT OR IGNORE INTO full_blocks VALUES(?, ?, ?, ?, ?)",
(
header_hash.hex(),
block.height,
int(block.is_transaction_block()),
int(block.is_fully_compactified()),
bytes(block),
),
)
await self.db.execute(
"INSERT OR IGNORE INTO block_records VALUES(?, ?, ?, ?,?, ?, ?)",
(
header_hash.hex(),
block.prev_header_hash.hex(),
block.height,
bytes(block_record),
None
if block_record.sub_epoch_summary_included is None
else bytes(block_record.sub_epoch_summary_included),
False,
block.is_transaction_block(),
),
)
await conn.execute(
"INSERT OR IGNORE INTO block_records VALUES(?, ?, ?, ?,?, ?, ?)",
(
header_hash.hex(),
block.prev_header_hash.hex(),
block.height,
bytes(block_record),
None
if block_record.sub_epoch_summary_included is None
else bytes(block_record.sub_epoch_summary_included),
False,
block.is_transaction_block(),
),
)
async def persist_sub_epoch_challenge_segments(
self, ses_block_hash: bytes32, segments: List[SubEpochChallengeSegment]
) -> None:
async with self.db_wrapper.lock:
await self.db.execute(
async with self.db_wrapper.write_db() as conn:
await conn.execute(
"INSERT OR REPLACE INTO sub_epoch_segments_v3 VALUES(?, ?)",
(self.maybe_to_hex(ses_block_hash), bytes(SubEpochSegments(segments))),
)
await self.db.commit()
async def get_sub_epoch_challenge_segments(
self,
@ -235,11 +236,12 @@ class BlockStore:
if cached is not None:
return cached
async with self.db.execute(
"SELECT challenge_segments from sub_epoch_segments_v3 WHERE ses_block_hash=?",
(self.maybe_to_hex(ses_block_hash),),
) as cursor:
row = await cursor.fetchone()
async with self.db_wrapper.read_db() as conn:
async with conn.execute(
"SELECT challenge_segments from sub_epoch_segments_v3 WHERE ses_block_hash=?",
(self.maybe_to_hex(ses_block_hash),),
) as cursor:
row = await cursor.fetchone()
if row is not None:
challenge_segments = SubEpochSegments.from_bytes(row[0]).challenge_segments
@ -261,10 +263,11 @@ class BlockStore:
log.debug(f"cache hit for block {header_hash.hex()}")
return cached
log.debug(f"cache miss for block {header_hash.hex()}")
async with self.db.execute(
"SELECT block from full_blocks WHERE header_hash=?", (self.maybe_to_hex(header_hash),)
) as cursor:
row = await cursor.fetchone()
async with self.db_wrapper.read_db() as conn:
async with conn.execute(
"SELECT block from full_blocks WHERE header_hash=?", (self.maybe_to_hex(header_hash),)
) as cursor:
row = await cursor.fetchone()
if row is not None:
block = self.maybe_decompress(row[0])
self.block_cache.put(header_hash, block)
@ -277,10 +280,11 @@ class BlockStore:
log.debug(f"cache hit for block {header_hash.hex()}")
return bytes(cached)
log.debug(f"cache miss for block {header_hash.hex()}")
async with self.db.execute(
"SELECT block from full_blocks WHERE header_hash=?", (self.maybe_to_hex(header_hash),)
) as cursor:
row = await cursor.fetchone()
async with self.db_wrapper.read_db() as conn:
async with conn.execute(
"SELECT block from full_blocks WHERE header_hash=?", (self.maybe_to_hex(header_hash),)
) as cursor:
row = await cursor.fetchone()
if row is not None:
if self.db_wrapper.db_version == 2:
return zstd.decompress(row[0])
@ -295,11 +299,12 @@ class BlockStore:
heights_db = tuple(heights)
formatted_str = f'SELECT block from full_blocks WHERE height in ({"?," * (len(heights_db) - 1)}?)'
async with self.db.execute(formatted_str, heights_db) as cursor:
ret: List[FullBlock] = []
for row in await cursor.fetchall():
ret.append(self.maybe_decompress(row[0]))
return ret
async with self.db_wrapper.read_db() as conn:
async with conn.execute(formatted_str, heights_db) as cursor:
ret: List[FullBlock] = []
for row in await cursor.fetchall():
ret.append(self.maybe_decompress(row[0]))
return ret
async def get_generator(self, header_hash: bytes32) -> Optional[SerializedProgram]:
@ -309,24 +314,25 @@ class BlockStore:
return cached.transactions_generator
formatted_str = "SELECT block, height from full_blocks WHERE header_hash=?"
async with self.db.execute(formatted_str, (self.maybe_to_hex(header_hash),)) as cursor:
row = await cursor.fetchone()
if row is None:
return None
if self.db_wrapper.db_version == 2:
block_bytes = zstd.decompress(row[0])
else:
block_bytes = row[0]
async with self.db_wrapper.read_db() as conn:
async with conn.execute(formatted_str, (self.maybe_to_hex(header_hash),)) as cursor:
row = await cursor.fetchone()
if row is None:
return None
if self.db_wrapper.db_version == 2:
block_bytes = zstd.decompress(row[0])
else:
block_bytes = row[0]
try:
return generator_from_block(block_bytes)
except Exception as e:
log.error(f"cheap parser failed for block at height {row[1]}: {e}")
# this is defensive, on the off-chance that
# generator_from_block() fails, fall back to the reliable
# definition of parsing a block
b = FullBlock.from_bytes(block_bytes)
return b.transactions_generator
try:
return generator_from_block(block_bytes)
except Exception as e:
log.error(f"cheap parser failed for block at height {row[1]}: {e}")
# this is defensive, on the off-chance that
# generator_from_block() fails, fall back to the reliable
# definition of parsing a block
b = FullBlock.from_bytes(block_bytes)
return b.transactions_generator
async def get_generators_at(self, heights: List[uint32]) -> List[SerializedProgram]:
assert self.db_wrapper.db_version == 2
@ -340,22 +346,23 @@ class BlockStore:
f"SELECT block, height from full_blocks "
f'WHERE in_main_chain=1 AND height in ({"?," * (len(heights_db) - 1)}?)'
)
async with self.db.execute(formatted_str, heights_db) as cursor:
async for row in cursor:
block_bytes = zstd.decompress(row[0])
async with self.db_wrapper.read_db() as conn:
async with conn.execute(formatted_str, heights_db) as cursor:
async for row in cursor:
block_bytes = zstd.decompress(row[0])
try:
gen = generator_from_block(block_bytes)
except Exception as e:
log.error(f"cheap parser failed for block at height {row[1]}: {e}")
# this is defensive, on the off-chance that
# generator_from_block() fails, fall back to the reliable
# definition of parsing a block
b = FullBlock.from_bytes(block_bytes)
gen = b.transactions_generator
if gen is None:
raise ValueError(Err.GENERATOR_REF_HAS_NO_GENERATOR)
generators[uint32(row[1])] = gen
try:
gen = generator_from_block(block_bytes)
except Exception as e:
log.error(f"cheap parser failed for block at height {row[1]}: {e}")
# this is defensive, on the off-chance that
# generator_from_block() fails, fall back to the reliable
# definition of parsing a block
b = FullBlock.from_bytes(block_bytes)
gen = b.transactions_generator
if gen is None:
raise ValueError(Err.GENERATOR_REF_HAS_NO_GENERATOR)
generators[uint32(row[1])] = gen
return [generators[h] for h in heights]
@ -369,20 +376,22 @@ class BlockStore:
all_blocks: Dict[bytes32, BlockRecord] = {}
if self.db_wrapper.db_version == 2:
async with self.db.execute(
"SELECT header_hash,block_record FROM full_blocks "
f'WHERE header_hash in ({"?," * (len(header_hashes) - 1)}?)',
tuple(header_hashes),
) as cursor:
for row in await cursor.fetchall():
header_hash = bytes32(row[0])
all_blocks[header_hash] = BlockRecord.from_bytes(row[1])
async with self.db_wrapper.read_db() as conn:
async with conn.execute(
"SELECT header_hash,block_record FROM full_blocks "
f'WHERE header_hash in ({"?," * (len(header_hashes) - 1)}?)',
tuple(header_hashes),
) as cursor:
for row in await cursor.fetchall():
header_hash = bytes32(row[0])
all_blocks[header_hash] = BlockRecord.from_bytes(row[1])
else:
formatted_str = f'SELECT block from block_records WHERE header_hash in ({"?," * (len(header_hashes) - 1)}?)'
async with self.db.execute(formatted_str, tuple([hh.hex() for hh in header_hashes])) as cursor:
for row in await cursor.fetchall():
block_rec: BlockRecord = BlockRecord.from_bytes(row[0])
all_blocks[block_rec.header_hash] = block_rec
async with self.db_wrapper.read_db() as conn:
async with conn.execute(formatted_str, tuple([hh.hex() for hh in header_hashes])) as cursor:
for row in await cursor.fetchall():
block_rec: BlockRecord = BlockRecord.from_bytes(row[0])
all_blocks[block_rec.header_hash] = block_rec
ret: List[BlockRecord] = []
for hh in header_hashes:
@ -409,15 +418,16 @@ class BlockStore:
f'SELECT header_hash, block from full_blocks WHERE header_hash in ({"?," * (len(header_hashes_db) - 1)}?)'
)
all_blocks: Dict[bytes32, FullBlock] = {}
async with self.db.execute(formatted_str, header_hashes_db) as cursor:
for row in await cursor.fetchall():
header_hash = self.maybe_from_hex(row[0])
full_block: FullBlock = self.maybe_decompress(row[1])
# TODO: address hint error and remove ignore
# error: Invalid index type "bytes" for "Dict[bytes32, FullBlock]";
# expected type "bytes32" [index]
all_blocks[header_hash] = full_block # type: ignore[index]
self.block_cache.put(header_hash, full_block)
async with self.db_wrapper.read_db() as conn:
async with conn.execute(formatted_str, header_hashes_db) as cursor:
for row in await cursor.fetchall():
header_hash = self.maybe_from_hex(row[0])
full_block: FullBlock = self.maybe_decompress(row[1])
# TODO: address hint error and remove ignore
# error: Invalid index type "bytes" for "Dict[bytes32, FullBlock]";
# expected type "bytes32" [index]
all_blocks[header_hash] = full_block # type: ignore[index]
self.block_cache.put(header_hash, full_block)
ret: List[FullBlock] = []
for hh in header_hashes:
if hh not in all_blocks:
@ -429,20 +439,22 @@ class BlockStore:
if self.db_wrapper.db_version == 2:
async with self.db.execute(
"SELECT block_record FROM full_blocks WHERE header_hash=?",
(header_hash,),
) as cursor:
row = await cursor.fetchone()
async with self.db_wrapper.read_db() as conn:
async with conn.execute(
"SELECT block_record FROM full_blocks WHERE header_hash=?",
(header_hash,),
) as cursor:
row = await cursor.fetchone()
if row is not None:
return BlockRecord.from_bytes(row[0])
else:
async with self.db.execute(
"SELECT block from block_records WHERE header_hash=?",
(header_hash.hex(),),
) as cursor:
row = await cursor.fetchone()
async with self.db_wrapper.read_db() as conn:
async with conn.execute(
"SELECT block from block_records WHERE header_hash=?",
(header_hash.hex(),),
) as cursor:
row = await cursor.fetchone()
if row is not None:
return BlockRecord.from_bytes(row[0])
return None
@ -460,40 +472,45 @@ class BlockStore:
ret: Dict[bytes32, BlockRecord] = {}
if self.db_wrapper.db_version == 2:
async with self.db.execute(
"SELECT header_hash, block_record FROM full_blocks WHERE height >= ? AND height <= ?",
(start, stop),
) as cursor:
for row in await cursor.fetchall():
header_hash = bytes32(row[0])
ret[header_hash] = BlockRecord.from_bytes(row[1])
async with self.db_wrapper.read_db() as conn:
async with conn.execute(
"SELECT header_hash, block_record FROM full_blocks WHERE height >= ? AND height <= ?",
(start, stop),
) as cursor:
for row in await cursor.fetchall():
header_hash = bytes32(row[0])
ret[header_hash] = BlockRecord.from_bytes(row[1])
else:
formatted_str = f"SELECT header_hash, block from block_records WHERE height >= {start} and height <= {stop}"
async with await self.db.execute(formatted_str) as cursor:
for row in await cursor.fetchall():
header_hash = bytes32(self.maybe_from_hex(row[0]))
ret[header_hash] = BlockRecord.from_bytes(row[1])
async with self.db_wrapper.read_db() as conn:
async with await conn.execute(formatted_str) as cursor:
for row in await cursor.fetchall():
header_hash = bytes32(self.maybe_from_hex(row[0]))
ret[header_hash] = BlockRecord.from_bytes(row[1])
return ret
async def get_peak(self) -> Optional[Tuple[bytes32, uint32]]:
if self.db_wrapper.db_version == 2:
async with self.db.execute("SELECT hash FROM current_peak WHERE key = 0") as cursor:
peak_row = await cursor.fetchone()
async with self.db_wrapper.read_db() as conn:
async with conn.execute("SELECT hash FROM current_peak WHERE key = 0") as cursor:
peak_row = await cursor.fetchone()
if peak_row is None:
return None
async with self.db.execute("SELECT height FROM full_blocks WHERE header_hash=?", (peak_row[0],)) as cursor:
peak_height = await cursor.fetchone()
async with self.db_wrapper.read_db() as conn:
async with conn.execute("SELECT height FROM full_blocks WHERE header_hash=?", (peak_row[0],)) as cursor:
peak_height = await cursor.fetchone()
if peak_height is None:
return None
return bytes32(peak_row[0]), uint32(peak_height[0])
else:
async with self.db.execute("SELECT header_hash, height from block_records WHERE is_peak = 1") as cursor:
peak_row = await cursor.fetchone()
async with self.db_wrapper.read_db() as conn:
async with conn.execute("SELECT header_hash, height from block_records WHERE is_peak = 1") as cursor:
peak_row = await cursor.fetchone()
if peak_row is None:
return None
return bytes32(bytes.fromhex(peak_row[0])), uint32(peak_row[1])
@ -513,20 +530,22 @@ class BlockStore:
ret: Dict[bytes32, BlockRecord] = {}
if self.db_wrapper.db_version == 2:
async with self.db.execute(
"SELECT header_hash, block_record FROM full_blocks WHERE height >= ?",
(peak[1] - blocks_n,),
) as cursor:
for row in await cursor.fetchall():
header_hash = bytes32(row[0])
ret[header_hash] = BlockRecord.from_bytes(row[1])
async with self.db_wrapper.read_db() as conn:
async with conn.execute(
"SELECT header_hash, block_record FROM full_blocks WHERE height >= ?",
(peak[1] - blocks_n,),
) as cursor:
for row in await cursor.fetchall():
header_hash = bytes32(row[0])
ret[header_hash] = BlockRecord.from_bytes(row[1])
else:
formatted_str = f"SELECT header_hash, block from block_records WHERE height >= {peak[1] - blocks_n}"
async with self.db.execute(formatted_str) as cursor:
for row in await cursor.fetchall():
header_hash = bytes32(self.maybe_from_hex(row[0]))
ret[header_hash] = BlockRecord.from_bytes(row[1])
async with self.db_wrapper.read_db() as conn:
async with conn.execute(formatted_str) as cursor:
for row in await cursor.fetchall():
header_hash = bytes32(self.maybe_from_hex(row[0]))
ret[header_hash] = BlockRecord.from_bytes(row[1])
return ret, peak[0]
@ -536,19 +555,22 @@ class BlockStore:
if self.db_wrapper.db_version == 2:
# Note: we use the key field as 0 just to ensure all inserts replace the existing row
await self.db.execute("INSERT OR REPLACE INTO current_peak VALUES(?, ?)", (0, header_hash))
async with self.db_wrapper.write_db() as conn:
await conn.execute("INSERT OR REPLACE INTO current_peak VALUES(?, ?)", (0, header_hash))
else:
await self.db.execute("UPDATE block_records SET is_peak=0 WHERE is_peak=1")
await self.db.execute(
"UPDATE block_records SET is_peak=1 WHERE header_hash=?",
(self.maybe_to_hex(header_hash),),
)
async with self.db_wrapper.write_db() as conn:
await conn.execute("UPDATE block_records SET is_peak=0 WHERE is_peak=1")
await conn.execute(
"UPDATE block_records SET is_peak=1 WHERE header_hash=?",
(self.maybe_to_hex(header_hash),),
)
async def is_fully_compactified(self, header_hash: bytes32) -> Optional[bool]:
async with self.db.execute(
"SELECT is_fully_compactified from full_blocks WHERE header_hash=?", (self.maybe_to_hex(header_hash),)
) as cursor:
row = await cursor.fetchone()
async with self.db_wrapper.write_db() as conn:
async with conn.execute(
"SELECT is_fully_compactified from full_blocks WHERE header_hash=?", (self.maybe_to_hex(header_hash),)
) as cursor:
row = await cursor.fetchone()
if row is None:
return None
return bool(row[0])
@ -556,20 +578,22 @@ class BlockStore:
async def get_random_not_compactified(self, number: int) -> List[int]:
if self.db_wrapper.db_version == 2:
async with self.db.execute(
f"SELECT height FROM full_blocks WHERE in_main_chain=1 AND is_fully_compactified=0 "
f"ORDER BY RANDOM() LIMIT {number}"
) as cursor:
rows = await cursor.fetchall()
async with self.db_wrapper.read_db() as conn:
async with conn.execute(
f"SELECT height FROM full_blocks WHERE in_main_chain=1 AND is_fully_compactified=0 "
f"ORDER BY RANDOM() LIMIT {number}"
) as cursor:
rows = await cursor.fetchall()
else:
# Since orphan blocks do not get compactified, we need to check whether all blocks with a
# certain height are not compact. And if we do have compact orphan blocks, then all that
# happens is that the occasional chain block stays uncompact - not ideal, but harmless.
async with self.db.execute(
f"SELECT height FROM full_blocks GROUP BY height HAVING sum(is_fully_compactified)=0 "
f"ORDER BY RANDOM() LIMIT {number}"
) as cursor:
rows = await cursor.fetchall()
async with self.db_wrapper.read_db() as conn:
async with conn.execute(
f"SELECT height FROM full_blocks GROUP BY height HAVING sum(is_fully_compactified)=0 "
f"ORDER BY RANDOM() LIMIT {number}"
) as cursor:
rows = await cursor.fetchall()
heights = [int(row[0]) for row in rows]
@ -578,13 +602,15 @@ class BlockStore:
async def count_compactified_blocks(self) -> int:
if self.db_wrapper.db_version == 2:
# DB V2 has an index on is_fully_compactified only for blocks in the main chain
async with self.db.execute(
"select count(*) from full_blocks where is_fully_compactified=1 and in_main_chain=1"
) as cursor:
row = await cursor.fetchone()
async with self.db_wrapper.read_db() as conn:
async with conn.execute(
"select count(*) from full_blocks where is_fully_compactified=1 and in_main_chain=1"
) as cursor:
row = await cursor.fetchone()
else:
async with self.db.execute("select count(*) from full_blocks where is_fully_compactified=1") as cursor:
row = await cursor.fetchone()
async with self.db_wrapper.read_db() as conn:
async with conn.execute("select count(*) from full_blocks where is_fully_compactified=1") as cursor:
row = await cursor.fetchone()
assert row is not None
@ -594,13 +620,15 @@ class BlockStore:
async def count_uncompactified_blocks(self) -> int:
if self.db_wrapper.db_version == 2:
# DB V2 has an index on is_fully_compactified only for blocks in the main chain
async with self.db.execute(
"select count(*) from full_blocks where is_fully_compactified=0 and in_main_chain=1"
) as cursor:
row = await cursor.fetchone()
async with self.db_wrapper.read_db() as conn:
async with conn.execute(
"select count(*) from full_blocks where is_fully_compactified=0 and in_main_chain=1"
) as cursor:
row = await cursor.fetchone()
else:
async with self.db.execute("select count(*) from full_blocks where is_fully_compactified=0") as cursor:
row = await cursor.fetchone()
async with self.db_wrapper.read_db() as conn:
async with conn.execute("select count(*) from full_blocks where is_fully_compactified=0") as cursor:
row = await cursor.fetchone()
assert row is not None

View file

@ -1,10 +1,9 @@
from typing import List, Optional, Set, Dict, Any, Tuple
import aiosqlite
from chia.protocols.wallet_protocol import CoinState
from chia.types.blockchain_format.coin import Coin
from chia.types.blockchain_format.sized_bytes import bytes32
from chia.types.coin_record import CoinRecord
from chia.util.db_wrapper import DBWrapper
from chia.util.db_wrapper import DBWrapper2
from chia.util.ints import uint32, uint64
from chia.util.lru_cache import LRUCache
from chia.util.chunks import chunks
@ -22,74 +21,72 @@ class CoinStore:
A cache is maintained for quicker access to recent coins.
"""
coin_record_db: aiosqlite.Connection
coin_record_cache: LRUCache
cache_size: uint32
db_wrapper: DBWrapper
db_wrapper: DBWrapper2
@classmethod
async def create(cls, db_wrapper: DBWrapper, cache_size: uint32 = uint32(60000)):
async def create(cls, db_wrapper: DBWrapper2, cache_size: uint32 = uint32(60000)):
self = cls()
self.cache_size = cache_size
self.db_wrapper = db_wrapper
self.coin_record_db = db_wrapper.db
if self.db_wrapper.db_version == 2:
async with self.db_wrapper.write_db() as conn:
# the coin_name is unique in this table because the CoinStore always
# only represent a single peak
await self.coin_record_db.execute(
"CREATE TABLE IF NOT EXISTS coin_record("
"coin_name blob PRIMARY KEY,"
" confirmed_index bigint,"
" spent_index bigint," # if this is zero, it means the coin has not been spent
" coinbase int,"
" puzzle_hash blob,"
" coin_parent blob,"
" amount blob," # we use a blob of 8 bytes to store uint64
" timestamp bigint)"
)
if self.db_wrapper.db_version == 2:
else:
# the coin_name is unique in this table because the CoinStore always
# only represent a single peak
await self.coin_record_db.execute(
(
# the coin_name is unique in this table because the CoinStore always
# only represent a single peak
await conn.execute(
"CREATE TABLE IF NOT EXISTS coin_record("
"coin_name text PRIMARY KEY,"
"coin_name blob PRIMARY KEY,"
" confirmed_index bigint,"
" spent_index bigint,"
" spent int,"
" spent_index bigint," # if this is zero, it means the coin has not been spent
" coinbase int,"
" puzzle_hash text,"
" coin_parent text,"
" amount blob,"
" puzzle_hash blob,"
" coin_parent blob,"
" amount blob," # we use a blob of 8 bytes to store uint64
" timestamp bigint)"
)
)
# Useful for reorg lookups
await self.coin_record_db.execute(
"CREATE INDEX IF NOT EXISTS coin_confirmed_index on coin_record(confirmed_index)"
)
else:
await self.coin_record_db.execute("CREATE INDEX IF NOT EXISTS coin_spent_index on coin_record(spent_index)")
# the coin_name is unique in this table because the CoinStore always
# only represent a single peak
await conn.execute(
(
"CREATE TABLE IF NOT EXISTS coin_record("
"coin_name text PRIMARY KEY,"
" confirmed_index bigint,"
" spent_index bigint,"
" spent int,"
" coinbase int,"
" puzzle_hash text,"
" coin_parent text,"
" amount blob,"
" timestamp bigint)"
)
)
await self.coin_record_db.execute("CREATE INDEX IF NOT EXISTS coin_puzzle_hash on coin_record(puzzle_hash)")
# Useful for reorg lookups
await conn.execute("CREATE INDEX IF NOT EXISTS coin_confirmed_index on coin_record(confirmed_index)")
await self.coin_record_db.execute("CREATE INDEX IF NOT EXISTS coin_parent_index on coin_record(coin_parent)")
await conn.execute("CREATE INDEX IF NOT EXISTS coin_spent_index on coin_record(spent_index)")
await conn.execute("CREATE INDEX IF NOT EXISTS coin_puzzle_hash on coin_record(puzzle_hash)")
await conn.execute("CREATE INDEX IF NOT EXISTS coin_parent_index on coin_record(coin_parent)")
await self.coin_record_db.commit()
self.coin_record_cache = LRUCache(cache_size)
return self
async def num_unspent(self) -> int:
async with self.coin_record_db.execute("SELECT COUNT(*) FROM coin_record WHERE spent_index=0") as cursor:
row = await cursor.fetchone()
if row is not None:
return row[0]
async with self.db_wrapper.read_db() as conn:
async with conn.execute("SELECT COUNT(*) FROM coin_record WHERE spent_index=0") as cursor:
row = await cursor.fetchone()
if row is not None:
return row[0]
return 0
def maybe_from_hex(self, field: Any) -> bytes:
@ -165,48 +162,51 @@ class CoinStore:
if cached is not None:
return cached
async with self.coin_record_db.execute(
"SELECT confirmed_index, spent_index, coinbase, puzzle_hash, "
"coin_parent, amount, timestamp FROM coin_record WHERE coin_name=?",
(self.maybe_to_hex(coin_name),),
) as cursor:
row = await cursor.fetchone()
if row is not None:
coin = self.row_to_coin(row)
record = CoinRecord(coin, row[0], row[1], row[2], row[6])
self.coin_record_cache.put(record.coin.name(), record)
return record
async with self.db_wrapper.read_db() as conn:
async with conn.execute(
"SELECT confirmed_index, spent_index, coinbase, puzzle_hash, "
"coin_parent, amount, timestamp FROM coin_record WHERE coin_name=?",
(self.maybe_to_hex(coin_name),),
) as cursor:
row = await cursor.fetchone()
if row is not None:
coin = self.row_to_coin(row)
record = CoinRecord(coin, row[0], row[1], row[2], row[6])
self.coin_record_cache.put(record.coin.name(), record)
return record
return None
async def get_coins_added_at_height(self, height: uint32) -> List[CoinRecord]:
async with self.coin_record_db.execute(
"SELECT confirmed_index, spent_index, coinbase, puzzle_hash, "
"coin_parent, amount, timestamp FROM coin_record WHERE confirmed_index=?",
(height,),
) as cursor:
rows = await cursor.fetchall()
coins = []
for row in rows:
coin = self.row_to_coin(row)
coins.append(CoinRecord(coin, row[0], row[1], row[2], row[6]))
return coins
async with self.db_wrapper.read_db() as conn:
async with conn.execute(
"SELECT confirmed_index, spent_index, coinbase, puzzle_hash, "
"coin_parent, amount, timestamp FROM coin_record WHERE confirmed_index=?",
(height,),
) as cursor:
rows = await cursor.fetchall()
coins = []
for row in rows:
coin = self.row_to_coin(row)
coins.append(CoinRecord(coin, row[0], row[1], row[2], row[6]))
return coins
async def get_coins_removed_at_height(self, height: uint32) -> List[CoinRecord]:
# Special case to avoid querying all unspent coins (spent_index=0)
if height == 0:
return []
async with self.coin_record_db.execute(
"SELECT confirmed_index, spent_index, coinbase, puzzle_hash, "
"coin_parent, amount, timestamp FROM coin_record WHERE spent_index=?",
(height,),
) as cursor:
coins = []
for row in await cursor.fetchall():
if row[1] != 0:
coin = self.row_to_coin(row)
coin_record = CoinRecord(coin, row[0], row[1], row[2], row[6])
coins.append(coin_record)
return coins
async with self.db_wrapper.read_db() as conn:
async with conn.execute(
"SELECT confirmed_index, spent_index, coinbase, puzzle_hash, "
"coin_parent, amount, timestamp FROM coin_record WHERE spent_index=?",
(height,),
) as cursor:
coins = []
for row in await cursor.fetchall():
if row[1] != 0:
coin = self.row_to_coin(row)
coin_record = CoinRecord(coin, row[0], row[1], row[2], row[6])
coins.append(coin_record)
return coins
# Checks DB and DiffStores for CoinRecords with puzzle_hash and returns them
async def get_coin_records_by_puzzle_hash(
@ -219,18 +219,19 @@ class CoinStore:
coins = set()
async with self.coin_record_db.execute(
f"SELECT confirmed_index, spent_index, coinbase, puzzle_hash, "
f"coin_parent, amount, timestamp FROM coin_record INDEXED BY coin_puzzle_hash WHERE puzzle_hash=? "
f"AND confirmed_index>=? AND confirmed_index<? "
f"{'' if include_spent_coins else 'AND spent_index=0'}",
(self.maybe_to_hex(puzzle_hash), start_height, end_height),
) as cursor:
async with self.db_wrapper.read_db() as conn:
async with conn.execute(
f"SELECT confirmed_index, spent_index, coinbase, puzzle_hash, "
f"coin_parent, amount, timestamp FROM coin_record INDEXED BY coin_puzzle_hash WHERE puzzle_hash=? "
f"AND confirmed_index>=? AND confirmed_index<? "
f"{'' if include_spent_coins else 'AND spent_index=0'}",
(self.maybe_to_hex(puzzle_hash), start_height, end_height),
) as cursor:
for row in await cursor.fetchall():
coin = self.row_to_coin(row)
coins.add(CoinRecord(coin, row[0], row[1], row[2], row[6]))
return list(coins)
for row in await cursor.fetchall():
coin = self.row_to_coin(row)
coins.add(CoinRecord(coin, row[0], row[1], row[2], row[6]))
return list(coins)
async def get_coin_records_by_puzzle_hashes(
self,
@ -248,19 +249,21 @@ class CoinStore:
puzzle_hashes_db = tuple(puzzle_hashes)
else:
puzzle_hashes_db = tuple([ph.hex() for ph in puzzle_hashes])
async with self.coin_record_db.execute(
f"SELECT confirmed_index, spent_index, coinbase, puzzle_hash, "
f"coin_parent, amount, timestamp FROM coin_record INDEXED BY coin_puzzle_hash "
f'WHERE puzzle_hash in ({"?," * (len(puzzle_hashes) - 1)}?) '
f"AND confirmed_index>=? AND confirmed_index<? "
f"{'' if include_spent_coins else 'AND spent_index=0'}",
puzzle_hashes_db + (start_height, end_height),
) as cursor:
for row in await cursor.fetchall():
coin = self.row_to_coin(row)
coins.add(CoinRecord(coin, row[0], row[1], row[2], row[6]))
return list(coins)
async with self.db_wrapper.read_db() as conn:
async with conn.execute(
f"SELECT confirmed_index, spent_index, coinbase, puzzle_hash, "
f"coin_parent, amount, timestamp FROM coin_record INDEXED BY coin_puzzle_hash "
f'WHERE puzzle_hash in ({"?," * (len(puzzle_hashes) - 1)}?) '
f"AND confirmed_index>=? AND confirmed_index<? "
f"{'' if include_spent_coins else 'AND spent_index=0'}",
puzzle_hashes_db + (start_height, end_height),
) as cursor:
for row in await cursor.fetchall():
coin = self.row_to_coin(row)
coins.add(CoinRecord(coin, row[0], row[1], row[2], row[6]))
return list(coins)
async def get_coin_records_by_names(
self,
@ -278,17 +281,19 @@ class CoinStore:
names_db = tuple(names)
else:
names_db = tuple([name.hex() for name in names])
async with self.coin_record_db.execute(
f"SELECT confirmed_index, spent_index, coinbase, puzzle_hash, "
f'coin_parent, amount, timestamp FROM coin_record WHERE coin_name in ({"?," * (len(names) - 1)}?) '
f"AND confirmed_index>=? AND confirmed_index<? "
f"{'' if include_spent_coins else 'AND spent_index=0'}",
names_db + (start_height, end_height),
) as cursor:
for row in await cursor.fetchall():
coin = self.row_to_coin(row)
coins.add(CoinRecord(coin, row[0], row[1], row[2], row[6]))
async with self.db_wrapper.read_db() as conn:
async with conn.execute(
f"SELECT confirmed_index, spent_index, coinbase, puzzle_hash, "
f'coin_parent, amount, timestamp FROM coin_record WHERE coin_name in ({"?," * (len(names) - 1)}?) '
f"AND confirmed_index>=? AND confirmed_index<? "
f"{'' if include_spent_coins else 'AND spent_index=0'}",
names_db + (start_height, end_height),
) as cursor:
for row in await cursor.fetchall():
coin = self.row_to_coin(row)
coins.add(CoinRecord(coin, row[0], row[1], row[2], row[6]))
return list(coins)
@ -314,23 +319,24 @@ class CoinStore:
return []
coins = set()
for puzzles in chunks(puzzle_hashes, MAX_SQLITE_PARAMETERS):
puzzle_hashes_db: Tuple[Any, ...]
if self.db_wrapper.db_version == 2:
puzzle_hashes_db = tuple(puzzles)
else:
puzzle_hashes_db = tuple([ph.hex() for ph in puzzles])
async with self.coin_record_db.execute(
f"SELECT confirmed_index, spent_index, coinbase, puzzle_hash, "
f"coin_parent, amount, timestamp FROM coin_record INDEXED BY coin_puzzle_hash "
f'WHERE puzzle_hash in ({"?," * (len(puzzles) - 1)}?) '
f"AND (confirmed_index>=? OR spent_index>=?)"
f"{'' if include_spent_coins else 'AND spent_index=0'}",
puzzle_hashes_db + (min_height, min_height),
) as cursor:
async with self.db_wrapper.read_db() as conn:
for puzzles in chunks(puzzle_hashes, MAX_SQLITE_PARAMETERS):
puzzle_hashes_db: Tuple[Any, ...]
if self.db_wrapper.db_version == 2:
puzzle_hashes_db = tuple(puzzles)
else:
puzzle_hashes_db = tuple([ph.hex() for ph in puzzles])
async with conn.execute(
f"SELECT confirmed_index, spent_index, coinbase, puzzle_hash, "
f"coin_parent, amount, timestamp FROM coin_record INDEXED BY coin_puzzle_hash "
f'WHERE puzzle_hash in ({"?," * (len(puzzles) - 1)}?) '
f"AND (confirmed_index>=? OR spent_index>=?)"
f"{'' if include_spent_coins else 'AND spent_index=0'}",
puzzle_hashes_db + (min_height, min_height),
) as cursor:
async for row in cursor:
coins.add(self.row_to_coin_state(row))
async for row in cursor:
coins.add(self.row_to_coin_state(row))
return list(coins)
@ -345,23 +351,25 @@ class CoinStore:
return []
coins = set()
for ids in chunks(parent_ids, MAX_SQLITE_PARAMETERS):
parent_ids_db: Tuple[Any, ...]
if self.db_wrapper.db_version == 2:
parent_ids_db = tuple(ids)
else:
parent_ids_db = tuple([pid.hex() for pid in ids])
async with self.coin_record_db.execute(
f"SELECT confirmed_index, spent_index, coinbase, puzzle_hash, "
f'coin_parent, amount, timestamp FROM coin_record WHERE coin_parent in ({"?," * (len(ids) - 1)}?) '
f"AND confirmed_index>=? AND confirmed_index<? "
f"{'' if include_spent_coins else 'AND spent_index=0'}",
parent_ids_db + (start_height, end_height),
) as cursor:
async with self.db_wrapper.read_db() as conn:
for ids in chunks(parent_ids, MAX_SQLITE_PARAMETERS):
parent_ids_db: Tuple[Any, ...]
if self.db_wrapper.db_version == 2:
parent_ids_db = tuple(ids)
else:
parent_ids_db = tuple([pid.hex() for pid in ids])
async with conn.execute(
f"SELECT confirmed_index, spent_index, coinbase, puzzle_hash, "
f'coin_parent, amount, timestamp FROM coin_record WHERE coin_parent in ({"?," * (len(ids) - 1)}?) '
f"AND confirmed_index>=? AND confirmed_index<? "
f"{'' if include_spent_coins else 'AND spent_index=0'}",
parent_ids_db + (start_height, end_height),
) as cursor:
async for row in cursor:
coin = self.row_to_coin(row)
coins.add(CoinRecord(coin, row[0], row[1], row[2], row[6]))
async for row in cursor:
coin = self.row_to_coin(row)
coins.add(CoinRecord(coin, row[0], row[1], row[2], row[6]))
return list(coins)
async def get_coin_states_by_ids(
@ -374,21 +382,22 @@ class CoinStore:
return []
coins = set()
for ids in chunks(coin_ids, MAX_SQLITE_PARAMETERS):
coin_ids_db: Tuple[Any, ...]
if self.db_wrapper.db_version == 2:
coin_ids_db = tuple(ids)
else:
coin_ids_db = tuple([pid.hex() for pid in ids])
async with self.coin_record_db.execute(
f"SELECT confirmed_index, spent_index, coinbase, puzzle_hash, "
f'coin_parent, amount, timestamp FROM coin_record WHERE coin_name in ({"?," * (len(ids) - 1)}?) '
f"AND (confirmed_index>=? OR spent_index>=?)"
f"{'' if include_spent_coins else 'AND spent_index=0'}",
coin_ids_db + (min_height, min_height),
) as cursor:
async for row in cursor:
coins.add(self.row_to_coin_state(row))
async with self.db_wrapper.read_db() as conn:
for ids in chunks(coin_ids, MAX_SQLITE_PARAMETERS):
coin_ids_db: Tuple[Any, ...]
if self.db_wrapper.db_version == 2:
coin_ids_db = tuple(ids)
else:
coin_ids_db = tuple([pid.hex() for pid in ids])
async with conn.execute(
f"SELECT confirmed_index, spent_index, coinbase, puzzle_hash, "
f'coin_parent, amount, timestamp FROM coin_record WHERE coin_name in ({"?," * (len(ids) - 1)}?) '
f"AND (confirmed_index>=? OR spent_index>=?)"
f"{'' if include_spent_coins else 'AND spent_index=0'}",
coin_ids_db + (min_height, min_height),
) as cursor:
async for row in cursor:
coins.add(self.row_to_coin_state(row))
return list(coins)
async def rollback_to_block(self, block_index: int) -> List[CoinRecord]:
@ -415,38 +424,37 @@ class CoinStore:
self.coin_record_cache.remove(coin_name)
coin_changes: Dict[bytes32, CoinRecord] = {}
async with self.coin_record_db.execute(
"SELECT confirmed_index, spent_index, coinbase, puzzle_hash, "
"coin_parent, amount, timestamp FROM coin_record WHERE confirmed_index>?",
(block_index,),
) as cursor:
for row in await cursor.fetchall():
coin = self.row_to_coin(row)
record = CoinRecord(coin, uint32(0), row[1], row[2], uint64(0))
coin_changes[record.name] = record
# Delete from storage
await self.coin_record_db.execute("DELETE FROM coin_record WHERE confirmed_index>?", (block_index,))
async with self.coin_record_db.execute(
"SELECT confirmed_index, spent_index, coinbase, puzzle_hash, "
"coin_parent, amount, timestamp FROM coin_record WHERE confirmed_index>?",
(block_index,),
) as cursor:
for row in await cursor.fetchall():
coin = self.row_to_coin(row)
record = CoinRecord(coin, row[0], uint32(0), row[2], row[6])
if record.name not in coin_changes:
async with self.db_wrapper.write_db() as conn:
async with conn.execute(
"SELECT confirmed_index, spent_index, coinbase, puzzle_hash, "
"coin_parent, amount, timestamp FROM coin_record WHERE confirmed_index>?",
(block_index,),
) as cursor:
for row in await cursor.fetchall():
coin = self.row_to_coin(row)
record = CoinRecord(coin, uint32(0), row[1], row[2], uint64(0))
coin_changes[record.name] = record
if self.db_wrapper.db_version == 2:
await self.coin_record_db.execute(
"UPDATE coin_record SET spent_index=0 WHERE spent_index>?", (block_index,)
)
else:
await self.coin_record_db.execute(
"UPDATE coin_record SET spent_index = 0, spent = 0 WHERE spent_index>?", (block_index,)
)
# Delete from storage
await conn.execute("DELETE FROM coin_record WHERE confirmed_index>?", (block_index,))
async with conn.execute(
"SELECT confirmed_index, spent_index, coinbase, puzzle_hash, "
"coin_parent, amount, timestamp FROM coin_record WHERE confirmed_index>?",
(block_index,),
) as cursor:
for row in await cursor.fetchall():
coin = self.row_to_coin(row)
record = CoinRecord(coin, row[0], uint32(0), row[2], row[6])
if record.name not in coin_changes:
coin_changes[record.name] = record
if self.db_wrapper.db_version == 2:
await conn.execute("UPDATE coin_record SET spent_index=0 WHERE spent_index>?", (block_index,))
else:
await conn.execute(
"UPDATE coin_record SET spent_index = 0, spent = 0 WHERE spent_index>?", (block_index,)
)
return list(coin_changes.values())
# Store CoinRecord in DB and ram cache
@ -468,10 +476,12 @@ class CoinStore:
record.timestamp,
)
)
await self.coin_record_db.executemany(
"INSERT INTO coin_record VALUES(?, ?, ?, ?, ?, ?, ?, ?)",
values2,
)
if len(values2) > 0:
async with self.db_wrapper.write_db() as conn:
await conn.executemany(
"INSERT INTO coin_record VALUES(?, ?, ?, ?, ?, ?, ?, ?)",
values2,
)
else:
values = []
for record in records:
@ -489,10 +499,12 @@ class CoinStore:
record.timestamp,
)
)
await self.coin_record_db.executemany(
"INSERT INTO coin_record VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?)",
values,
)
if len(values) > 0:
async with self.db_wrapper.write_db() as conn:
await conn.executemany(
"INSERT INTO coin_record VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?)",
values,
)
# Update coin_record to be spent in DB
async def _set_spent(self, coin_names: List[bytes32], index: uint32):
@ -508,11 +520,11 @@ class CoinStore:
)
updates.append((index, self.maybe_to_hex(coin_name)))
if self.db_wrapper.db_version == 2:
await self.coin_record_db.executemany(
"UPDATE OR FAIL coin_record SET spent_index=? WHERE coin_name=?", updates
)
else:
await self.coin_record_db.executemany(
"UPDATE OR FAIL coin_record SET spent=1,spent_index=? WHERE coin_name=?", updates
)
if updates != []:
async with self.db_wrapper.write_db() as conn:
if self.db_wrapper.db_version == 2:
await conn.executemany("UPDATE OR FAIL coin_record SET spent_index=? WHERE coin_name=?", updates)
else:
await conn.executemany(
"UPDATE OR FAIL coin_record SET spent=1,spent_index=? WHERE coin_name=?", updates
)

View file

@ -67,7 +67,7 @@ from chia.util.bech32m import encode_puzzle_hash
from chia.util.check_fork_next_block import check_fork_next_block
from chia.util.condition_tools import pkm_pairs
from chia.util.config import PEER_DB_PATH_KEY_DEPRECATED, process_config_start_method
from chia.util.db_wrapper import DBWrapper
from chia.util.db_wrapper import DBWrapper2
from chia.util.errors import ConsensusError, Err, ValidationError
from chia.util.ints import uint8, uint32, uint64, uint128
from chia.util.path import mkdir, path_from_root
@ -85,7 +85,6 @@ class FullNode:
sync_store: Any
coin_store: CoinStore
mempool_manager: MempoolManager
connection: aiosqlite.Connection
_sync_task: Optional[asyncio.Task]
_init_weight_proof: Optional[asyncio.Task] = None
blockchain: Blockchain
@ -164,23 +163,8 @@ class FullNode:
# These many respond_transaction tasks can be active at any point in time
self.respond_transaction_semaphore = asyncio.Semaphore(200)
# create the store (db) and full node instance
self.connection = await aiosqlite.connect(self.db_path)
await self.connection.execute("pragma journal_mode=wal")
db_sync = db_synchronous_on(self.config.get("db_sync", "auto"), self.db_path)
self.log.info(f"opening blockchain DB: synchronous={db_sync}")
await self.connection.execute("pragma synchronous={}".format(db_sync))
async with self.connection.execute(
"SELECT name FROM sqlite_master WHERE type='table' AND name='full_blocks'"
) as conn:
if len(await conn.fetchall()) == 0:
try:
# this is a new DB file. Make it v2
await set_db_version_async(self.connection, 2)
except sqlite3.OperationalError:
# it could be a database created with "chia init", which is
# empty except it has the database_version table
pass
db_connection = await aiosqlite.connect(self.db_path)
db_version: int = await lookup_db_version(db_connection)
if self.config.get("log_sqlite_cmds", False):
sql_log_path = path_from_root(self.root_path, "log/sql.log")
@ -192,11 +176,38 @@ class FullNode:
log.write(timestamp + " " + req + "\n")
log.close()
await self.connection.set_trace_callback(sql_trace_callback)
await db_connection.set_trace_callback(sql_trace_callback)
db_version: int = await lookup_db_version(self.connection)
self.db_wrapper = DBWrapper2(db_connection, db_version=db_version)
# add reader threads for the DB
for i in range(self.config.get("db_readers", 4)):
c = await aiosqlite.connect(self.db_path)
if self.config.get("log_sqlite_cmds", False):
await c.set_trace_callback(sql_trace_callback)
await self.db_wrapper.add_connection(c)
await (await db_connection.execute("pragma journal_mode=wal")).close()
db_sync = db_synchronous_on(self.config.get("db_sync", "auto"), self.db_path)
self.log.info(f"opening blockchain DB: synchronous={db_sync}")
await (await db_connection.execute("pragma synchronous={}".format(db_sync))).close()
if db_version != 2:
async with self.db_wrapper.read_db() as conn:
async with conn.execute(
"SELECT name FROM sqlite_master WHERE type='table' AND name='full_blocks'"
) as cur:
if len(await cur.fetchall()) == 0:
try:
# this is a new DB file. Make it v2
async with self.db_wrapper.write_db() as w_conn:
await set_db_version_async(w_conn, 2)
self.db_wrapper.db_version = 2
except sqlite3.OperationalError:
# it could be a database created with "chia init", which is
# empty except it has the database_version table
pass
self.db_wrapper = DBWrapper(self.connection, db_version=db_version)
self.block_store = await BlockStore.create(self.db_wrapper)
self.sync_store = await SyncStore.create()
self.hint_store = await HintStore.create(self.db_wrapper)
@ -204,6 +215,7 @@ class FullNode:
self.log.info("Initializing blockchain from disk")
start_time = time.time()
reserved_cores = self.config.get("reserved_cores", 0)
single_threaded = self.config.get("single_threaded", False)
multiprocessing_start_method = process_config_start_method(config=self.config, log=self.log)
self.multiprocessing_context = multiprocessing.get_context(method=multiprocessing_start_method)
self.blockchain = await Blockchain.create(
@ -214,11 +226,13 @@ class FullNode:
blockchain_dir=self.db_path.parent,
reserved_cores=reserved_cores,
multiprocessing_context=self.multiprocessing_context,
single_threaded=single_threaded,
)
self.mempool_manager = MempoolManager(
coin_store=self.coin_store,
consensus_constants=self.constants,
multiprocessing_context=self.multiprocessing_context,
single_threaded=single_threaded,
)
# Blocks are validated under high priority, and transactions under low priority. This guarantees blocks will
@ -770,7 +784,7 @@ class FullNode:
async def _await_closed(self):
for task_id, task in list(self.full_node_store.tx_fetch_tasks.items()):
cancel_task_safe(task, self.log)
await self.connection.close()
await self.db_wrapper.close()
if self._init_weight_proof is not None:
await asyncio.wait([self._init_weight_proof])
if hasattr(self, "_blockchain_lock_queue"):
@ -984,10 +998,7 @@ class FullNode:
await self.send_peak_to_wallets()
self.blockchain.clean_block_record(end_height - self.constants.BLOCKS_CACHE_SIZE)
loop = asyncio.get_event_loop()
batch_queue: asyncio.Queue[Tuple[ws.WSChiaConnection, List[FullBlock]]] = asyncio.Queue(
loop=loop, maxsize=buffer_size
)
batch_queue: asyncio.Queue[Tuple[ws.WSChiaConnection, List[FullBlock]]] = asyncio.Queue(maxsize=buffer_size)
fetch_task = asyncio.Task(fetch_block_batches(batch_queue, peers_with_peak))
validate_task = asyncio.Task(validate_block_batches(batch_queue))
try:
@ -1544,7 +1555,7 @@ class FullNode:
elif added == ReceiveBlockResult.INVALID_BLOCK:
assert error_code is not None
self.log.error(f"Block {header_hash} at height {block.height} is invalid with code {error_code}.")
raise ConsensusError(error_code, header_hash)
raise ConsensusError(error_code, [header_hash])
elif added == ReceiveBlockResult.DISCONNECTED_BLOCK:
self.log.info(f"Disconnected block {header_hash} at height {block.height}")
@ -2225,14 +2236,11 @@ class FullNode:
new_block = dataclasses.replace(block, challenge_chain_ip_proof=vdf_proof)
if new_block is None:
return False
async with self.db_wrapper.lock:
async with self.db_wrapper.write_db():
try:
await self.block_store.db_wrapper.begin_transaction()
await self.block_store.replace_proof(header_hash, new_block)
await self.block_store.db_wrapper.commit_transaction()
return True
except BaseException as e:
await self.block_store.db_wrapper.rollback_transaction()
self.log.error(
f"_replace_proof error while adding block {block.header_hash} height {block.height},"
f" rolling back: {e} {traceback.format_exc()}"

View file

@ -1196,11 +1196,12 @@ class FullNodeAPI:
block: Optional[FullBlock] = await self.full_node.block_store.get_full_block(request.header_hash)
# We lock so that the coin store does not get modified
peak_height = self.full_node.blockchain.get_peak_height()
if (
block is None
or block.is_transaction_block() is False
or block.height != request.height
or block.height > self.full_node.blockchain.get_peak_height()
or (peak_height is not None and block.height > peak_height)
or self.full_node.blockchain.height_to_hash(block.height) != request.header_hash
):
reject = wallet_protocol.RejectRemovalsRequest(request.height, request.header_hash)
@ -1256,11 +1257,10 @@ class FullNodeAPI:
return msg
@api_request
async def send_transaction(self, request: wallet_protocol.SendTransaction) -> Optional[Message]:
async def send_transaction(self, request: wallet_protocol.SendTransaction, *, test=False) -> Optional[Message]:
spend_name = request.transaction.name()
await self.full_node.transaction_queue.put(
(0, TransactionQueueEntry(request.transaction, None, spend_name, None, False))
(0, TransactionQueueEntry(request.transaction, None, spend_name, None, test))
)
# Waits for the transaction to go into the mempool, times out after 45 seconds.
status, error = None, None

View file

@ -1,56 +1,57 @@
from typing import List, Tuple
from chia.types.blockchain_format.sized_bytes import bytes32
from chia.util.db_wrapper import DBWrapper
from chia.util.db_wrapper import DBWrapper2
import logging
log = logging.getLogger(__name__)
class HintStore:
db_wrapper: DBWrapper
db_wrapper: DBWrapper2
@classmethod
async def create(cls, db_wrapper: DBWrapper):
async def create(cls, db_wrapper: DBWrapper2):
self = cls()
self.db_wrapper = db_wrapper
if self.db_wrapper.db_version == 2:
await self.db_wrapper.db.execute(
"CREATE TABLE IF NOT EXISTS hints(coin_id blob, hint blob, UNIQUE (coin_id, hint))"
)
else:
await self.db_wrapper.db.execute(
"CREATE TABLE IF NOT EXISTS hints(id INTEGER PRIMARY KEY AUTOINCREMENT, coin_id blob, hint blob)"
)
await self.db_wrapper.db.execute("CREATE INDEX IF NOT EXISTS hint_index on hints(hint)")
await self.db_wrapper.db.commit()
async with self.db_wrapper.write_db() as conn:
if self.db_wrapper.db_version == 2:
await conn.execute("CREATE TABLE IF NOT EXISTS hints(coin_id blob, hint blob, UNIQUE (coin_id, hint))")
else:
await conn.execute(
"CREATE TABLE IF NOT EXISTS hints(id INTEGER PRIMARY KEY AUTOINCREMENT, coin_id blob, hint blob)"
)
await conn.execute("CREATE INDEX IF NOT EXISTS hint_index on hints(hint)")
return self
async def get_coin_ids(self, hint: bytes) -> List[bytes32]:
cursor = await self.db_wrapper.db.execute("SELECT coin_id from hints WHERE hint=?", (hint,))
rows = await cursor.fetchall()
await cursor.close()
async with self.db_wrapper.read_db() as conn:
cursor = await conn.execute("SELECT coin_id from hints WHERE hint=?", (hint,))
rows = await cursor.fetchall()
await cursor.close()
coin_ids = []
for row in rows:
coin_ids.append(row[0])
return coin_ids
async def add_hints(self, coin_hint_list: List[Tuple[bytes32, bytes]]) -> None:
if self.db_wrapper.db_version == 2:
cursor = await self.db_wrapper.db.executemany(
"INSERT OR IGNORE INTO hints VALUES(?, ?)",
coin_hint_list,
)
else:
cursor = await self.db_wrapper.db.executemany(
"INSERT INTO hints VALUES(?, ?, ?)",
[(None,) + record for record in coin_hint_list],
)
await cursor.close()
async with self.db_wrapper.write_db() as conn:
if self.db_wrapper.db_version == 2:
cursor = await conn.executemany(
"INSERT OR IGNORE INTO hints VALUES(?, ?)",
coin_hint_list,
)
else:
cursor = await conn.executemany(
"INSERT INTO hints VALUES(?, ?, ?)",
[(None,) + record for record in coin_hint_list],
)
await cursor.close()
async def count_hints(self) -> int:
async with self.db_wrapper.db.execute("select count(*) from hints") as cursor:
row = await cursor.fetchone()
async with self.db_wrapper.read_db() as conn:
async with conn.execute("select count(*) from hints") as cursor:
row = await cursor.fetchone()
assert row is not None

Some files were not shown because too many files have changed in this diff Show more