From 554147ad9e6fee1c1d3827ca971647a97a5c0d66 Mon Sep 17 00:00:00 2001 From: Peter Todd Date: Tue, 14 Oct 2014 13:38:17 -0400 Subject: [PATCH] Ensure MINIMALDATA invalid tests can only fail one way Removes the need for the 'negated' versions of the tests, and ensures other failures don't mask what we're trying to test. --- src/test/data/script_invalid.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/test/data/script_invalid.json b/src/test/data/script_invalid.json index 5ead65f17f..c5d8781029 100644 --- a/src/test/data/script_invalid.json +++ b/src/test/data/script_invalid.json @@ -384,6 +384,18 @@ nSequences are max. ["0x00", "'00' EQUAL", "P2SH,STRICTENC", "Basic OP_0 execution"], +["0x01 0x81", "DROP 1", "MINIMALDATA", "direct push of 0x81 equals 1NEGATE"], +["0x01 0x05", "DROP 1", "MINIMALDATA", "direct push of 0x05 equals 5"], +["0x4c 0x48 0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111", "DROP 1", "MINIMALDATA", "PUSHDATA1 of 72 bytes equals direct push of it"], +["0x4d 0xFF00 0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111", "DROP 1", "MINIMALDATA", "PUSHDATA2 of 255 bytes equals PUSHDATA1 of it"], +["0x01 0x00", "NOT DROP 1", "MINIMALDATA", "0x00 numequals 0"], +["0x01 0x80", "NOT DROP 1", "MINIMALDATA", "0x80 (negative zero) numequals 0"], +["0x02 0x0080", "NOT DROP 1", "MINIMALDATA", "0x0080 numequals 0"], +["0x02 0x0500", "NOT DROP 1", "MINIMALDATA", "0x0500 numequals 5"], +["0x03 0xff7f80", "NOT DROP 1", "MINIMALDATA", "Minimal encoding is ffff"], +["0x03 0xff7f00", "NOT DROP 1", "MINIMALDATA", "Minimal encoding is ff7f"], +["0x04 0xffff7f80", "NOT DROP 1", "MINIMALDATA", "Minimal encoding is ffffff"], +["0x04 0xffff7f00", "NOT DROP 1", "MINIMALDATA", "Minimal encoding is ffff7f"], ["1 IF 0x01 0x81 ENDIF 1", "", "MINIMALDATA", "evaluated non-minimal data"], ["1 IF 0x01 0x05 ENDIF 1", "", "MINIMALDATA", "evaluated non-minimal data"], ["1 IF 0x4c 0x03 0x222222 ENDIF 1", "", "MINIMALDATA", "evaluated non-minimal data"],