HomePhabricator

[script_tests] improve coverage of minimal number encoding

Description

[script_tests] improve coverage of minimal number encoding

Summary:
It looks like the MINIMALDATA flag is destined to be a consensus rule so
it needs to be tested properly.

A couple of sections are labelled "Test every numeric-accepting opcode
for correct handling of the numeric minimal encoding rule" and a few
number-accepting opcodes have been added since then, so for completeness
the tests now include all number-accepting opcodes. Some of these are
redundant but it's good to have them all collected in one place.

(Also there was an oversight in one OP_NUM2BIN test which supposedly failed
due to nonminimal number, but actually failed due to too-long number. With
a shorter non-minimal number the test actually passes.)

Test Plan: make check

Reviewers: deadalnix, jasonbcox, Fabien, Mengerian, #bitcoin_abc

Reviewed By: deadalnix, #bitcoin_abc

Differential Revision: https://reviews.bitcoinabc.org/D3347

Details

Provenance
Mark Lundeberg <36528214+markblundeberg@users.noreply.github.com>Authored on Jul 16 2019, 20:32
markblundebergPushed on Jul 16 2019, 20:36
Reviewer
Restricted Project
Differential Revision
D3347: [script_tests] improve coverage of minimal number encoding
Parents
rABC30ae54784116: add SCRIPT_ENABLE_SCHNORR_MULTISIG flag for new multisig mode
Branches
Unknown
Tags
Unknown

Event Timeline

Mark Lundeberg <36528214+markblundeberg@users.noreply.github.com> committed rABC149cb12f78f9: [script_tests] improve coverage of minimal number encoding (authored by Mark Lundeberg <36528214+markblundeberg@users.noreply.github.com>).Jul 16 2019, 20:36