Page MenuHomePhabricator

[script_tests] add small NUM2BIN case
ClosedPublic

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

Details

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
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

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
This revision is now accepted and ready to land.Jul 9 2019, 17:27