From 7596a4922d8e1b43cdc03ddaabcad538375f3ab3 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Wed, 4 Oct 2017 00:28:40 +0100 Subject: [PATCH] [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. --- qa/rpc-tests/test_framework/script.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qa/rpc-tests/test_framework/script.py b/qa/rpc-tests/test_framework/script.py index ab7f4ec74..55a7f8e51 100644 --- a/qa/rpc-tests/test_framework/script.py +++ b/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):