Page MenuHomePhabricator

[avalanche] Fix wrong init of the chain work in tests
ClosedPublic

Authored by Fabien on Sep 14 2023, 13:02.

Details

Reviewers
PiRK
Group Reviewers
Restricted Project
Commits
rABC867d414a5cd1: [avalanche] Fix wrong init of the chain work in tests
Summary

Does a bug that is never reached actually is a bug ? The processor tests checks ordering of the block indexes by chain work, and the initial value is initialized as arith_uint256(-1). But the arith_uint256 constructor has a variant that takes an uint64_t as an imput, so only the last 64 bits are set to 1 instead of the whole 256 bits as expected. However the chainwork on regtest is low enough that it doesn't matter, depite the code being wrong.

Test Plan
ninja check-avalanche-processor_tests

Diff Detail

Repository
rABC Bitcoin ABC
Branch
processor_test_arith_minus_one_bug
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 25031
Build 49650: Build Diffbuild-clang-tidy · lint-circular-dependencies · build-clang · build-debug · build-without-wallet · build-diff
Build 49649: arc lint + arc unit