Skip to content

Commit 40399fd

Browse files
codablockUdjinM6
authored andcommitted
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.
1 parent e2d651f commit 40399fd

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/functional/fundrawtransaction.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -683,9 +683,10 @@ def run_test(self):
683683
outputs = {self.nodes[2].getnewaddress(): value for value in (1.0, 1.1, 1.2, 1.3)}
684684
rawtx = self.nodes[3].createrawtransaction(inputs, outputs)
685685

686-
result = [self.nodes[3].fundrawtransaction(rawtx),
686+
# Add changePosition=4 to circumvent BIP69 input/output sorting
687+
result = [self.nodes[3].fundrawtransaction(rawtx, {"changePosition": 4}),
687688
# split the fee between outputs 0, 2, and 3, but not output 1
688-
self.nodes[3].fundrawtransaction(rawtx, {"subtractFeeFromOutputs": [0, 2, 3]})]
689+
self.nodes[3].fundrawtransaction(rawtx, {"subtractFeeFromOutputs": [0, 2, 3], "changePosition": 4})]
689690

690691
dec_tx = [self.nodes[3].decoderawtransaction(result[0]['hex']),
691692
self.nodes[3].decoderawtransaction(result[1]['hex'])]

0 commit comments

Comments
 (0)