Skip to content

Commit

Permalink
Merge pull request libbitcoin#1397 from evoskuil/master
Browse files Browse the repository at this point in the history
Make header::proof(uint32_t) public.
  • Loading branch information
evoskuil authored Feb 14, 2024
2 parents 7a84bec + 1725d92 commit 9031fdc
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
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

0 comments on commit 9031fdc

Please sign in to comment.