diff options
author | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2023-01-04 00:06:05 +0100 |
---|---|---|
committer | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2023-01-04 00:06:05 +0100 |
commit | 21ad4e26ec320dcecc8961888bc82d0bb72d5ed3 (patch) | |
tree | 284c25bd793f88087d8105a1ce3228a393249701 /test/functional/wallet_crosschain.py | |
parent | 8c7222bda3f7136f312a6e57b76d6a2d0a114f68 (diff) | |
download | bitcoin-21ad4e26ec320dcecc8961888bc82d0bb72d5ed3.tar.xz |
test: add coverage for cross-chain wallet restore
Diffstat (limited to 'test/functional/wallet_crosschain.py')
-rwxr-xr-x | test/functional/wallet_crosschain.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/test/functional/wallet_crosschain.py b/test/functional/wallet_crosschain.py index 549eec34c3..f7ba0ba151 100755 --- a/test/functional/wallet_crosschain.py +++ b/test/functional/wallet_crosschain.py @@ -36,20 +36,28 @@ class WalletCrossChain(BitcoinTestFramework): self.log.info("Creating wallets") node0_wallet = os.path.join(self.nodes[0].datadir, 'node0_wallet') + node0_wallet_backup = os.path.join(self.nodes[0].datadir, 'node0_wallet.bak') self.nodes[0].createwallet(node0_wallet) + self.nodes[0].backupwallet(node0_wallet_backup) self.nodes[0].unloadwallet(node0_wallet) node1_wallet = os.path.join(self.nodes[1].datadir, 'node1_wallet') + node1_wallet_backup = os.path.join(self.nodes[0].datadir, 'node1_wallet.bak') self.nodes[1].createwallet(node1_wallet) + self.nodes[1].backupwallet(node1_wallet_backup) self.nodes[1].unloadwallet(node1_wallet) - self.log.info("Loading wallets into nodes with a different genesis blocks") + self.log.info("Loading/restoring wallets into nodes with a different genesis block") if self.options.descriptors: assert_raises_rpc_error(-18, 'Wallet file verification failed.', self.nodes[0].loadwallet, node1_wallet) assert_raises_rpc_error(-18, 'Wallet file verification failed.', self.nodes[1].loadwallet, node0_wallet) + assert_raises_rpc_error(-18, 'Wallet file verification failed.', self.nodes[0].restorewallet, 'w', node1_wallet_backup) + assert_raises_rpc_error(-18, 'Wallet file verification failed.', self.nodes[1].restorewallet, 'w', node0_wallet_backup) else: assert_raises_rpc_error(-4, 'Wallet files should not be reused across chains.', self.nodes[0].loadwallet, node1_wallet) assert_raises_rpc_error(-4, 'Wallet files should not be reused across chains.', self.nodes[1].loadwallet, node0_wallet) + assert_raises_rpc_error(-4, 'Wallet files should not be reused across chains.', self.nodes[0].restorewallet, 'w', node1_wallet_backup) + assert_raises_rpc_error(-4, 'Wallet files should not be reused across chains.', self.nodes[1].restorewallet, 'w', node0_wallet_backup) if not self.options.descriptors: self.log.info("Override cross-chain wallet load protection") |