Skip to content

Commit 830eadf

Browse files
committed
Solving rpc_fundrawtransaction.py amount rounding issue.
1 parent 6cf9778 commit 830eadf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/functional/rpc_fundrawtransaction.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ def test_locked_wallet(self):
375375
self.nodes[1].getrawchangeaddress()
376376
utx = get_unspent(self.nodes[1].listunspent(), DecimalAmt(250.0))
377377
inputs = [{'txid': utx['txid'], 'vout': utx['vout']}]
378-
outputs = {self.nodes[0].getnewaddress(): 250.0 - float(self.test_no_change_fee) - float(self.fee_tolerance)}
378+
outputs = {self.nodes[0].getnewaddress(): round(250.0 - float(self.test_no_change_fee) - float(self.fee_tolerance), 8)}
379379
rawtx = self.nodes[1].createrawtransaction(inputs, outputs)
380380
# fund a transaction that does not require a new key for the change output
381381
self.nodes[1].fundrawtransaction(rawtx)
@@ -413,7 +413,7 @@ def test_many_inputs_int(self, fCompareFee):
413413
self.log.info("test with many inputs (%s)" % info)
414414

415415
# Empty node1, send some small coins from node0 to node1.
416-
self.nodes[1].sendtoaddress(self.nodes[0].getnewaddress(), float(self.nodes[1].getbalance()) - 0.001)
416+
self.nodes[1].sendtoaddress(self.nodes[0].getnewaddress(), round((float(self.nodes[1].getbalance()) - 0.001), 8))
417417
self.nodes[1].generate(1)
418418
self.sync_all()
419419

0 commit comments

Comments
 (0)