|
|
|
@ -33,7 +33,7 @@ def write_tx_output(w, o: TxOutputBinType):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def write_op_push(w, n: int):
|
|
|
|
|
assert n >= 0 and n <= 4294967295
|
|
|
|
|
assert n >= 0 and n <= 0xFFFFFFFF
|
|
|
|
|
if n < 0x4C:
|
|
|
|
|
w.append(n & 0xFF)
|
|
|
|
|
elif n < 0xFF:
|
|
|
|
@ -56,7 +56,7 @@ def write_op_push(w, n: int):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def write_varint(w, n: int):
|
|
|
|
|
assert n >= 0 and n <= 4294967295
|
|
|
|
|
assert n >= 0 and n <= 0xFFFFFFFF
|
|
|
|
|
if n < 253:
|
|
|
|
|
w.append(n & 0xFF)
|
|
|
|
|
elif n < 65536:
|
|
|
|
@ -72,7 +72,7 @@ def write_varint(w, n: int):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def write_uint32(w, n: int):
|
|
|
|
|
assert n >= 0 and n <= 4294967295
|
|
|
|
|
assert n >= 0 and n <= 0xFFFFFFFF
|
|
|
|
|
w.append(n & 0xFF)
|
|
|
|
|
w.append((n >> 8) & 0xFF)
|
|
|
|
|
w.append((n >> 16) & 0xFF)
|
|
|
|
@ -80,7 +80,7 @@ def write_uint32(w, n: int):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def write_uint64(w, n: int):
|
|
|
|
|
assert n >= 0 and n <= 18446744073709551615
|
|
|
|
|
assert n >= 0 and n <= 0xFFFFFFFFFFFFFFFF
|
|
|
|
|
w.append(n & 0xFF)
|
|
|
|
|
w.append((n >> 8) & 0xFF)
|
|
|
|
|
w.append((n >> 16) & 0xFF)
|
|
|
|
|