Page MenuHomePhabricator

[script_tests] add small NUM2BIN case
ClosedPublic

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

Details

Reviewers
deadalnix
Fabien
jasonbcox
Group Reviewers
Restricted Project
Commits
rABCfb6523889606: [script_tests] add small NUM2BIN case
Summary

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

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

Event Timeline

markblundeberg created this revision.Tue, Jul 9, 14:35
Herald added a reviewer: Restricted Project. · View Herald TranscriptTue, Jul 9, 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.Tue, Jul 9, 16:22
deadalnix accepted this revision.Tue, Jul 9, 17:27
This revision is now accepted and ready to land.Tue, Jul 9, 17:27