Changeset View
Changeset View
Standalone View
Standalone View
test/functional/wallet_resendwallettransactions.py
Show All 15 Lines | class ResendWalletTransactionsTest(BitcoinTestFramework): | ||||
def skip_test_if_missing_module(self): | def skip_test_if_missing_module(self): | ||||
self.skip_if_no_wallet() | self.skip_if_no_wallet() | ||||
def run_test(self): | def run_test(self): | ||||
# Should raise RPC_WALLET_ERROR (-4) if walletbroadcast is disabled. | # Should raise RPC_WALLET_ERROR (-4) if walletbroadcast is disabled. | ||||
assert_raises_rpc_error(-4, "Error: Wallet transaction broadcasting is disabled with -walletbroadcast", | assert_raises_rpc_error(-4, "Error: Wallet transaction broadcasting is disabled with -walletbroadcast", | ||||
self.nodes[0].resendwallettransactions) | self.nodes[0].resendwallettransactions) | ||||
# Should return an empty array if there aren't unconfirmed wallet transactions. | # Should return an empty array if there aren't unconfirmed wallet | ||||
# transactions. | |||||
self.stop_node(0) | self.stop_node(0) | ||||
self.start_node(0, extra_args=[]) | self.start_node(0, extra_args=[]) | ||||
assert_equal(self.nodes[0].resendwallettransactions(), []) | assert_equal(self.nodes[0].resendwallettransactions(), []) | ||||
# Should return an array with the unconfirmed wallet transaction. | # Should return an array with the unconfirmed wallet transaction. | ||||
txid = self.nodes[0].sendtoaddress(self.nodes[0].getnewaddress(), 1) | txid = self.nodes[0].sendtoaddress(self.nodes[0].getnewaddress(), 1) | ||||
assert_equal(self.nodes[0].resendwallettransactions(), [txid]) | assert_equal(self.nodes[0].resendwallettransactions(), [txid]) | ||||
if __name__ == '__main__': | if __name__ == '__main__': | ||||
ResendWalletTransactionsTest().main() | ResendWalletTransactionsTest().main() |