You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
1.3 KiB
30 lines
1.3 KiB
7 years ago
|
#!/usr/bin/env python3
|
||
|
# Copyright (c) 2017 The Bitcoin Core developers
|
||
|
# Distributed under the MIT software license, see the accompanying
|
||
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||
|
"""Test resendwallettransactions RPC."""
|
||
|
|
||
|
from test_framework.test_framework import BitcoinTestFramework
|
||
8 years ago
|
from test_framework.util import assert_equal, assert_raises_rpc_error
|
||
7 years ago
|
|
||
|
class ResendWalletTransactionsTest(BitcoinTestFramework):
|
||
8 years ago
|
def set_test_params(self):
|
||
7 years ago
|
self.num_nodes = 1
|
||
8 years ago
|
self.extra_args = [['--walletbroadcast=false']]
|
||
7 years ago
|
|
||
|
def run_test(self):
|
||
|
# Should raise RPC_WALLET_ERROR (-4) if walletbroadcast is disabled.
|
||
8 years ago
|
assert_raises_rpc_error(-4, "Error: Wallet transaction broadcasting is disabled with -walletbroadcast", self.nodes[0].resendwallettransactions)
|
||
7 years ago
|
|
||
|
# Should return an empty array if there aren't unconfirmed wallet transactions.
|
||
|
self.stop_node(0)
|
||
8 years ago
|
self.start_node(0, extra_args=[])
|
||
7 years ago
|
assert_equal(self.nodes[0].resendwallettransactions(), [])
|
||
|
|
||
|
# Should return an array with the unconfirmed wallet transaction.
|
||
|
txid = self.nodes[0].sendtoaddress(self.nodes[0].getnewaddress(), 1)
|
||
|
assert_equal(self.nodes[0].resendwallettransactions(), [txid])
|
||
|
|
||
|
if __name__ == '__main__':
|
||
|
ResendWalletTransactionsTest().main()
|