scripted-diff: rename assert_raises_jsonrpc to assert_raises_rpc error
[bitcoinplatinum.git] / test / functional / resendwallettransactions.py
blobd959bb4c3836466fa11e50fabc9da6f3d1cfc4d9
1 #!/usr/bin/env python3
2 # Copyright (c) 2017 The Bitcoin Core developers
3 # Distributed under the MIT software license, see the accompanying
4 # file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 """Test resendwallettransactions RPC."""
7 from test_framework.test_framework import BitcoinTestFramework
8 from test_framework.util import assert_equal, assert_raises_rpc_error
10 class ResendWalletTransactionsTest(BitcoinTestFramework):
11 def set_test_params(self):
12 self.num_nodes = 1
13 self.extra_args = [['--walletbroadcast=false']]
15 def run_test(self):
16 # Should raise RPC_WALLET_ERROR (-4) if walletbroadcast is disabled.
17 assert_raises_rpc_error(-4, "Error: Wallet transaction broadcasting is disabled with -walletbroadcast", self.nodes[0].resendwallettransactions)
19 # Should return an empty array if there aren't unconfirmed wallet transactions.
20 self.stop_node(0)
21 self.start_node(0, extra_args=[])
22 assert_equal(self.nodes[0].resendwallettransactions(), [])
24 # Should return an array with the unconfirmed wallet transaction.
25 txid = self.nodes[0].sendtoaddress(self.nodes[0].getnewaddress(), 1)
26 assert_equal(self.nodes[0].resendwallettransactions(), [txid])
28 if __name__ == '__main__':
29 ResendWalletTransactionsTest().main()