aboutsummaryrefslogtreecommitdiff
path: root/test/functional
diff options
context:
space:
mode:
authorRussell Yanofsky <russ@yanofsky.org>2017-02-06 13:50:08 -0500
committerRussell Yanofsky <russ@yanofsky.org>2017-03-21 05:46:55 -0500
commit94b528bb0c31f4bf1c4b3eca7050449344ac90cf (patch)
tree106c061ec218c063c7e71c93cd243b3dfcdc8e45 /test/functional
parent919aaf6508557439ab859c25dae86998a9bed12f (diff)
[qa] Remove bumpfee.py get_change_address hack
Diffstat (limited to 'test/functional')
-rwxr-xr-xtest/functional/bumpfee.py23
1 files changed, 5 insertions, 18 deletions
diff --git a/test/functional/bumpfee.py b/test/functional/bumpfee.py
index 8f75e9ed4d..bdeea1eea4 100755
--- a/test/functional/bumpfee.py
+++ b/test/functional/bumpfee.py
@@ -115,7 +115,7 @@ def test_segwit_bumpfee_succeeds(rbf_node, dest_address):
'vout': 0,
"sequence": BIP125_SEQUENCE_NUMBER
}], {dest_address: Decimal("0.0005"),
- get_change_address(rbf_node): Decimal("0.0003")})
+ rbf_node.getrawchangeaddress(): Decimal("0.0003")})
rbfsigned = rbf_node.signrawtransaction(rbfraw)
rbfid = rbf_node.sendrawtransaction(rbfsigned["hex"])
assert rbfid in rbf_node.getrawmempool()
@@ -167,13 +167,15 @@ def test_small_output_fails(rbf_node, dest_address):
rbfid = spend_one_input(rbf_node,
Decimal("0.00100000"),
{dest_address: 0.00080000,
- get_change_address(rbf_node): Decimal("0.00010000")})
+ rbf_node.getrawchangeaddress(): Decimal("0.00010000")})
rbf_node.bumpfee(rbfid, {"totalFee": 20000})
rbfid = spend_one_input(rbf_node,
Decimal("0.00100000"),
{dest_address: 0.00080000,
get_change_address(rbf_node): Decimal("0.00010000")})
+ get_change_address(rbf_node): Decimal("0.00010000")})
+ rbf_node.getrawchangeaddress(): Decimal("0.00010000")})
assert_raises_jsonrpc(-4, "Change output is too small", rbf_node.bumpfee, rbfid, {"totalFee": 20001})
@@ -183,7 +185,7 @@ def test_dust_to_fee(rbf_node, dest_address):
rbfid = spend_one_input(rbf_node,
Decimal("0.00100000"),
{dest_address: 0.00080000,
- get_change_address(rbf_node): Decimal("0.00010000")})
+ rbf_node.getrawchangeaddress(): Decimal("0.00010000")})
fulltx = rbf_node.getrawtransaction(rbfid, 1)
bumped_tx = rbf_node.bumpfee(rbfid, {"totalFee": 19900})
full_bumped_tx = rbf_node.getrawtransaction(bumped_tx["txid"], 1)
@@ -288,21 +290,6 @@ def spend_one_input(node, input_amount, outputs):
return txid
-def get_change_address(node):
- """Get a wallet change address.
-
- There is no wallet RPC to access unused change addresses, so this creates a
- dummy transaction, calls fundrawtransaction to give add an input and change
- output, then returns the change address."""
- dest_address = node.getnewaddress()
- dest_amount = Decimal("0.00012345")
- rawtx = node.createrawtransaction([], {dest_address: dest_amount})
- fundtx = node.fundrawtransaction(rawtx)
- info = node.decoderawtransaction(fundtx["hex"])
- return next(address for out in info["vout"]
- if out["value"] != dest_amount for address in out["scriptPubKey"]["addresses"])
-
-
def submit_block_with_tx(node, tx):
ctx = CTransaction()
ctx.deserialize(io.BytesIO(hex_str_to_bytes(tx)))