aboutsummaryrefslogtreecommitdiff
path: root/qa/rpc-tests/wallet.py
diff options
context:
space:
mode:
authorCozz Lovan <cozzlovan@yahoo.com>2014-07-23 14:34:36 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2015-03-13 11:04:18 +0100
commit292623adf59edea52b2927b3d67fd2ff7f997882 (patch)
treeafec21b4e7ff1c2b551b060f5f435895d43d15d6 /qa/rpc-tests/wallet.py
parent90a43c1e93318584d5443b513c2c0e937acb966a (diff)
Subtract fee from amount
Fixes #2724 and #1570. Adds the automatically-subtract-the-fee-from-the-amount-and-send-whats-left feature to the GUI and RPC (sendtoaddress,sendmany).
Diffstat (limited to 'qa/rpc-tests/wallet.py')
-rwxr-xr-xqa/rpc-tests/wallet.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/qa/rpc-tests/wallet.py b/qa/rpc-tests/wallet.py
index 3e63493dc6..84d3023996 100755
--- a/qa/rpc-tests/wallet.py
+++ b/qa/rpc-tests/wallet.py
@@ -102,6 +102,21 @@ class WalletTest (BitcoinTestFramework):
assert_equal(self.nodes[2].getbalance(), 100)
assert_equal(self.nodes[2].getbalance("from1"), 100-21)
+ # Send 10 XBT normal
+ address = self.nodes[0].getnewaddress("test")
+ self.nodes[2].settxfee(Decimal('0.001'))
+ txid = self.nodes[2].sendtoaddress(address, 10, "", "", False)
+ self.nodes[2].setgenerate(True, 1)
+ self.sync_all()
+ assert_equal(self.nodes[2].getbalance(), Decimal('89.99900000'))
+ assert_equal(self.nodes[0].getbalance(), Decimal('10.00000000'))
+
+ # Send 10 XBT with subtract fee from amount
+ txid = self.nodes[2].sendtoaddress(address, 10, "", "", True)
+ self.nodes[2].setgenerate(True, 1)
+ self.sync_all()
+ assert_equal(self.nodes[2].getbalance(), Decimal('79.99900000'))
+ assert_equal(self.nodes[0].getbalance(), Decimal('19.99900000'))
if __name__ == '__main__':
WalletTest ().main ()