mirror of
https://github.com/bitcoin/bitcoin.git
synced 2024-11-20 10:38:42 +01:00
tests: Remove redundant bytes²
This commit is contained in:
parent
0d6992168c
commit
9db48c5634
@ -379,7 +379,7 @@ class CScriptNum():
|
||||
r.append(0x80 if neg else 0)
|
||||
elif neg:
|
||||
r[-1] |= 0x80
|
||||
return bytes(bytes([len(r)]) + r)
|
||||
return bytes([len(r)]) + r
|
||||
|
||||
|
||||
class CScript(bytes):
|
||||
@ -404,9 +404,9 @@ class CScript(bytes):
|
||||
other = CScriptNum.encode(other)
|
||||
elif isinstance(other, int):
|
||||
if 0 <= other <= 16:
|
||||
other = bytes(bytes([CScriptOp.encode_op_n(other)]))
|
||||
other = bytes([CScriptOp.encode_op_n(other)])
|
||||
elif other == -1:
|
||||
other = bytes(bytes([OP_1NEGATE]))
|
||||
other = bytes([OP_1NEGATE])
|
||||
else:
|
||||
other = CScriptOp.encode_op_pushdata(bn2vch(other))
|
||||
elif isinstance(other, (bytes, bytearray)):
|
||||
|
Loading…
Reference in New Issue
Block a user