aboutsummaryrefslogtreecommitdiff
path: root/test/functional/fundrawtransaction.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/fundrawtransaction.py')
-rwxr-xr-xtest/functional/fundrawtransaction.py19
1 files changed, 10 insertions, 9 deletions
diff --git a/test/functional/fundrawtransaction.py b/test/functional/fundrawtransaction.py
index b86ea2d877..9ddafeb611 100755
--- a/test/functional/fundrawtransaction.py
+++ b/test/functional/fundrawtransaction.py
@@ -23,15 +23,12 @@ class RawTransactionsTest(BitcoinTestFramework):
self.num_nodes = 4
def setup_network(self, split=False):
- self.nodes = start_nodes(self.num_nodes, self.options.tmpdir)
-
- connect_nodes_bi(self.nodes,0,1)
- connect_nodes_bi(self.nodes,1,2)
- connect_nodes_bi(self.nodes,0,2)
- connect_nodes_bi(self.nodes,0,3)
+ self.setup_nodes()
- self.is_network_split=False
- self.sync_all()
+ connect_nodes_bi(self.nodes, 0, 1)
+ connect_nodes_bi(self.nodes, 1, 2)
+ connect_nodes_bi(self.nodes, 0, 2)
+ connect_nodes_bi(self.nodes, 0, 3)
def run_test(self):
min_relay_tx_fee = self.nodes[0].getnetworkinfo()['relayfee']
@@ -53,6 +50,11 @@ class RawTransactionsTest(BitcoinTestFramework):
self.nodes[0].generate(121)
self.sync_all()
+ # ensure that setting changePosition in fundraw with an exact match is handled properly
+ rawmatch = self.nodes[2].createrawtransaction([], {self.nodes[2].getnewaddress():50})
+ rawmatch = self.nodes[2].fundrawtransaction(rawmatch, {"changePosition":1, "subtractFeeFromOutputs":[0]})
+ assert_equal(rawmatch["changepos"], -1)
+
watchonly_address = self.nodes[0].getnewaddress()
watchonly_pubkey = self.nodes[0].validateaddress(watchonly_address)["pubkey"]
watchonly_amount = Decimal(200)
@@ -462,7 +464,6 @@ class RawTransactionsTest(BitcoinTestFramework):
connect_nodes_bi(self.nodes,1,2)
connect_nodes_bi(self.nodes,0,2)
connect_nodes_bi(self.nodes,0,3)
- self.is_network_split=False
self.sync_all()
# drain the keypool