diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2015-03-16 12:22:52 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2015-03-16 12:23:14 +0100 |
commit | df5c246ba38c5b5bdd6192b0201d2fe8245451ca (patch) | |
tree | d03315ec086de900551c1e0413c537edabdff2c4 /qa/rpc-tests | |
parent | 41259ca6350cc9e27bd9a69bb7ab76af81262577 (diff) | |
parent | 1d9b378c3071293a31a3b4d1845d9626f10da432 (diff) |
Merge pull request #5831
1d9b378 qa/rpc-tests/wallet: Tests for sendmany (Luke Dashjr)
40a7573 rpcwallet/sendmany: Just take an array of addresses to subtract fees from, rather than an Object with all values being identical (Luke Dashjr)
292623a Subtract fee from amount (Cozz Lovan)
90a43c1 [Qt] Code-movement-only: Format confirmation message in sendcoinsdialog (Cozz Lovan)
Diffstat (limited to 'qa/rpc-tests')
-rwxr-xr-x | qa/rpc-tests/wallet.py | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/qa/rpc-tests/wallet.py b/qa/rpc-tests/wallet.py index 3e63493dc6..dc4e0f77bd 100755 --- a/qa/rpc-tests/wallet.py +++ b/qa/rpc-tests/wallet.py @@ -102,6 +102,35 @@ class WalletTest (BitcoinTestFramework): assert_equal(self.nodes[2].getbalance(), 100) assert_equal(self.nodes[2].getbalance("from1"), 100-21) + # Send 10 BTC 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 BTC 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')) + + # Sendmany 10 BTC + txid = self.nodes[2].sendmany('from1', {address: 10}, 0, "", []) + self.nodes[2].setgenerate(True, 1) + self.sync_all() + assert_equal(self.nodes[2].getbalance(), Decimal('69.99800000')) + assert_equal(self.nodes[0].getbalance(), Decimal('29.99900000')) + + # Sendmany 10 BTC with subtract fee from amount + txid = self.nodes[2].sendmany('from1', {address: 10}, 0, "", [address]) + self.nodes[2].setgenerate(True, 1) + self.sync_all() + assert_equal(self.nodes[2].getbalance(), Decimal('59.99800000')) + assert_equal(self.nodes[0].getbalance(), Decimal('39.99800000')) if __name__ == '__main__': WalletTest ().main () |