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_jsonrpc
10 class ResendWalletTransactionsTest(BitcoinTestFramework
):
14 self
.extra_args
= [['--walletbroadcast=false']]
18 # Should raise RPC_WALLET_ERROR (-4) if walletbroadcast is disabled.
19 assert_raises_jsonrpc(-4, "Error: Wallet transaction broadcasting is disabled with -walletbroadcast", self
.nodes
[0].resendwallettransactions
)
21 # Should return an empty array if there aren't unconfirmed wallet transactions.
23 self
.nodes
[0] = self
.start_node(0, self
.options
.tmpdir
)
24 assert_equal(self
.nodes
[0].resendwallettransactions(), [])
26 # Should return an array with the unconfirmed wallet transaction.
27 txid
= self
.nodes
[0].sendtoaddress(self
.nodes
[0].getnewaddress(), 1)
28 assert_equal(self
.nodes
[0].resendwallettransactions(), [txid
])
30 if __name__
== '__main__':
31 ResendWalletTransactionsTest().main()