Open inauman opened 3 years ago
Hi, I agree, it's a typo. Btw the parse operation correctly has equality sign.
Yes it should be if length <= 75:
since in Bitcoin Wiki the single byte opcodes 1-75 (inclusive) are the single byte push opcodes. As it stands the raw_serialize
function will raise a ValueError
exception if a data element byte vector of length 75 is encountered in the commands list of a Script object. The 2 elif
's set up the push opcodes 76 and 77, which are required for lengths > 75.
According to ch06 in the book, "For a number between 1 and 75 inclusive, we know the next n bytes are an element". So, the condition in line 8 in the above code of raw_serialize(self) function should have an equality test as well. I think it should be:
I am still learning bitcoin programming so please let me know if I am not thinking correctly. I would be happy to do a PR to fix this minor issue.