Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make header::proof(uint32_t) public. #1397

Merged
merged 2 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,10 @@ jobs:

- name: Coveralls.io Upload
if: ${{ matrix.coverage == 'cov' }}
uses: pmienk/coveralls-github-action@master
uses: coverallsapp/github-action@v2.2.3
with:
path-to-lcov: "./coverage.info"
format: lcov
files: "./coverage.info"
github-token: ${{ secrets.github_token }}

- name: Failure display available binaries
Expand Down Expand Up @@ -406,9 +407,10 @@ jobs:

- name: Coveralls.io Upload
if: ${{ matrix.coverage == 'cov' }}
uses: pmienk/coveralls-github-action@master
uses: coverallsapp/github-action@v2.2.3
with:
path-to-lcov: "./coverage.info"
format: lcov
files: "./coverage.info"
github-token: ${{ secrets.github_token }}

- name: Failure display available binaries
Expand Down Expand Up @@ -604,9 +606,10 @@ jobs:

- name: Coveralls.io Upload
if: ${{ matrix.coverage == 'cov' }}
uses: pmienk/coveralls-github-action@master
uses: coverallsapp/github-action@v2.2.3
with:
path-to-lcov: "./coverage.info"
format: lcov
files: "./coverage.info"
github-token: ${{ secrets.github_token }}

- name: Failure display available binaries
Expand Down Expand Up @@ -701,7 +704,7 @@ jobs:

steps:
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.1
uses: microsoft/setup-msbuild@v2
with:
msbuild-architecture: x64

Expand Down Expand Up @@ -731,7 +734,7 @@ jobs:
}

- name: Execute build
run: .\build.cmd .. ${{ matrix.platform }} ${{ matrix.configuration }} ${{ matrix.version }}
run: .\build.cmd .. ${{ matrix.platform }} ${{ matrix.configuration }} x64 ${{ matrix.version }}

- name: Execute tests
shell: powershell
Expand Down
6 changes: 3 additions & 3 deletions build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ SET "relative_path_base=%~1"
call cd /d "%relative_path_base%"
SET "path_base=%cd%"
SET "nuget_pkg_path=%path_base%\.nuget\packages"
SET "msbuild_args=/verbosity:minimal /p:Platform=%~2 /p:Configuration=%~3"
SET "proj_version=%~4"
SET "msbuild_args=/verbosity:minimal /p:Platform=%~2 /p:Configuration=%~3 /p:PreferredToolArchitecture=%~4"
SET "proj_version=%~5"
SET "msbuild_exe=msbuild"
IF EXIST "%~5" SET "msbuild_exe=%~5"
IF EXIST "%~6" SET "msbuild_exe=%~6"

call :pending "Build initialized..."
IF NOT EXIST "%nuget_pkg_path%" (
Expand Down
2 changes: 1 addition & 1 deletion include/bitcoin/system/chain/header.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class BC_API header

typedef std::shared_ptr<const header> cptr;

static uint256_t proof(uint32_t bits) NOEXCEPT;
static constexpr size_t serialized_size() NOEXCEPT
{
return sizeof(version_)
Expand Down Expand Up @@ -136,7 +137,6 @@ class BC_API header

private:
static header from_data(reader& source) NOEXCEPT;
static uint256_t proof(uint32_t bits) NOEXCEPT;

// Header should be stored as shared (adds 16 bytes).
// copy: 4 * 32 + 2 * 256 + 1 = 81 bytes (vs. 16 when shared).
Expand Down
2 changes: 1 addition & 1 deletion src/chain/header.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ hash_digest header::hash() const NOEXCEPT
return digest;
}

// static/private
// static
uint256_t header::proof(uint32_t bits) NOEXCEPT
{
auto target = compact::expand(bits);
Expand Down