Browse Source

[Test] MiniNode: Coerce OP_PUSHDATA bytearrays to bytes

If a bytearray is passed in as part of an iterable, the CScript constructor
fails because b''.join() cannot be used to join a bytearray to a bytes or str in
Python 2.
pull/4/head
Jack Grigg 7 years ago
parent
commit
7596a4922d
No known key found for this signature in database GPG Key ID: 665DBCD284F7DAFF
  1. 2
      qa/rpc-tests/test_framework/script.py

2
qa/rpc-tests/test_framework/script.py

@ -666,7 +666,7 @@ class CScript(bytes):
else:
other = CScriptOp.encode_op_pushdata(bignum.bn2vch(other))
elif isinstance(other, (bytes, bytearray)):
other = CScriptOp.encode_op_pushdata(other)
other = bytes(CScriptOp.encode_op_pushdata(other))
return other
def __add__(self, other):

Loading…
Cancel
Save