mirror of
https://github.com/basicswap/basicswap.git
synced 2025-12-30 17:11:38 +01:00
Decred CSV test.
This commit is contained in:
@@ -9,9 +9,15 @@ OP_0 = 0x00
|
||||
OP_DATA_1 = 0x01
|
||||
OP_1NEGATE = 0x4f
|
||||
OP_1 = 0x51
|
||||
OP_EQUAL = 0x87
|
||||
OP_PUSHDATA1 = 0x4c
|
||||
OP_PUSHDATA2 = 0x4d
|
||||
OP_PUSHDATA4 = 0x4e
|
||||
OP_DUP = 0x76
|
||||
OP_EQUALVERIFY = 0x88
|
||||
OP_HASH160 = 0xa9
|
||||
OP_CHECKSIG = 0xac
|
||||
OP_CHECKSEQUENCEVERIFY = 0xb2
|
||||
|
||||
|
||||
def push_script_data(data_array: bytearray, data: bytes) -> None:
|
||||
@@ -28,7 +34,7 @@ def push_script_data(data_array: bytearray, data: bytes) -> None:
|
||||
return
|
||||
|
||||
if len_data < OP_PUSHDATA1:
|
||||
data_array += bytes(((OP_DATA_1 - 1) + len_data,))
|
||||
data_array += len_data.to_bytes(1)
|
||||
elif len_data <= 0xff:
|
||||
data_array += bytes((OP_PUSHDATA1, len_data))
|
||||
elif len_data <= 0xffff:
|
||||
@@ -36,4 +42,5 @@ def push_script_data(data_array: bytearray, data: bytes) -> None:
|
||||
else:
|
||||
data_array += bytes((OP_PUSHDATA4,)) + len_data.to_bytes(4, 'little')
|
||||
|
||||
print('[rm] data_array', (data_array + data).hex())
|
||||
data_array += data
|
||||
|
||||
Reference in New Issue
Block a user