|
def witness_version(self): |
|
"""Returns the witness version on [0,16]. """ |
|
return next(iter(self)) |
Because the witness version is actually a 'small int' opcode - that is, for witness version 1, without decode_op_n(), the returned value will be 0x51. It worked for version 0 because 'small int' opcode is decoded as 0 --> 0; 0x51..0x60 --> 1..16