From 40399fd973d8a00fa43a043a60bac48c8c19fa33 Mon Sep 17 00:00:00 2001 From: Alexander Block Date: Sun, 22 Sep 2019 22:47:17 +0200 Subject: [PATCH] Circumvent BIP69 sorting in fundrawtransaction.py test (#3100) "subtractFeeFromOutputs" is applied to the ordering of the input transaction and after that BIP69 sorting is performed. This causes flakiness in tests. --- test/functional/fundrawtransaction.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/functional/fundrawtransaction.py b/test/functional/fundrawtransaction.py index 3b17561b8b..14b511e74a 100755 --- a/test/functional/fundrawtransaction.py +++ b/test/functional/fundrawtransaction.py @@ -683,9 +683,10 @@ class RawTransactionsTest(BitcoinTestFramework): outputs = {self.nodes[2].getnewaddress(): value for value in (1.0, 1.1, 1.2, 1.3)} rawtx = self.nodes[3].createrawtransaction(inputs, outputs) - result = [self.nodes[3].fundrawtransaction(rawtx), + # Add changePosition=4 to circumvent BIP69 input/output sorting + result = [self.nodes[3].fundrawtransaction(rawtx, {"changePosition": 4}), # split the fee between outputs 0, 2, and 3, but not output 1 - self.nodes[3].fundrawtransaction(rawtx, {"subtractFeeFromOutputs": [0, 2, 3]})] + self.nodes[3].fundrawtransaction(rawtx, {"subtractFeeFromOutputs": [0, 2, 3], "changePosition": 4})] dec_tx = [self.nodes[3].decoderawtransaction(result[0]['hex']), self.nodes[3].decoderawtransaction(result[1]['hex'])]