Page MenuHomePhabricator

Introduce the strongly typed enum BlockValidity to represent the validity of a block
ClosedPublic

Authored by deadalnix on May 23 2018, 13:20.

Details

Summary

Use it as parameter to IsValid and RaiseValidity. The type safety allows us to remove some asserts as they are now invariant of the type system.

Test Plan
make check
./test/functional/test_runner.py --extended

Diff Detail

Repository
rABC Bitcoin ABC
Branch
blockstatusenumclass
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 2623
Build 3360: Bitcoin ABC Buildbot (legacy)
Build 3359: arc lint + arc unit

Event Timeline

Fix a problem where the wrong flag was checked (kind of scary no test is catching this).

schancel added inline comments.
src/chain.h
133

What's this?

191

These are doxygen comments, please don't remove them.

391

Why is this using bitmasks at all? Because we're storing failed flags in the same place? Wouldn't nStatus >= nUpTo be sufficient?

schancel requested changes to this revision.May 24 2018, 19:00
This revision now requires changes to proceed.May 24 2018, 19:00
This revision is now accepted and ready to land.May 25 2018, 14:12
This revision was automatically updated to reflect the committed changes.