These are some edge cases that I have detected using QuickCheck in the Haskoin project which are not covered by the existing test suite.
In script_valid.json:
- All bytes of a boolean constant are significant, not only the last one. I had a dumb bug where I only checked the last byte, but it passed the test suite.
- Also casting the stack value to a 64 bit int works most of the time, unless the value overflows to 0. Added a test for that.
SIZEdoes not consume the argument. Many commands consume the input argument, some don't, I think generally there could be more test coverage of that. Maybe build a test that puts a bunch of constants on the stack, execute a bunch of operations (for which the test makes sense) and test the value and stack depth in the end.
In script_invalid.json:
BOOLAND+BOOLORhave a slightly different conception of boolean values: these functions cast inputs toint64and compare against zero, so they must fail for five-byte stack values.- Limits for
CHECKMULTISIGwere not tested:(nKeys < 20)and(nSigs <= nKeys)