Page MenuHomePhabricator

[script_tests] add small NUM2BIN case

Authored by markblundeberg on Jul 9 2019, 14:35.



Implementors may be tempted to have NUM2BIN bail out early if the
input is already of the requested size, however this is incorrect--
in the case of a "negative zero" representation, NUM2BIN must flip
the sign bit.

Test Plan

make check

Diff Detail

rABC Bitcoin ABC
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

markblundeberg created this revision.Jul 9 2019, 14:35
Herald added a reviewer: Restricted Project. · View Herald TranscriptJul 9 2019, 14:35

I've checked a variety of other implementations (bchd, verde, BU) and none are performing the incorrect bail-early optimization I suggest here, but you never know, someone might think it's a "clever" idea one day.

markblundeberg retitled this revision from add small NUM2BIN test case to [script_tests] add small NUM2BIN case.Jul 9 2019, 16:22
deadalnix accepted this revision.Jul 9 2019, 17:27
This revision is now accepted and ready to land.Jul 9 2019, 17:27