mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 14:08:40 +01:00
test: Normalize struct.pack format
* Add () around some int values * Remove b-prefix from strings This is needed for the scripted diff to work.
This commit is contained in:
@@ -58,9 +58,9 @@ class CScriptOp(int):
|
||||
elif len(d) <= 0xff:
|
||||
return b'\x4c' + bytes([len(d)]) + d # OP_PUSHDATA1
|
||||
elif len(d) <= 0xffff:
|
||||
return b'\x4d' + struct.pack(b'<H', len(d)) + d # OP_PUSHDATA2
|
||||
return b'\x4d' + struct.pack('<H', len(d)) + d # OP_PUSHDATA2
|
||||
elif len(d) <= 0xffffffff:
|
||||
return b'\x4e' + struct.pack(b'<I', len(d)) + d # OP_PUSHDATA4
|
||||
return b'\x4e' + struct.pack('<I', len(d)) + d # OP_PUSHDATA4
|
||||
else:
|
||||
raise ValueError("Data too long to encode in a PUSHDATA op")
|
||||
|
||||
@@ -670,7 +670,7 @@ def LegacySignatureMsg(script, txTo, inIdx, hashtype):
|
||||
txtmp.vin.append(tmp)
|
||||
|
||||
s = txtmp.serialize_without_witness()
|
||||
s += struct.pack(b"<I", hashtype)
|
||||
s += struct.pack("<I", hashtype)
|
||||
|
||||
return (s, None)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user