Page MenuHomePhabricator

Add a facility to parse and validate script bitfields.
ClosedPublic

Authored by deadalnix on Jul 25 2019, 01:53.

Details

Summary

As per title. Bitfield are little endian and has a size proportional to the number of bits they represent. The decoder validates that there are no out of bound bits.

Test Plan

Added unit tests.

Diff Detail

Repository
rABC Bitcoin ABC
Branch
scriptfitfield
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 6955
Build 11957: Bitcoin ABC Buildbot (legacy)
Build 11956: arc lint + arc unit

Event Timeline

Fabien requested changes to this revision.Jul 25 2019, 07:32
Fabien added a subscriber: Fabien.

The build is failing

src/script/bitfield.cpp
11

Why do you need size to be signed ?

src/script/bitfield.h
13

count => size

This revision now requires changes to proceed.Jul 25 2019, 07:32
src/script/bitfield.cpp
11

Clearly, no.

Make the size unsigned.
count => size

Include stddef to get size_t

This revision is now accepted and ready to land.Jul 25 2019, 11:42
This revision was landed with ongoing or failed builds.Jul 25 2019, 13:21
This revision was automatically updated to reflect the committed changes.