diff options
author | MarcoFalke <falke.marco@gmail.com> | 2016-04-30 23:16:06 +0200 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2016-05-02 19:36:06 +0200 |
commit | fa17f93fbd2889c020849b941a94c5bd8a619a3c (patch) | |
tree | 3aae34a0e34a9cd77bd99118dfa9b6b8795d86fd /qa/rpc-tests/smartfees.py | |
parent | 0ad104190465d8d65c2344bbe10dcf3df025d86c (diff) |
[qa] smartfees: Properly use ordered dict
Diffstat (limited to 'qa/rpc-tests/smartfees.py')
-rwxr-xr-x | qa/rpc-tests/smartfees.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/qa/rpc-tests/smartfees.py b/qa/rpc-tests/smartfees.py index 2c064ad8a0..b3fb8fb100 100755 --- a/qa/rpc-tests/smartfees.py +++ b/qa/rpc-tests/smartfees.py @@ -7,6 +7,7 @@ # Test fee estimation code # +from collections import OrderedDict from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * @@ -49,8 +50,8 @@ def small_txpuzzle_randfee(from_node, conflist, unconflist, amount, min_fee, fee if total_in <= amount + fee: raise RuntimeError("Insufficient funds: need %d, have %d"%(amount+fee, total_in)) outputs = {} - outputs[P2SH_1] = total_in - amount - fee - outputs[P2SH_2] = amount + outputs = OrderedDict([(P2SH_1, total_in - amount - fee), + (P2SH_2, amount)]) rawtx = from_node.createrawtransaction(inputs, outputs) # Createrawtransaction constructions a transaction that is ready to be signed # These transactions don't need to be signed, but we still have to insert the ScriptSig @@ -78,12 +79,10 @@ def split_inputs(from_node, txins, txouts, initial_split = False): ''' prevtxout = txins.pop() inputs = [] - outputs = {} inputs.append({ "txid" : prevtxout["txid"], "vout" : prevtxout["vout"] }) half_change = satoshi_round(prevtxout["amount"]/2) rem_change = prevtxout["amount"] - half_change - Decimal("0.00001000") - outputs[P2SH_1] = half_change - outputs[P2SH_2] = rem_change + outputs = OrderedDict([(P2SH_1, half_change), (P2SH_2, rem_change)]) rawtx = from_node.createrawtransaction(inputs, outputs) # If this is the initial split we actually need to sign the transaction # Otherwise we just need to insert the property ScriptSig |