aboutsummaryrefslogtreecommitdiff
path: root/qa/rpc-tests/replace-by-fee.py
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2016-04-10 16:54:28 +0200
committerMarcoFalke <falke.marco@gmail.com>2016-04-10 20:35:57 +0200
commitfaa41ee204124da19dcf1e5b8a3aef1e216bf5e6 (patch)
tree4b33bcb6db57bcde90e12d1b0e9140c4d8cb32ba /qa/rpc-tests/replace-by-fee.py
parent0afac87e8173dd71616e211aa08dcd59cb5cf90e (diff)
downloadbitcoin-faa41ee204124da19dcf1e5b8a3aef1e216bf5e6.tar.xz
[qa] py2: Unfiddle strings into bytes explicitly
Diffstat (limited to 'qa/rpc-tests/replace-by-fee.py')
-rwxr-xr-xqa/rpc-tests/replace-by-fee.py10
1 files changed, 2 insertions, 8 deletions
diff --git a/qa/rpc-tests/replace-by-fee.py b/qa/rpc-tests/replace-by-fee.py
index b951900c4d..4c8ef6de26 100755
--- a/qa/rpc-tests/replace-by-fee.py
+++ b/qa/rpc-tests/replace-by-fee.py
@@ -11,15 +11,11 @@ from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
from test_framework.script import *
from test_framework.mininode import *
-import binascii
MAX_REPLACEMENT_LIMIT = 100
-def satoshi_round(amount):
- return Decimal(amount).quantize(Decimal('0.00000001'), rounding=ROUND_DOWN)
-
def txToHex(tx):
- return binascii.hexlify(tx.serialize()).decode('utf-8')
+ return bytes_to_hex_str(tx.serialize())
def make_utxo(node, amount, confirmed=True, scriptPubKey=CScript([1])):
"""Create a txout with a given amount and scriptPubKey
@@ -53,9 +49,7 @@ def make_utxo(node, amount, confirmed=True, scriptPubKey=CScript([1])):
tx2.vout = [CTxOut(amount, scriptPubKey)]
tx2.rehash()
- binascii.hexlify(tx2.serialize()).decode('utf-8')
-
- signed_tx = node.signrawtransaction(binascii.hexlify(tx2.serialize()).decode('utf-8'))
+ signed_tx = node.signrawtransaction(txToHex(tx2))
txid = node.sendrawtransaction(signed_tx['hex'], True)