aboutsummaryrefslogtreecommitdiff
path: root/qa/rpc-tests/getblocktemplate_proposals.py
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2016-05-06 11:23:48 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2016-05-06 11:24:14 +0200
commit77b637f20e8cb91cf007bf416b603ca362385cdb (patch)
tree9e912a7296f6bc2f06bbd6bc3e44737393de0dab /qa/rpc-tests/getblocktemplate_proposals.py
parent65aecda52d0d2179f77d675dc305225a1566c48f (diff)
parentfa389d4edc367073e2ccc6d1f0790c4b72ba17f2 (diff)
downloadbitcoin-77b637f20e8cb91cf007bf416b603ca362385cdb.tar.xz
Merge #7814: [qa] Switch to py3
fa389d4 [qa] Switch to py3 (MarcoFalke)
Diffstat (limited to 'qa/rpc-tests/getblocktemplate_proposals.py')
-rwxr-xr-xqa/rpc-tests/getblocktemplate_proposals.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/qa/rpc-tests/getblocktemplate_proposals.py b/qa/rpc-tests/getblocktemplate_proposals.py
index be119031ba..1ad2af4c2e 100755
--- a/qa/rpc-tests/getblocktemplate_proposals.py
+++ b/qa/rpc-tests/getblocktemplate_proposals.py
@@ -1,5 +1,5 @@
-#!/usr/bin/env python2
-# Copyright (c) 2014-2015 The Bitcoin Core developers
+#!/usr/bin/env python3
+# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
@@ -46,7 +46,7 @@ def genmrklroot(leaflist):
cur = n
return cur[0]
-def template_to_bytes(tmpl, txlist):
+def template_to_bytearray(tmpl, txlist):
blkver = pack('<L', tmpl['version'])
mrklroot = genmrklroot(list(dblsha(a) for a in txlist))
timestamp = pack('<L', tmpl['curtime'])
@@ -55,10 +55,10 @@ def template_to_bytes(tmpl, txlist):
blk += varlenEncode(len(txlist))
for tx in txlist:
blk += tx
- return blk
+ return bytearray(blk)
def template_to_hex(tmpl, txlist):
- return b2x(template_to_bytes(tmpl, txlist))
+ return b2x(template_to_bytearray(tmpl, txlist))
def assert_template(node, tmpl, txlist, expect):
rsp = node.getblocktemplate({'data':template_to_hex(tmpl, txlist),'mode':'proposal'})
@@ -129,7 +129,7 @@ class GetBlockTemplateProposalTest(BitcoinTestFramework):
tmpl['bits'] = realbits
# Test 9: Bad merkle root
- rawtmpl = template_to_bytes(tmpl, txlist)
+ rawtmpl = template_to_bytearray(tmpl, txlist)
rawtmpl[4+32] = (rawtmpl[4+32] + 1) % 0x100
rsp = node.getblocktemplate({'data':b2x(rawtmpl),'mode':'proposal'})
if rsp != 'bad-txnmrklroot':