haskoin/haskoin — pull request #75 by OttoAllmendinger (2014-07-16 10:15:59+00:00)
Title: Script: OP_PUSHDATA can have zero-length payload

There were some byte sequences that could be decoded into Script, but could not
be encoded back into byte sequences again.

Also fixed `opPushData BS.empty`

Add tests asserting `(encode (decode bytes)) == bytes` for canonic tests cases

Should now behave identically to the reference implementation:
https://github.com/bitcoin/bitcoin/blob/0.9.2/src/script.h#L372