decred / tinydecred

Python tools for Decred
ISC License
27 stars 14 forks source link

txscript: Add checkSStx test #143

Closed JoeGruffins closed 4 years ago

JoeGruffins commented 4 years ago

Add isSStx function and tests.

Tests come from here: https://github.com/decred/dcrd/blob/52d2d2db294b4d9b01f43d69b6e847dd88233164/blockchain/stake/staketx_test.go#L23

JoeGruffins commented 4 years ago

OP_RETURN is already checked in isNullDataScript. The script integrity is also checked, so the push data value must be the same as the pushed length. Then the minimum and maximum length for the script is checked, so the last error case was unreachable.

But please check that I am correct.