1
0

transaction.py: shortcut witness/scriptSig serialisation

This commit is contained in:
SomberNight
2018-04-18 19:00:14 +02:00
parent b3110b3b46
commit 1d6f000868
4 changed files with 51 additions and 28 deletions

View File

@@ -188,6 +188,13 @@ def var_int(i):
return "ff"+int_to_hex(i,8)
def witness_push(item):
""" Returns data in the form it should be present in the witness.
hex -> hex
"""
return var_int(len(item) // 2) + item
def op_push(i):
if i<0x4c: # OP_PUSHDATA1
return int_to_hex(i)