|
7 | 7 | # Test fee estimation code |
8 | 8 | # |
9 | 9 |
|
| 10 | +from collections import OrderedDict |
10 | 11 | from test_framework.test_framework import BitcoinTestFramework |
11 | 12 | from test_framework.util import * |
12 | 13 |
|
@@ -49,8 +50,8 @@ def small_txpuzzle_randfee(from_node, conflist, unconflist, amount, min_fee, fee |
49 | 50 | if total_in <= amount + fee: |
50 | 51 | raise RuntimeError("Insufficient funds: need %d, have %d"%(amount+fee, total_in)) |
51 | 52 | outputs = {} |
52 | | - outputs[P2SH_1] = total_in - amount - fee |
53 | | - outputs[P2SH_2] = amount |
| 53 | + outputs = OrderedDict([(P2SH_1, total_in - amount - fee), |
| 54 | + (P2SH_2, amount)]) |
54 | 55 | rawtx = from_node.createrawtransaction(inputs, outputs) |
55 | 56 | # Createrawtransaction constructions a transaction that is ready to be signed |
56 | 57 | # 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): |
78 | 79 | ''' |
79 | 80 | prevtxout = txins.pop() |
80 | 81 | inputs = [] |
81 | | - outputs = {} |
82 | 82 | inputs.append({ "txid" : prevtxout["txid"], "vout" : prevtxout["vout"] }) |
83 | 83 | half_change = satoshi_round(prevtxout["amount"]/2) |
84 | 84 | rem_change = prevtxout["amount"] - half_change - Decimal("0.00001000") |
85 | | - outputs[P2SH_1] = half_change |
86 | | - outputs[P2SH_2] = rem_change |
| 85 | + outputs = OrderedDict([(P2SH_1, half_change), (P2SH_2, rem_change)]) |
87 | 86 | rawtx = from_node.createrawtransaction(inputs, outputs) |
88 | 87 | # If this is the initial split we actually need to sign the transaction |
89 | 88 | # Otherwise we just need to insert the property ScriptSig |
|
0 commit comments