Skip to content

test: Fix block_reward type to optional<uint64_t>#1559

Merged
chfast merged 1 commit into
masterfrom
test/blockchaintest_cleanup
Jun 1, 2026
Merged

test: Fix block_reward type to optional<uint64_t>#1559
chfast merged 1 commit into
masterfrom
test/blockchaintest_cleanup

Conversation

@chfast

@chfast chfast commented Jun 1, 2026

Copy link
Copy Markdown
Member

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aligns the blockchain test runner’s block reward plumbing with the state::finalize() API by using std::optional<uint64_t> for block rewards, ensuring type consistency when applying mining rewards across forks.

Changes:

  • Update apply_block() to accept std::optional<uint64_t> for block_reward.
  • Update mining_reward() to return std::optional<uint64_t>.
Comments suppressed due to low confidence (1)

test/blockchaintest/blockchaintest_runner.cpp:236

  • mining_reward() now returns std::optional<uint64_t>, but the reward literals are unsuffixed (signed) integer constants. Making them explicitly uint64_t (e.g., ULL) avoids signed→unsigned conversion warnings under -Wsign-conversion and makes the intent clear.
        return 5'000000000'000000000;
    if (rev < EVMC_CONSTANTINOPLE)
        return 3'000000000'000000000;
    if (rev < EVMC_PARIS)
        return 2'000000000'000000000;

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov

codecov Bot commented Jun 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.07%. Comparing base (b76a4f8) to head (5616422).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1559   +/-   ##
=======================================
  Coverage   97.07%   97.07%           
=======================================
  Files         162      162           
  Lines       14480    14480           
  Branches     3380     3380           
=======================================
  Hits        14057    14057           
  Misses        305      305           
  Partials      118      118           
Flag Coverage Δ
eest-develop 91.84% <ø> (ø)
eest-develop-gmp 26.44% <ø> (ø)
eest-legacy 17.69% <ø> (ø)
eest-libsecp256k1 28.08% <ø> (ø)
eest-stable 91.78% <ø> (ø)
evmone-unittests 92.53% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
core 95.94% <ø> (ø)
tooling 87.81% <ø> (ø)
tests 99.79% <ø> (ø)
Files with missing lines Coverage Δ
test/blockchaintest/blockchaintest_runner.cpp 85.99% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@chfast chfast merged commit bf6200b into master Jun 1, 2026
24 checks passed
@chfast chfast deleted the test/blockchaintest_cleanup branch June 1, 2026 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants