diff options
author | w0xlt <94266259+w0xlt@users.noreply.github.com> | 2021-12-14 20:10:21 -0300 |
---|---|---|
committer | w0xlt <94266259+w0xlt@users.noreply.github.com> | 2021-12-15 18:41:40 -0300 |
commit | abbb7eccef3fc1c36f34756458d2792f6661e29f (patch) | |
tree | 11d952213f1d1d8e63e472ed68d358a598be7fa4 /test/functional | |
parent | 4807f73f48f4ff1084fcf7aee94e5b14592bfda8 (diff) |
refactor: Move restorewallet() RPC logic to the wallet section
It also simplifies restorewallet() and loadwallet() RPC error handling.
Diffstat (limited to 'test/functional')
-rwxr-xr-x | test/functional/wallet_backup.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/test/functional/wallet_backup.py b/test/functional/wallet_backup.py index 932df4fbff..4bcfc3aa71 100755 --- a/test/functional/wallet_backup.py +++ b/test/functional/wallet_backup.py @@ -115,12 +115,16 @@ class WalletBackupTest(BitcoinTestFramework): nonexistent_wallet_file = os.path.join(self.nodes[0].datadir, 'nonexistent_wallet.bak') wallet_name = "res0" assert_raises_rpc_error(-8, "Backup file does not exist", node.restorewallet, wallet_name, nonexistent_wallet_file) + not_created_wallet_file = os.path.join(node.datadir, self.chain, 'wallets', wallet_name) + assert not os.path.exists(not_created_wallet_file) def restore_wallet_existent_name(self): node = self.nodes[3] - wallet_file = os.path.join(self.nodes[0].datadir, 'wallet.bak') + backup_file = os.path.join(self.nodes[0].datadir, 'wallet.bak') wallet_name = "res0" - assert_raises_rpc_error(-8, "Wallet name already exists.", node.restorewallet, wallet_name, wallet_file) + wallet_file = os.path.join(node.datadir, self.chain, 'wallets', wallet_name) + error_message = "Failed to create database path '{}'. Database already exists.".format(wallet_file) + assert_raises_rpc_error(-36, error_message, node.restorewallet, wallet_name, backup_file) def init_three(self): self.init_wallet(node=0) |